diff options
author | andre.schmid <andre.schmid@est.tech> | 2022-03-15 16:06:34 +0000 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-03-21 11:55:23 +0000 |
commit | c32663621faf571ce855a1dc84ec4fd013718359 (patch) | |
tree | f1e7b26c12e9e17efd1fb4d7addc6882d670f680 /catalog-ui/src/app | |
parent | bdfccb6d832cf6f7a3de89b9280244ff469a1a77 (diff) |
Fix unchecked artifact implementation being persisted
Fixes the problem of an interface operation artifact implementation
being persisted even if it is not selected.
After checking that the interface operation has an artifact
implementation and filling up the artifact information, the values
were being persisted if the option is unchecked afterwards.
There was no way to remove the artifact implementation information
once it was persisted for the first time.
Change-Id: I4fdf4027919fdc04d688805bcf0b37fa6869b2e8
Issue-ID: SDC-3918
Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-ui/src/app')
-rw-r--r-- | catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts index b14d0dda65..17f697ecda 100644 --- a/catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts +++ b/catalog-ui/src/app/ng2/pages/composition/interface-operatons/interface-operations.component.ts @@ -238,15 +238,23 @@ export class InterfaceOperationsComponent { private updateInterfaceOperation() { this.isLoading = true; - const operationUpdated: InterfaceOperationModel = this.modalInstance.instance.dynamicContent.instance.operationToUpdate; + const interfaceOperationHandlerComponentInstance: InterfaceOperationHandlerComponent = this.modalInstance.instance.dynamicContent.instance; + const operationUpdated: InterfaceOperationModel = interfaceOperationHandlerComponentInstance.operationToUpdate; + const isArtifactChecked = interfaceOperationHandlerComponentInstance.enableAddArtifactImplementation; + if (!isArtifactChecked) { + let artifactName = interfaceOperationHandlerComponentInstance.artifactName; + artifactName = artifactName === undefined ? '' : artifactName; + operationUpdated.implementation = new ArtifactModel({'artifactName': artifactName} as ArtifactModel); + } this.topologyTemplateService.updateComponentInstanceInterfaceOperation( this.componentMetaData.uniqueId, this.componentMetaData.componentType, this.componentInstanceSelected.uniqueId, - operationUpdated).subscribe((updatedComponentInstance: ComponentInstance) => { - this.componentInstanceSelected = new ComponentInstance(updatedComponentInstance); - this.initComponentInstanceInterfaceOperations(); - }); + operationUpdated) + .subscribe((updatedComponentInstance: ComponentInstance) => { + this.componentInstanceSelected = new ComponentInstance(updatedComponentInstance); + this.initComponentInstanceInterfaceOperations(); + }); this.modalServiceNg2.closeCurrentModal(); this.isLoading = false; } |