Skip to content

Commit a4fafa8

Browse files
committed
working around Jet build issues with newer Javascript syntax
1 parent 8b994e7 commit a4fafa8

File tree

4 files changed

+19
-16
lines changed

4 files changed

+19
-16
lines changed

webui/src/js/utils/vz-application-resource-generator.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ define(['models/wkt-project', 'utils/vz-helper', 'js-yaml', 'utils/i18n', 'utils
1818
let appSpec = this._generateApplicationSpec(isMultiCluster);
1919

2020
if (isMultiCluster) {
21+
const template = Object.assign({}, appSpec)
2122
appSpec = {
2223
apiVersion: this._getMultiClusterApplicationApiVersion(),
2324
kind: 'MultiClusterApplicationConfiguration',
2425
metadata: { },
2526
spec: {
26-
template: {
27-
...appSpec
28-
},
27+
template,
2928
placement: {
3029
clusters: []
3130
},
3231
},
3332
};
33+
3434
this._setNameAndNamespace(appSpec.metadata);
3535

3636
for (const clusterName of this.project.vzApplication.placementClusters.value) {
3737
appSpec.spec.placement.clusters.push({ name: clusterName });
3838
}
3939

4040
if (this.project.vzApplication.secrets.value.length > 0) {
41-
appSpec.spec.secrets = [...this.project.vzApplication.secrets.value];
41+
appSpec.spec.secrets = [ ...this.project.vzApplication.secrets.value ];
4242
}
4343
}
4444
return jsYaml.dump(appSpec).split('\n');
@@ -140,7 +140,7 @@ define(['models/wkt-project', 'utils/vz-helper', 'js-yaml', 'utils/i18n', 'utils
140140
}
141141
if (Array.isArray(ingressTraitRule.paths) && ingressTraitRule.paths.length > 0) {
142142
rule.paths = ingressTraitRule.paths.map(path => {
143-
const newPath = { ...path };
143+
const newPath = Object.assign({}, path);
144144
delete newPath.uid;
145145
return newPath;
146146
});

webui/src/js/utils/vz-component-configmap-generator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ define(['models/wkt-project', 'utils/k8s-domain-configmap-generator', 'utils/vz-
2222
return [];
2323
}
2424

25-
this.configMapComponentName = k8sDomainConfigMap.metadata?.name;
26-
this.configMapComponentNamespace = k8sDomainConfigMap.metadata?.namespace;
25+
this.configMapComponentName = k8sDomainConfigMap.metadata ? k8sDomainConfigMap.metadata.name : '<UNKNOWN>';
26+
this.configMapComponentNamespace = k8sDomainConfigMap.metadata ? k8sDomainConfigMap.metadata.namespace : '<UNKNOWN>';
2727
const component = {
2828
apiVersion: this._getApiVersion(),
2929
kind: 'Component',

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

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,27 @@ function(VzActionsBase, project, wktConsole, i18n, projectIo, dialogHelper) {
8787
tag: project.vzInstall.versionTag.value,
8888
profile: project.vzInstall.installationProfile.value,
8989
};
90-
const status = await window.api.ipc.invoke('verify-verrazzano-install-status', kubectlExe, kubectlOptions, vzOptions);
90+
const statusResult = await window.api.ipc.invoke('verify-verrazzano-install-status', kubectlExe, kubectlOptions, vzOptions);
9191
dialogHelper.closeBusyDialog();
92-
if (status.isSuccess) {
93-
if (status.isComplete) {
94-
this.project.vzInstall.actualInstalledVersion.value = status.version;
92+
if (statusResult.isSuccess) {
93+
if (statusResult.isComplete) {
94+
this.project.vzInstall.actualInstalledVersion.value = statusResult.version;
9595
const title = i18n.t('vz-install-status-checker-status-complete-title');
9696
const message = i18n.t('vz-install-status-checker-status-complete-message', { name: vzOptions.name });
9797
await window.api.ipc.invoke('show-info-message', title, message);
9898
} else {
99+
const message = statusResult.payload ? statusResult.payload.message : '<no message>';
100+
const status = statusResult.payload ? statusResult.payload.status : '<no status>';
101+
99102
const title = i18n.t('vz-install-status-checker-status-incomplete-title');
100-
const message = i18n.t('vz-install-status-checker-status-incomplete-message',
101-
{ name: vzOptions.name, message: status.payload?.message, status: status.payload?.status });
102-
await window.api.ipc.invoke('show-info-message', title, message);
103+
const errMessage = i18n.t('vz-install-status-checker-status-incomplete-message',
104+
{ name: vzOptions.name, message, status });
105+
await window.api.ipc.invoke('show-info-message', title, errMessage);
103106
}
104107
} else {
105108
const title = i18n.t('vz-install-status-checker-status-failed-title');
106109
const message = i18n.t('vz-install-status-checker-status-failed-error-message',
107-
{ name: vzOptions.name, error: status.reason });
110+
{ name: vzOptions.name, error: statusResult.reason });
108111
await window.api.ipc.invoke('show-error-message', title, message);
109112
return Promise.resolve(false);
110113
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ function (project, accUtils, utils, ko, i18n, BufferingDataProvider, ArrayDataPr
484484

485485
const observableArray = this.componentObservable(component, 'ingressTraitRules');
486486
const rule = observableArray()[rowContext.item.index];
487-
const ruleOptions = {...rule};
487+
const ruleOptions = { ...rule };
488488

489489
dialogHelper.promptDialog('vz-ingress-trait-rule-edit-dialog', ruleOptions).then(result => {
490490
if (result?.rule) {

0 commit comments

Comments
 (0)