From 778c37423df0742c672e0c6193038f8c1d8d2c95 Mon Sep 17 00:00:00 2001 From: Eltanany Shaaban Date: Sun, 29 Nov 2020 14:18:19 +0200 Subject: Add attribute details on hover - List, Get value and delete Issue-ID: CCSDK-2292 Issue-ID: CCSDK-2780 Issue-ID: CCSDK-2779 Signed-off-by: Eltanany Shaaban Change-Id: Ia45ba20cd83a5cb639d1e127f4591e29ffef3954 --- .../action-attributes.component.html | 116 ++++++++++++--------- .../action-attributes.component.ts | 20 +++- 2 files changed, 88 insertions(+), 48 deletions(-) (limited to 'cds-ui/designer-client/src') diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html index d9b727b2e..d0ddf0196 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.html @@ -14,8 +14,9 @@
+ class="btn btn-secondary" (click)="clearFormInputs()"> Create Custom
@@ -45,12 +46,11 @@
@@ -90,12 +92,16 @@
- + (click)="markDeletedInput(output)" + data-toggle="modal" data-target="#exampleModalScrollable1" placement="bottom">
@@ -311,20 +319,21 @@ aria-labelledby="list-home-list">
+ class="btn-group btn-group-toggle" data-toggle="buttons">
@@ -382,13 +391,14 @@ @@ -448,11 +458,11 @@
@@ -461,7 +471,7 @@ aria-labelledby="input-tab">
- +
{{tempInput}} @@ -495,10 +505,10 @@ aria-labelledby="list-home-list">
+ data-toggle="buttons">
@@ -555,9 +565,9 @@ aria-labelledby="list-home-list">
+ data-toggle="buttons">
@@ -604,11 +614,13 @@
@@ -631,7 +643,7 @@
+ [ngModel]="this.suggestedEditedAttribute.name">
@@ -639,19 +651,27 @@
+ [ngModel]="this.suggestedEditedAttribute.description">
- - - - - + + +
+ class="custom-control-input" + [ngModel]="suggestedEditedAttribute.required" [checked]="suggestedEditedAttribute.required">
+ class="custom-control-input" + [checked]="!suggestedEditedAttribute.required">
diff --git a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts index 95b53fb01..1c5a387d0 100644 --- a/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts +++ b/cds-ui/designer-client/src/app/modules/feature-modules/packages/designer/action-attributes/action-attributes.component.ts @@ -50,6 +50,8 @@ export class ActionAttributesComponent implements OnInit { suggestedMappingParameters: string[] = []; selectedParameterList: string[] = []; currentSuggestedArtifact: string; + suggestedDeletedInput: any = {}; + suggestedEditedAttribute: any = {}; constructor(private designerStore: DesignerStore, private functionsStore: FunctionsStore, @@ -107,6 +109,8 @@ export class ActionAttributesComponent implements OnInit { fieldAttribute.description = container[nameOutput].description; fieldAttribute.required = container[nameOutput].required; fieldAttribute.type = container[nameOutput].type; + fieldAttribute.value = container[nameOutput].value; + console.log(fieldAttribute.value); const insertedOutputActionAttribute = Object.assign({}, fieldAttribute); fields.push(insertedOutputActionAttribute); } @@ -490,7 +494,7 @@ export class ActionAttributesComponent implements OnInit { } editAttribute(input: any) { - console.log(input); + this.suggestedEditedAttribute = input; } private createAttributeTypeIfNotExisted(originalAttributes: string, attributeType: string) { @@ -502,4 +506,18 @@ export class ActionAttributesComponent implements OnInit { private checkIfTypeIsList(type: string) { return type.includes('list'); } + + markDeletedInput(input: any) { + this.suggestedDeletedInput = input; + } + + deleteActionAttribute() { + delete this.designerState.template.workflows[this.actionName] + ['inputs'][this.suggestedDeletedInput.name]; + this.deleteAttribute(this.inputs, this.suggestedDeletedInput); + + delete this.designerState.template.workflows[this.actionName] + ['outputs'][this.suggestedDeletedInput.name]; + this.deleteAttribute(this.outputs, this.suggestedDeletedInput); + } } -- cgit 1.2.3-korg