Skip to content

Commit 5c67633

Browse files
committed
downgrading JavaScript code to satisfy JET build process
1 parent 6e08977 commit 5c67633

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

webui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"test": "mocha --timeout 10000 --reporter spec src/test/*-test.js",
66
"coverage": "nyc --reporter=lcov --reporter=text-summary npm run test",
77
"start": "ojet serve web --server-only",
8-
"build:release": "ojet build web",
8+
"build:release": "ojet build web --release",
99
"eslint": "npx eslint src/js/*.js src/js/models/*.js src/js/utils/*.js src/js/viewModels/*.js src/js/viewModels/quickstart/*.js src/test/*.js",
1010
"jet-audit": "ojaf"
1111
},

webui/src/js/utils/k8s-helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function(WktActionsBase, project, wktConsole, i18n, projectIo, dialogHelper, val
4141
}));
4242
const result = await dialogHelper.promptDialog('k8s-helper-choose-cluster-dialog',
4343
{ availableClusters: args });
44-
if (result?.clusterName) {
44+
if (result && result.clusterName) {
4545
clusterToCheck = result.clusterName;
4646
} else {
4747
return Promise.resolve(false);

webui/src/js/utils/vz-application-status-checker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function (VzActionsBase, project, wktConsole, i18n, projectIo, dialogHelper, K8s
3636
targetClusters.forEach(targetCluster => args.push({ name:targetCluster, label: targetCluster }));
3737
const result = await dialogHelper.promptDialog('vz-application-status-choose-cluster-dialog',
3838
{ targetClusters: args });
39-
if (result?.clusterName) {
39+
if (result && result.clusterName) {
4040
clusterToCheck = result.clusterName;
4141
} else {
4242
return Promise.resolve(false);

webui/src/js/viewModels/kubectl-page.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function(accUtils, ko, project, i18n, ArrayDataProvider, BufferingDataProvider,
191191
const options = { kubeConfig: this.project.kubectl.kubeConfig.value };
192192
const kubeContext = this.project.kubectl.kubeConfigContextToUse.value;
193193
getContext(kubectlExe, options, kubeContext).then(result => {
194-
if (result?.kubectlContextName) {
194+
if (result && result.kubectlContextName) {
195195
this.project.kubectl.kubeConfigContextToUse.observable(result.kubectlContextName);
196196
}
197197
});
@@ -205,7 +205,7 @@ function(accUtils, ko, project, i18n, ArrayDataProvider, BufferingDataProvider,
205205
const options = { kubeConfig: managedClusterData.kubeConfig };
206206
const kubeContext = managedClusterData.kubeContext;
207207
getContext(kubectlExe, options, kubeContext).then(result => {
208-
if (result?.kubectlContextName) {
208+
if (result && result.kubectlContextName) {
209209
const newManagedClusterData = Object.assign({}, managedClusterData);
210210
newManagedClusterData.kubeContext = result.kubectlContextName;
211211
this.project.kubectl.vzManagedClusters.observable.replace(managedClusterData, newManagedClusterData);

webui/src/js/viewModels/vz-application-design-view.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
107107

108108
dialogHelper.promptDialog('choose-component-dialog', { availableComponentNames }).then(result => {
109109
// no result indicates operation was cancelled
110-
if (result?.componentName) {
110+
if (result && result.componentName) {
111111
this.project.vzApplication.components.addNewItem({
112112
name: result.componentName,
113113
ingressTraitEnable: false,
@@ -214,7 +214,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
214214

215215
dialogHelper.promptDialog('choose-secrets-dialog', args).then(result => {
216216
// no result indicates operation was cancelled
217-
if (result?.secretNames) {
217+
if (result && result.secretNames) {
218218
this.project.vzApplication.secrets.value = result.secretNames;
219219
this.populateObservableSecrets();
220220
}
@@ -236,7 +236,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
236236
};
237237
dialogHelper.promptDialog('choose-secret-dialog', args).then(result => {
238238
// no result indicates operation was cancelled
239-
if (result?.secretName) {
239+
if (result && result.secretName) {
240240
selectedSecretNameObservable(result.secretName);
241241
}
242242
});
@@ -257,7 +257,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
257257
};
258258
dialogHelper.promptDialog('choose-secret-dialog', args).then(result => {
259259
// no result indicates operation was cancelled
260-
if (result?.secretName) {
260+
if (result && result.secretName) {
261261
selectedSecretNameObservable(result.secretName);
262262
}
263263
});
@@ -343,7 +343,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
343343
};
344344
dialogHelper.promptDialog('choose-deployment-dialog', args).then(result => {
345345
// no result indicates operation was cancelled
346-
if (result?.deploymentName) {
346+
if (result && result.deploymentName) {
347347
selectedDeploymentNameObservable(result.deploymentName);
348348
}
349349
});
@@ -393,7 +393,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
393393

394394
dialogHelper.promptDialog('choose-clusters-dialog', { selectedClusterNames, availableClusterNames }).then(result => {
395395
// no result indicates operation was cancelled
396-
if (result?.clusterNames) {
396+
if (result && result.clusterNames) {
397397
this.project.vzApplication.placementClusters.value = result.clusterNames;
398398
this.populateObservableClusters();
399399
}
@@ -499,7 +499,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
499499
const observableArray = this.componentObservable(component, 'ingressTraitRules');
500500
const newRule = { uid: utils.getShortUuid() };
501501
dialogHelper.promptDialog('vz-ingress-trait-rule-edit-dialog', newRule).then(result => {
502-
if (result?.rule) {
502+
if (result && result.rule) {
503503
observableArray.push(result.rule);
504504
}
505505
});
@@ -513,7 +513,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
513513
const ruleOptions = { ...rule };
514514

515515
dialogHelper.promptDialog('vz-ingress-trait-rule-edit-dialog', ruleOptions).then(result => {
516-
if (result?.rule) {
516+
if (result && result.rule) {
517517
const mergedRule = this.mergeRule(rule, result.rule);
518518
observableArray.replace(rule, mergedRule);
519519
}

0 commit comments

Comments
 (0)