diff options
author | stasys10 <stasys.jurgaitis@est.tech> | 2022-04-21 18:13:16 +0100 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2022-06-13 15:15:59 +0000 |
commit | 1a1676fbf411f3cc675752828724a6a95d7e5971 (patch) | |
tree | b89c22eab20ee4fde15a827fdc267d242419aed9 /catalog-ui/src/app/ng2/pages/interface-definition | |
parent | 175ed7819a1647d87d847add71da4d5cf47a02fc (diff) |
Rearrange Interface Operation Implementation
Name and File fields now called Artifact File URI.
Add Artifact To Implementation renamed to Add Artifact Details,
it was also added to localization.
Artifact File URI is made always visible,
and Add Artifact Details moved underneath it.
Issue-ID: SDC-3982
Signed-off-by: stasys10 <stasys.jurgaitis@est.tech>
Change-Id: I4cbe864347d156137a2ab4746500e5fd454a2b26
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 | 27 |
1 files changed, 22 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 35490b183c..5372fc919d 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 @@ -29,6 +29,7 @@ import {ModalComponent} from 'app/ng2/components/ui/modal/modal.component'; import {ModalService} from 'app/ng2/services/modal.service'; import { + ArtifactModel, ButtonModel, CapabilitiesGroup, InputBEModel, @@ -62,7 +63,6 @@ export class UIOperationModel extends OperationModel { constructor(operation: OperationModel) { super(operation); - if (!operation.description) { this.description = ''; } @@ -263,7 +263,15 @@ export class InterfaceDefinitionComponent { } private updateOperation = (): void => { - let operationToUpdate = this.modalInstance.instance.dynamicContent.instance.operationToUpdate; + this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = true; + const interfaceOperationHandlerComponentInstance: InterfaceOperationHandlerComponent = this.modalInstance.instance.dynamicContent.instance; + const operationToUpdate = this.modalInstance.instance.dynamicContent.instance.operationToUpdate; + const isArtifactChecked = interfaceOperationHandlerComponentInstance.enableAddArtifactImplementation; + if (!isArtifactChecked) { + const artifactName = interfaceOperationHandlerComponentInstance.artifactName ? + interfaceOperationHandlerComponentInstance.artifactName : ''; + operationToUpdate.implementation = new ArtifactModel({'artifactName': artifactName, 'artifactVersion': ''} as ArtifactModel); + } this.componentServiceNg2.updateComponentInterfaceOperation(this.component.uniqueId, operationToUpdate) .subscribe((newOperation: InterfaceOperationModel) => { let oldOpIndex; @@ -276,14 +284,19 @@ export class InterfaceDefinitionComponent { } }); }); - newOperation = this.handleEnableAddArtifactImplementation(newOperation); oldInterf.operations.splice(oldOpIndex, 1); oldInterf.operations.push(new InterfaceOperationModel(newOperation)); + }, error => { + this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = false; + }, () => { + this.sortInterfaces(); + this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = false; + this.modalServiceNg2.closeCurrentModal(); }); - this.modalServiceNg2.closeCurrentModal(); } private createOperationCallback(): void { + this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = true; const operationToUpdate = this.modalInstance.instance.dynamicContent.instance.operationToUpdate; console.log('createOperationCallback', operationToUpdate); console.log('this.component', this.component); @@ -300,8 +313,12 @@ export class InterfaceDefinitionComponent { uiInterfaceModel.operations.push(new UIOperationModel(new OperationModel(newOperation))); this.interfaces.push(uiInterfaceModel); } + }, error => { + this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = false; + }, () => { + this.modalServiceNg2.currentModal.instance.dynamicContent.instance.isLoading = false; + this.modalServiceNg2.closeCurrentModal(); }); - this.modalServiceNg2.closeCurrentModal(); } private handleEnableAddArtifactImplementation = (newOperation: InterfaceOperationModel): InterfaceOperationModel => { |