summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts
diff options
context:
space:
mode:
authorvasraz <vasyl.razinkov@est.tech>2022-03-31 13:35:04 +0100
committerVasyl Razinkov <vasyl.razinkov@est.tech>2022-03-31 13:58:12 +0000
commit6cffd9e3eecb10281d880ea7d217f0ecddf8fb5a (patch)
tree3edeea0e0ff6d074877e87840feb00810f5af2a5 /catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/interface-operation-handler.component.ts
parentfcb0da941d472c1f94868246c4bb0e2e9d590e38 (diff)
Update Interface definition on VFC
Signed-off-by: aribeiro <anderson.ribeiro@est.tech> Change-Id: I13678c92ae6088016a78554ffaf0da47b82f7e65 Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech> Issue-ID: SDC-3893 Signed-off-by: andre.schmid <andre.schmid@est.tech>
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.ts28
1 files changed, 24 insertions, 4 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 f357ddfc54..059708592e 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
@@ -49,6 +49,7 @@ export class InterfaceOperationHandlerComponent {
selectedInterfaceOperation: InterfaceOperationModel;
validityChangedCallback: Function;
isViewOnly: boolean;
+ interfaceTypesMap: Map<string, string[]>;
};
dataTypeMap$: Observable<Map<string, DataTypeModel>>;
@@ -63,6 +64,10 @@ export class InterfaceOperationHandlerComponent {
isLoading: boolean = false;
readonly: boolean;
isViewOnly: boolean;
+ interfaceTypes: Array<DropdownValue> = [];
+ interfaceOperations: Array<DropdownValue> = [];
+
+ interfaceTypesMap: Map<string, string[]>;
toscaArtifactTypeSelected: string;
toscaArtifactTypeProperties: Array<PropertyBEModel> = [];
@@ -71,6 +76,7 @@ export class InterfaceOperationHandlerComponent {
toscaArtifactTypes: Array<DropdownValue> = [];
enableAddArtifactImplementation: boolean;
+
propertyValueValid: boolean = true;
inputTypeOptions: any[];
@@ -89,7 +95,7 @@ export class InterfaceOperationHandlerComponent {
ngOnInit() {
this.isViewOnly = this.input.isViewOnly;
- this.interfaceType = this.input.selectedInterface.displayType();
+ this.interfaceType = this.input.selectedInterface.type;
this.operationToUpdate = this.input.selectedInterfaceOperation;
this.operationToUpdate.interfaceId = this.input.selectedInterface.uniqueId;
this.operationToUpdate.interfaceType = this.input.selectedInterface.type;
@@ -105,7 +111,13 @@ export class InterfaceOperationHandlerComponent {
listToscaDataDefinition: Array<InputOperationParameter> = [];
}
}
+
this.inputs = Array.from(this.operationToUpdate.inputs.listToscaDataDefinition);
+ this.interfaceTypesMap = this.input.interfaceTypesMap;
+ this.loadInterfaceTypesAndOperations();
+ this.removeImplementationQuote();
+ this.validityChanged();
+ this.loadInterfaceOperationImplementation();
}
private loadInterfaceOperationImplementation() {
@@ -117,13 +129,13 @@ export class InterfaceOperationHandlerComponent {
this.getArtifactTypesSelected();
}
- onDescriptionChange= (value: any): void => {
+ onDescriptionChange = (value: any): void => {
this.operationToUpdate.description = value;
}
onImplementationNameChange(value: any) {
this.readonly = true
- if (value) {
+ if (value || value === '') {
let artifact = new ArtifactModel();
artifact.artifactName = value;
this.operationToUpdate.implementation = artifact;
@@ -141,6 +153,7 @@ export class InterfaceOperationHandlerComponent {
this.toscaArtifactTypeSelected = undefined;
this.artifactVersion = undefined;
if (this.operationToUpdate.implementation.artifactType) {
+ this.operationToUpdate.implementation.artifactName = '';
this.artifactName = undefined;
}
this.toscaArtifactTypeProperties = undefined;
@@ -281,7 +294,6 @@ export class InterfaceOperationHandlerComponent {
if (changedProperty.value instanceof Object) {
changedProperty.value = JSON.stringify(changedProperty.value);
}
- this.toscaArtifactTypeProperties.find(artifactProperty => artifactProperty.name == changedProperty.name);
const property = this.toscaArtifactTypeProperties.find(artifactProperty => artifactProperty.name == changedProperty.name);
property.value = changedProperty.value;
}
@@ -335,4 +347,12 @@ export class InterfaceOperationHandlerComponent {
});
return inputList;
}
+
+ private loadInterfaceTypesAndOperations() {
+ console.log("loadInterfaceTypesAndOperations ", this.interfaceTypesMap.keys());
+
+ Array.from(this.interfaceTypesMap.keys()).forEach(value => this.interfaceTypes.push(new DropdownValue(value, value)));
+ console.log("loadInterfaceTypesAndOperations interfaceType ", this.interfaceTypes);
+ }
+
}