diff options
author | JvD_Ericsson <jeff.van.dam@est.tech> | 2022-09-09 15:25:52 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2022-11-04 14:20:07 +0000 |
commit | 0fd600655b7dd0079ee247b6fab0b4b678f13c05 (patch) | |
tree | 94dfbb6cd8ba696a37f5199ed1eedb6a449c2305 /catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts | |
parent | 5b132d205f1a87889b6e52140e45e8afba1d5692 (diff) |
Support Tosca Function For Operation Implmentation Properties
Issue-ID: SDC-4170
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: Ie90626e11885e522fba91e7604c0ed15cc0c7d3a
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts index 216dc3284e..c7fcea069f 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts @@ -33,6 +33,7 @@ import {DropDownComponent} from "onap-ui-angular/dist/form-elements/dropdown/dro import {DataTypeService} from "../../../../services/data-type.service"; import {Observable} from "rxjs/Observable"; import {DataTypeModel} from "../../../../../models/data-types"; +import {InstanceFeDetails} from "../../../../../models/instance-fe-details"; @Component({ selector: 'operation-handler', @@ -46,12 +47,14 @@ export class InterfaceOperationHandlerComponent { @ViewChild('interfaceOperationDropDown') interfaceOperationDropDown: DropDownComponent; input: { + componentInstanceMap: Map<string, InstanceFeDetails>; toscaArtifactTypes: Array<DropdownValue>; selectedInterface: UIInterfaceModel; selectedInterfaceOperation: InterfaceOperationModel; validityChangedCallback: Function; isViewOnly: boolean; isEdit: boolean; + validImplementationProps:boolean; modelName: string; }; @@ -67,6 +70,7 @@ export class InterfaceOperationHandlerComponent { isLoading: boolean = false; isViewOnly: boolean; isEdit: boolean; + validImplementationProps:boolean; interfaceTypes: Array<DropdownValue> = []; interfaceTypeOptions: Array<DropDownOption> = []; selectedInterfaceType: DropDownOption = undefined; @@ -78,6 +82,7 @@ export class InterfaceOperationHandlerComponent { toscaArtifactTypeProperties: Array<PropertyBEModel> = []; artifactTypeProperties: Array<InputOperationParameter> = []; toscaArtifactTypes: Array<DropdownValue> = []; + componentInstanceMap: Map<string, InstanceFeDetails>; enableAddArtifactImplementation: boolean; propertyValueValid: boolean = true; inputTypeOptions: any[]; @@ -88,6 +93,8 @@ export class InterfaceOperationHandlerComponent { ngOnInit() { this.isViewOnly = this.input.isViewOnly; this.isEdit = this.input.isEdit; + this.validImplementationProps = this.input.validImplementationProps; + this.componentInstanceMap = this.input.componentInstanceMap ? this.input.componentInstanceMap : null; this.interfaceType = this.input.selectedInterface.type; this.operationToUpdate = new InterfaceOperationModel(this.input.selectedInterfaceOperation); this.operationToUpdate.interfaceId = this.input.selectedInterface.uniqueId; @@ -280,11 +287,20 @@ export class InterfaceOperationHandlerComponent { } onArtifactPropertyValueChange(changedProperty: InputOperationParameter) { + const property = this.toscaArtifactTypeProperties.find(artifactProperty => artifactProperty.name == changedProperty.name); if (changedProperty.value instanceof Object) { changedProperty.value = JSON.stringify(changedProperty.value); } - const property = this.toscaArtifactTypeProperties.find(artifactProperty => artifactProperty.name == changedProperty.name); + property.toscaFunction = null; property.value = changedProperty.value; + if (changedProperty.isToscaFunction()) { + property.toscaFunction = changedProperty.toscaFunction; + property.value = changedProperty.toscaFunction.buildValueString(); + } + } + + implementationPropsValidityChange(validImplementationProps: boolean) { + this.validImplementationProps = validImplementationProps; } /** @@ -332,6 +348,7 @@ export class InterfaceOperationHandlerComponent { input.schema = property.schema; input.toscaDefaultValue = property.defaultValue; input.value = property.value; + input.toscaFunction = property.toscaFunction; inputList.push(input); }); return inputList; |