summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/interface-definition
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2022-06-22 15:38:43 +0100
committerMichael Morris <michael.morris@est.tech>2022-06-23 12:16:03 +0000
commit3c86f941b42188a166b3bbf53398cbbf547fd04c (patch)
treea8c6f503b7e1b4f618c28a61291362a936e5aab5 /catalog-ui/src/app/ng2/pages/interface-definition
parent7a7b13726c195e2944ccc59e4d5c5ade57318763 (diff)
Fix Interface Operation mandatory fields
and remove unnecessary methods Issue-ID: SDC-4061 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I91da5127592563cfab33b00c410f5380f088f6d6
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.ts25
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) {