diff options
author | 2022-06-10 15:22:58 +0100 | |
---|---|---|
committer | 2022-06-13 14:21:46 +0000 | |
commit | 175ed7819a1647d87d847add71da4d5cf47a02fc (patch) | |
tree | d478fb39af745d97e31ee912cb06ecd5d757daee /catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts | |
parent | 6527ef7840f625dc2d6f3f53145c1ff03e2e0296 (diff) |
Disable save for invalid TOSCA function
Disable save button for invalid TOSCA functions in the TOSCA function
modal.
Change-Id: I322f59b20faec17ba0edaa412273ee41c0c2675c
Issue-ID: SDC-4047
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts index 7feea50d89..ab67b0c827 100644 --- a/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts +++ b/catalog-ui/src/app/ng2/pages/properties-assignment/properties-assignment.page.component.ts @@ -538,6 +538,7 @@ export class PropertiesAssignmentComponent { private openToscaGetFunctionModal() { const modalTitle = this.translateService.translate('TOSCA_FUNCTION_MODAL_TITLE'); const modalButtons = []; + let disableSaveButtonFlag = true; modalButtons.push(new ButtonModel(this.translateService.translate('MODAL_SAVE'), 'blue', () => { const toscaGetFunction: ToscaGetFunction = modal.instance.dynamicContent.instance.toscaGetFunction; @@ -547,7 +548,8 @@ export class PropertiesAssignmentComponent { this.clearCheckedInstancePropertyValue(); } modal.instance.close(); - } + }, + (): boolean => { return disableSaveButtonFlag } )); const checkedInstanceProperty = this.buildCheckedInstanceProperty(); modalButtons.push(new ButtonModel(this.translateService.translate('MODAL_CANCEL'), 'outline grey', () => { @@ -565,6 +567,9 @@ export class PropertiesAssignmentComponent { 'property': checkedInstanceProperty, 'componentInstanceMap': this.componentInstanceMap }); + modal.instance.dynamicContent.instance.onValidityChange.subscribe(isValid => { + disableSaveButtonFlag = !isValid; + }); modal.instance.open(); } |