diff options
author | aribeiro <anderson.ribeiro@est.tech> | 2021-11-11 15:31:07 +0000 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2021-11-15 13:48:19 +0000 |
commit | a6fc7a9303edd6f11a4766701981d4ff30cc40ef (patch) | |
tree | 43d197ab085e6a2efd549c7aa355a1c2c30eeb66 /catalog-ui | |
parent | b08ac296b31f001c946b1371f213ac302ff9c12e (diff) |
Fix archive and restore actions
Issue-ID: SDC-3784
Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
Change-Id: Ia2d556913834fb65570470ed1dd79095f7b0411d
Diffstat (limited to 'catalog-ui')
5 files changed, 17 insertions, 16 deletions
diff --git a/catalog-ui/src/app/models/component-metadata.ts b/catalog-ui/src/app/models/component-metadata.ts index 2aae97744d..e135e897de 100644 --- a/catalog-ui/src/app/models/component-metadata.ts +++ b/catalog-ui/src/app/models/component-metadata.ts @@ -50,7 +50,7 @@ export interface IComponentMetadata { highestVersion: boolean; normalizedName: string; systemName: string; - archived: boolean; + isArchived: boolean; vspArchived: boolean; selectedCategory: string; filterTerm: string; @@ -116,7 +116,7 @@ export class ComponentMetadata implements IComponentMetadata { public highestVersion: boolean; public normalizedName: string; public systemName: string; - public archived: boolean; + public isArchived: boolean; public vspArchived: boolean; public toscaResourceName: string; public selectedCategory: string; @@ -197,7 +197,7 @@ export class ComponentMetadata implements IComponentMetadata { this.serviceType = response.serviceType; this.serviceRole = response.serviceRole; this.environmentContext = response.environmentContext; - this.archived = response.archived; + this.isArchived = response.isArchived; this.instantiationType = response.instantiationType; this.vspArchived = response.vspArchived; this.toscaResourceName = response.toscaResourceName; diff --git a/catalog-ui/src/app/models/components/component.ts b/catalog-ui/src/app/models/components/component.ts index 6d176df216..e5859abb44 100644 --- a/catalog-ui/src/app/models/components/component.ts +++ b/catalog-ui/src/app/models/components/component.ts @@ -141,7 +141,7 @@ export abstract class Component implements IComponent { public subCategory:string; public selectedCategory:string; public showMenu:boolean; - public archived:boolean; + public isArchived:boolean; public vspArchived: boolean; public componentMetadata: ComponentMetadata; public categorySpecificMetadata: Metadata = new Metadata(); @@ -202,7 +202,7 @@ export abstract class Component implements IComponent { this.modules = component.modules; this.groupInstances = component.groupInstances; this.policies = component.policies; - this.archived = component.archived; + this.isArchived = component.isArchived; this.vspArchived = component.vspArchived; if (component.categorySpecificMetadata && component.categories && component.categories[0]){ @@ -574,7 +574,7 @@ export abstract class Component implements IComponent { this.normalizedName = componentMetadata.normalizedName; this.systemName = componentMetadata.systemName; this.categories = componentMetadata.categories; - this.archived = componentMetadata.archived || false; + this.isArchived = componentMetadata.isArchived; this.vspArchived = componentMetadata.vspArchived; this.componentMetadata = componentMetadata; if (componentMetadata.categorySpecificMetadata){ diff --git a/catalog-ui/src/app/models/componentsInstances/fullComponentInstance.ts b/catalog-ui/src/app/models/componentsInstances/fullComponentInstance.ts index f5f06b8aba..269663f4ef 100644 --- a/catalog-ui/src/app/models/componentsInstances/fullComponentInstance.ts +++ b/catalog-ui/src/app/models/componentsInstances/fullComponentInstance.ts @@ -19,7 +19,7 @@ export class FullComponentInstance extends ComponentInstance { public systemName:string; public uuid:string; public lifecycleState: string; - public archived: boolean; + public isArchived: boolean; public isServiceInstance: boolean; public isResourceInstance: boolean; @@ -61,7 +61,7 @@ export class FullComponentInstance extends ComponentInstance { this.systemName = originComponent.systemName; this.uuid = originComponent.uuid; this.lifecycleState = originComponent.lifecycleState; - this.archived = originComponent.archived; + this.isArchived = originComponent.isArchived; this.attributes = originComponent.attributes; this.directives = componentInstance.directives; diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts index c72a5a471c..dad7b13e2a 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/workspace-view-model.ts @@ -282,7 +282,7 @@ export class WorkspaceViewModel { break; } } - this.$scope.component.archived = true; + this.$scope.component.isArchived = true; this.deleteArchiveCache(); this.Notification.success({ @@ -301,8 +301,9 @@ export class WorkspaceViewModel { message: this.$scope.component.name + ' ' + this.$filter('translate')("RESTORE_SUCCESS_MESSAGE_TEXT"), title: this.$filter('translate')("RESTORE_SUCCESS_MESSAGE_TITLE") }); + this.$scope.reload(this.$scope.component); }); - this.$scope.component.archived = false; + this.$scope.component.isArchived = false; this.deleteArchiveCache(); } @@ -637,7 +638,7 @@ export class WorkspaceViewModel { this.$scope.checkDisableButton = (button: any):boolean => { // Logic moved from html to component - if (this.$scope.isCreateMode() || button.disabled || this.$scope.disabledButtons || !this.$scope.isValidForm || this.$scope.unsavedChanges || this.$scope.component.archived){ + if (this.$scope.isCreateMode() || button.disabled || this.$scope.disabledButtons || !this.$scope.isValidForm || this.$scope.unsavedChanges || this.$scope.component.isArchived){ return true; } diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view.html b/catalog-ui/src/app/view-models/workspace/workspace-view.html index 79dde943dc..2d5b234fbf 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace-view.html +++ b/catalog-ui/src/app/view-models/workspace/workspace-view.html @@ -44,7 +44,7 @@ <span class="lifecycle-state-text" data-tests-id="formlifecyclestate">{{getStatus()}}</span> </div> - <div class="archive-state-label" ng-if="component.archived"> + <div class="archive-state-label" ng-if="component.isArchived"> <div class="sprite-new archive-label" ></div> </div> @@ -61,7 +61,7 @@ ng-disabled="hasNoDependencies" ng-click="openAutomatedUpgradeModal()" class="tlv-btn blue" - data-ng-class="{'disabled' : component.archived}" + data-ng-class="{'disabled' : component.isArchived}" data-tests-id="open-upgrade-vsp-popup" sdc-smart-tooltip="" prevent-double-click>{{component.isResource() ? 'Upgrade Services' : 'Update Services'}}</button> @@ -77,7 +77,7 @@ </button> - <button ng-if="!isCreateMode() && component.archived" + <button ng-if="!isCreateMode() && component.isArchived" data-ng-class="{'disabled' :!isDesigner() || !component.isLatestVersion()}" ng-click="restoreComponent()" class="tlv-btn blue" @@ -86,14 +86,14 @@ <button ng-if="!isViewMode() && isCreateMode()" data-ng-disabled="!isValidForm || isDisableMode() || isLoading || unsavedChanges" ng-click="create()" class="tlv-btn outline green" data-tests-id="create/save">Create</button> - <span data-ng-if="isDesigner() && !isCreateMode() && component.lifecycleState === 'NOT_CERTIFIED_CHECKOUT' && !component.archived" sdc-smart-tooltip="" + <span data-ng-if="isDesigner() && !isCreateMode() && component.lifecycleState === 'NOT_CERTIFIED_CHECKOUT' && !component.isArchived" sdc-smart-tooltip="" data-ng-class="{'disabled' : !isValidForm || isDisableMode() || isViewMode() || unsavedChanges}" ng-click="changeLifecycleState('deleteVersion')" class="sprite-new delete-btn" data-tests-id="delete_version" sdc-smart-tooltip="Delete" prevent-double-click>Delete</span> <span data-ng-click = "archiveComponent()" ng-model-options="{ debounce: 300 }" data-ng-class="{'disabled' : !component.isLatestVersion()}" - data-ng-if = "isDesigner() && component.lifecycleState !== 'NOT_CERTIFIED_CHECKOUT' && !isCreateMode() && !component.archived" + data-ng-if = "isDesigner() && component.lifecycleState !== 'NOT_CERTIFIED_CHECKOUT' && !isCreateMode() && !component.isArchived" data-tests-id="archive-component-button" class="sprite-new archive-btn" sdc-smart-tooltip="Archive" prevent-double-click>Archive</span> |