diff options
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/interface-definition')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/interface-definition/interface-definition.page.component.ts | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/catalog-ui/src/app/ng2/pages/interface-definition/interface-definition.page.component.ts b/catalog-ui/src/app/ng2/pages/interface-definition/interface-definition.page.component.ts index eab8b18f44..b3f8dfc60c 100644 --- a/catalog-ui/src/app/ng2/pages/interface-definition/interface-definition.page.component.ts +++ b/catalog-ui/src/app/ng2/pages/interface-definition/interface-definition.page.component.ts @@ -217,11 +217,26 @@ export class InterfaceDefinitionComponent { } private disableSaveButton = (): boolean => { - return this.readonly || - (this.isEnableAddArtifactImplementation() - && (!this.modalInstance.instance.dynamicContent.toscaArtifactTypeSelected || - !this.modalInstance.instance.dynamicContent.artifactName) - ); + let disable:boolean = true; + if(this.readonly) { + return disable; + } + + let selectedInterfaceOperation = this.modalInstance.instance.dynamicContent.instance.selectedInterfaceOperation; + let isInterfaceOperation:boolean = !(typeof selectedInterfaceOperation == 'undefined' || _.isEmpty(selectedInterfaceOperation)); + let selectedInterfaceType = this.modalInstance.instance.dynamicContent.instance.selectedInterfaceType; + let isInterfaceType:boolean = !(typeof selectedInterfaceType == 'undefined' || _.isEmpty(selectedInterfaceType)); + let bothSet: boolean = isInterfaceOperation && isInterfaceType; + + let enableAddArtifactImplementation = this.modalInstance.instance.dynamicContent.instance.enableAddArtifactImplementation; + if(enableAddArtifactImplementation) { + let toscaArtifactTypeSelected = this.modalInstance.instance.dynamicContent.instance.toscaArtifactTypeSelected; + let isToscaArtifactType:boolean = !(typeof toscaArtifactTypeSelected == 'undefined' || _.isEmpty(toscaArtifactTypeSelected)); + disable = !bothSet || !isToscaArtifactType; + return disable; + } + disable = !bothSet; + return disable; } onSelectInterfaceOperation(interfaceModel: UIInterfaceModel, operation: InterfaceOperationModel) { |