summaryrefslogtreecommitdiffstats
path: root/catalog-ui
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui')
-rw-r--r--catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/activities-list/activities-list.component.ts16
-rw-r--r--catalog-ui/src/app/ng2/pages/composition/interface-operatons/operation-creator/add-input/add-input.component.ts2
2 files changed, 14 insertions, 4 deletions
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<InputOperationParameter> = [];
+ }
+ 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;