Skip to content

Commit 418ef8e

Browse files
author
Huaqiao Zhang
committed
fix: default app svc on register center return the configurable with some fields values like func executer order, selected profiles or device names containing space character result failing parsing
Signed-off-by: Huaqiao Zhang <huaqiaoz@vmware.com>
1 parent 764ebff commit 418ef8e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

web/src/app/app-service/app-service-configurable/app-service-configurable.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ export class AppServiceConfigurableComponent implements OnInit {
8383

8484
loadAppSvcConfig() {
8585
this.appSvc.getAppSvcConfigBySvcKey(this.appServiceKey).subscribe((resp) => {
86+
Object.assign(this.configTrigger, resp[this.TirggerIdentifier]);
8687

87-
Object.assign(this.configTrigger, resp[this.TirggerIdentifier])
88-
89-
let writable: Writable = resp[this.writableIdentifier]
88+
let writable: Writable = resp[this.writableIdentifier];
9089
Object.assign(this.configWritable, writable);
9190
Object.assign(this.insecureSecrets, writable.InsecureSecrets)
9291

9392
this.selectedFunctionsName = writable.Pipeline.ExecutionOrder.split(',');
9493
Object.assign(this.availableFunctions, writable.Pipeline.Functions);
94+
// console.log(this.availableFunctions)
9595
})
9696
}
9797

web/src/app/app-service/app-service-configurable/pipeline-function/pipeline-function.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ export class PipelineFunctionComponent implements OnInit, OnChanges {
4747
private _selectedFunctionsName: string[] = [];
4848
@Input()
4949
get selectedFunctionsName(): string[] {return this._selectedFunctionsName };
50-
set selectedFunctionsName(funcNames: string[]) {this._selectedFunctionsName = funcNames;}
50+
set selectedFunctionsName(funcNames: string[]) {
51+
funcNames.forEach((v,i) => {funcNames[i] = v.trim()});
52+
this._selectedFunctionsName = funcNames;
53+
}
5154
@Output() selectedFunctionsNameChange = new EventEmitter<string[]>();
5255

5356
constructor() {
@@ -69,6 +72,7 @@ export class PipelineFunctionComponent implements OnInit, OnChanges {
6972
if (this.availableFunctions.FilterByProfileName?.Parameters) {
7073
if (this.availableFunctions.FilterByProfileName!.Parameters.ProfileNames) {
7174
this.profileNames = this.availableFunctions.FilterByProfileName!.Parameters.ProfileNames.split(',');
75+
this.profileNames.forEach((v,i) => {this.profileNames[i] = v.trim()});
7276
}
7377
}
7478
}
@@ -121,7 +125,7 @@ export class PipelineFunctionComponent implements OnInit, OnChanges {
121125
isSelected(funcName: string): boolean {
122126
let selected = false
123127
this.selectedFunctionsName.forEach((name) => {
124-
if (funcName === name) {
128+
if (funcName === name.trim()) {
125129
selected = true
126130
return
127131
}

0 commit comments

Comments
 (0)