From 4f058c098678ea01f8a01250dbf9bac4b77b6744 Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Fri, 6 Oct 2023 09:12:37 +0100 Subject: Milestone import support Issue-ID: SDC-4646 Signed-off-by: JvD_Ericsson Change-Id: I90da530a84c757a07c3ef903201f89869d223b8c --- .../activities-list/activities-list.component.ts | 16 +++++++++++++--- .../operation-creator/add-input/add-input.component.ts | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'catalog-ui') diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/activities-list/activities-list.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/activities-list/activities-list.component.ts index b265464f86..ac9daa4b33 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/activities-list/activities-list.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/activities-list/activities-list.component.ts @@ -143,20 +143,30 @@ export class ActivitiesListComponent implements OnInit { } collectInputNames(index: number) { - return this.activities[index].inputs.listToscaDataDefinition.map((input) => input.name); + if (this.activities[index].inputs) { + return this.activities[index].inputs.listToscaDataDefinition.map((input) => input.name); + } + return []; } onAddInput(inputOperationParameter: InputOperationParameter, index: number) { + if (!this.activities[index].inputs) { + let input = new class implements IOperationParamsList { + listToscaDataDefinition: Array = []; + } + this.activities[index].inputs = input; + } this.activities[index].inputs.listToscaDataDefinition.push(inputOperationParameter); this.activities[index].inputs.listToscaDataDefinition = Array.from(this.activities[index].inputs.listToscaDataDefinition); + this.emitOnActivityChange(); } getInputs(index: number) { - if (this.activities[index].inputs.listToscaDataDefinition) { + if (this.activities[index].inputs && this.activities[index].inputs.listToscaDataDefinition) { let test: InputOperationParameter[] = this.activities[index].inputs.listToscaDataDefinition; return test; } - return {}; + return []; } onInputValueChange(changedInput: InputOperationParameter, index: number) { diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/add-input/add-input.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/add-input/add-input.component.ts index 5620d193a8..d3b596ef69 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/add-input/add-input.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/add-input/add-input.component.ts @@ -145,7 +145,7 @@ export class AddInputComponent implements OnInit { showAddInput() { if (this.defaultType) { - this.inputToAdd.type = this.dataTypeMap.get(this.defaultType) ? this.defaultType : undefined; + this.onChangeInputType(this.defaultType); } this.showForm = true; this.showAddLink = false; -- cgit 1.2.3-korg