diff options
author | JvD_Ericsson <jeff.van.dam@est.tech> | 2023-05-29 09:48:42 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2023-05-29 15:37:53 +0000 |
commit | 32d8a1dba11780a622b337e77830f9095f0767ee (patch) | |
tree | 4952eafb1390b90d68eb8c9bbb98ef13856d36ec /catalog-ui | |
parent | 2a473f639dd543d78d1f2c6ca439722dccebefd1 (diff) |
Fix various bugs related to tosca custom functions
Issue-ID: SDC-4512
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: Ia501b124ddf0c77c97ca0c14bbaa18be39b8f631
Diffstat (limited to 'catalog-ui')
2 files changed, 5 insertions, 7 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-custom-function/tosca-custom-function.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-custom-function/tosca-custom-function.component.ts index 35f1649ec6..ad72adad22 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-custom-function/tosca-custom-function.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-custom-function/tosca-custom-function.component.ts @@ -80,7 +80,7 @@ export class ToscaCustomFunctionComponent implements OnInit { this.parameters = []; } this.fillVariables(); - if (this.name && this.isDefaultCustomFunction) { + if (this.name) { this.customFunctionFormName.setValue(this.name); this.emitOnValidityChange(); } else { diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-function.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-function.component.ts index b9559838f4..34ed9a618d 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-function.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/tosca-function/tosca-function.component.ts @@ -140,8 +140,8 @@ export class ToscaFunctionComponent implements OnInit, OnChanges { let type = this.property.toscaFunction.type; if (type == ToscaFunctionType.CUSTOM) { let name = (this.property.toscaFunction as ToscaCustomFunction).name; - let test = this.customToscaFunctions.find(custToscFunc => _.isEqual(custToscFunc.name, name)) - if (test) { + let customToscaFunc = this.customToscaFunctions.find(custToscFunc => _.isEqual(custToscFunc.name, name)) + if (customToscaFunc) { this.toscaFunctionTypeForm.setValue(name); } else { this.toscaFunctionTypeForm.setValue("other"); @@ -160,9 +160,6 @@ export class ToscaFunctionComponent implements OnInit, OnChanges { this.toscaFunctions.push(ToscaFunctionType.GET_ATTRIBUTE); this.toscaFunctions.push(ToscaFunctionType.GET_INPUT); this.toscaFunctions.push(ToscaFunctionType.GET_PROPERTY); - if (this.property.type === PROPERTY_TYPES.STRING || this.property.type === PROPERTY_TYPES.ANY) { - this.toscaFunctions.push(ToscaFunctionType.CUSTOM); - } if ((this.property.type === PROPERTY_TYPES.STRING || this.property.type === PROPERTY_TYPES.ANY) && this.overridingType === undefined) { this.toscaFunctions.push(ToscaFunctionType.CONCAT); } @@ -189,7 +186,8 @@ export class ToscaFunctionComponent implements OnInit, OnChanges { getCustomFunctionName():string { let toscaFunctionType: CustomToscaFunction = this.getCustomToscaFunction(); - return toscaFunctionType.name; + let name = toscaFunctionType.name; + return name == 'other' ? '' : name; } getCustomFunctionType():string { |