From 2cec95af3db0383fc33b2688e4a6ac753815dadc Mon Sep 17 00:00:00 2001 From: Robert Patrick Date: Mon, 4 Mar 2024 21:50:16 +0000 Subject: [PATCH] fixing createAuxImage operation to not include empty variables or archive files --- electron/app/js/wktLogging.js | 4 ++-- electron/app/locales/en/webui.json | 6 +++--- webui/package-lock.json | 14 +++++++------- webui/package.json | 2 +- webui/src/js/utils/project-io.js | 4 ++-- webui/src/js/utils/wit-aux-creator.js | 28 ++++++++++++++++++++++++--- 6 files changed, 40 insertions(+), 18 deletions(-) diff --git a/electron/app/js/wktLogging.js b/electron/app/js/wktLogging.js index e43c2857f..e6457e39a 100644 --- a/electron/app/js/wktLogging.js +++ b/electron/app/js/wktLogging.js @@ -1,6 +1,6 @@ /** * @license - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. */ const path = require('path'); @@ -188,7 +188,7 @@ function getRotatingFileTransport(fileLogConfig) { _logFileName = newFilename; // this _logger call is safe only because it happens after the logger has been initialized. // - _logger.notice(`Log file rotated from ${oldFilename} to ${newFilename}`); + _logger.info(`Log file rotated from ${oldFilename} to ${newFilename}`); }); return fileTransport; diff --git a/electron/app/locales/en/webui.json b/electron/app/locales/en/webui.json index aaa95645b..6f9e59464 100644 --- a/electron/app/locales/en/webui.json +++ b/electron/app/locales/en/webui.json @@ -953,8 +953,8 @@ "ingress-design-ingress-annotations": "Optional Annotations", "ingress-design-ingress-route-name-help": "The name to be used for creating this ingress route.", "ingress-design-ingress-route-virtualhost-help": "The virtual host name is used as the host routing rule for this ingress route.", - "ingress-design-ingress-route-targetservice-help": "The target service is the where this ingress route will send the request to the backend Kubernetes service address.", - "ingress-design-ingress-route-targetport-help": "The target port is the where this ingress route will send the request to the backend Kubernetes service port.", + "ingress-design-ingress-route-targetservice-help": "The target service where this ingress route will send the request to the backend Kubernetes service address.", + "ingress-design-ingress-route-targetport-help": "The target port where this ingress route will send the request to the backend Kubernetes service port.", "ingress-design-ingress-route-path-help": "The URL path routing rule for this ingress route.", "ingress-design-ingress-route-annotations-table-title": "Ingress Route Annotations", "ingress-design-ingress-route-annotation-key-help": "The name of the annotation used for this ingress route.", @@ -962,7 +962,7 @@ "ingress-design-ingress-route-annotation-add-row-tooltip": "Add Annotation", "ingress-design-ingress-route-annotation-delete-row-tooltip": "Delete Annotation", "ingress-design-ingress-route-traefik-mw-label": "Traefik Middleware", - "ingress-design-ingress-route-traefik-mw-help": "Customize Traefik Middlewares Object", + "ingress-design-ingress-route-traefik-mw-help": "Customize Traefik Middleware Object", "ingress-design-ingress-routes-get-services-in-namespace-title" : "Retrieving existing domain service details", "ingress-design-ingress-routes-get-services-in-namespace-error-message": "Failed to get existing domain services from Kubernetes namespace {{namespace}}: {{error}}.", diff --git a/webui/package-lock.json b/webui/package-lock.json index 7ef9b6c37..dac9d7cdd 100644 --- a/webui/package-lock.json +++ b/webui/package-lock.json @@ -7,7 +7,7 @@ "dependencies": { "@oracle/oraclejet": "^14.1.8", "@oracle/oraclejet-core-pack": "^14.1.8", - "@oracle/wrc-jet-pack": "~2.4.6", + "@oracle/wrc-jet-pack": "~2.4.7", "ace-builds": "^1.27.0", "i18next": "^23.5.1", "jquery": "^3.7.1", @@ -1286,9 +1286,9 @@ "integrity": "sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw==" }, "node_modules/@oracle/wrc-jet-pack": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/@oracle/wrc-jet-pack/-/wrc-jet-pack-2.4.6.tgz", - "integrity": "sha512-99omu4t41Zp137sHwdlLf+VMwR4muS7MobAqN5EtYWWdvz/9FaPiV/PuZp1Ch/xf67o0KyNYOgd1DU2jKKd10w==", + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/@oracle/wrc-jet-pack/-/wrc-jet-pack-2.4.7.tgz", + "integrity": "sha512-/HqpfrTT6upNK8HahI2XdWL4UGC+6Sb2/IOlctw9w/H1CSfBAOFV3/LurtIJogvaIu+ObBUcuWy8GND636R2jw==", "engines": { "node": ">=4.0.0" } @@ -9172,9 +9172,9 @@ } }, "@oracle/wrc-jet-pack": { - "version": "2.4.6", - "resolved": "https://registry.npmjs.org/@oracle/wrc-jet-pack/-/wrc-jet-pack-2.4.6.tgz", - "integrity": "sha512-99omu4t41Zp137sHwdlLf+VMwR4muS7MobAqN5EtYWWdvz/9FaPiV/PuZp1Ch/xf67o0KyNYOgd1DU2jKKd10w==" + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/@oracle/wrc-jet-pack/-/wrc-jet-pack-2.4.7.tgz", + "integrity": "sha512-/HqpfrTT6upNK8HahI2XdWL4UGC+6Sb2/IOlctw9w/H1CSfBAOFV3/LurtIJogvaIu+ObBUcuWy8GND636R2jw==" }, "@pkgjs/parseargs": { "version": "0.11.0", diff --git a/webui/package.json b/webui/package.json index 77f5b7e58..344763394 100644 --- a/webui/package.json +++ b/webui/package.json @@ -12,7 +12,7 @@ "dependencies": { "@oracle/oraclejet": "^14.1.8", "@oracle/oraclejet-core-pack": "^14.1.8", - "@oracle/wrc-jet-pack": "~2.4.6", + "@oracle/wrc-jet-pack": "~2.4.7", "ace-builds": "^1.27.0", "i18next": "^23.5.1", "jquery": "^3.7.1", diff --git a/webui/src/js/utils/project-io.js b/webui/src/js/utils/project-io.js index 07a1b1106..177b042b1 100644 --- a/webui/src/js/utils/project-io.js +++ b/webui/src/js/utils/project-io.js @@ -1,12 +1,12 @@ /** * @license - * Copyright (c) 2021, 2022, Oracle and/or its affiliates. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. */ 'use strict'; /** - * An helper object for project IO. + * A helper object for project IO. * Returns a singleton. */ diff --git a/webui/src/js/utils/wit-aux-creator.js b/webui/src/js/utils/wit-aux-creator.js index 55e113ea1..451b29172 100644 --- a/webui/src/js/utils/wit-aux-creator.js +++ b/webui/src/js/utils/wit-aux-creator.js @@ -1,6 +1,6 @@ /** * @license - * Copyright (c) 2021, 2023, Oracle and/or its affiliates. + * Copyright (c) 2021, 2024, Oracle and/or its affiliates. * Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. */ 'use strict'; @@ -279,9 +279,31 @@ function (WitActionsBase, project, wktConsole, wdtModelPreparer, i18n, projectIo } addWdtConfig(projectDirectory, createConfig) { + const variableFiles = this.project.wdtModel.propertiesFiles.value; + const nonEmptyVariableFiles = []; + if (Array.isArray(variableFiles) && variableFiles.length > 0) { + // This code currently supports a single variable file. + const variableFileContent = this.project.wdtModel.getPropertyFileContents(); + for (const [file, contents] of Object.entries(variableFileContent)) { + if (Object.getOwnPropertyNames(contents).length > 0) { + nonEmptyVariableFiles.push(file); + } + } + } + + const archiveFiles = this.project.wdtModel.archiveFiles.value; + const nonEmptyArchiveFiles = []; + if (Array.isArray(archiveFiles) && archiveFiles.length > 0) { + // This code currently supports a single archive file. + const archiveRoots = this.project.wdtModel.archiveRoots(); + if (Array.isArray(archiveRoots) && archiveRoots.length > 0) { + nonEmptyArchiveFiles.push(archiveFiles[0]); + } + } + createConfig.modelFiles = this.getAbsoluteModelFiles(projectDirectory, this.project.wdtModel.modelFiles.value); - createConfig.variableFiles = this.getAbsoluteModelFiles(projectDirectory, this.project.wdtModel.propertiesFiles.value); - createConfig.archiveFiles = this.getAbsoluteModelFiles(projectDirectory, this.project.wdtModel.archiveFiles.value); + createConfig.variableFiles = this.getAbsoluteModelFiles(projectDirectory, nonEmptyVariableFiles); + createConfig.archiveFiles = this.getAbsoluteModelFiles(projectDirectory, nonEmptyArchiveFiles); // Because we are overriding the defaults for these next two options, // we should always include them if they have a value. //