From 16a9fce0e104a38371a9e5a567ec611ae3fc7f33 Mon Sep 17 00:00:00 2001 From: ys9693 Date: Sun, 19 Jan 2020 13:50:02 +0200 Subject: Catalog alignment Issue-ID: SDC-2724 Signed-off-by: ys9693 Change-Id: I52b4aacb58cbd432ca0e1ff7ff1f7dd52099c6fe --- .../ui-component-to-upgrade.ts | 2 +- .../upgrade-list-status-item.component.html | 1 - .../upgrade-list-item.component.html | 2 - .../automated-upgrade.component.ts | 3 +- .../automated-upgrade/automated-upgrade.module.ts | 22 ++++---- .../automated-upgrade/automated-upgrade.service.ts | 62 +++++++++++----------- 6 files changed, 42 insertions(+), 50 deletions(-) (limited to 'catalog-ui/src/app/ng2/pages/automated-upgrade') diff --git a/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-models/ui-component-to-upgrade.ts b/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-models/ui-component-to-upgrade.ts index 97fb71e210..17e5ea7ef1 100644 --- a/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-models/ui-component-to-upgrade.ts +++ b/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-models/ui-component-to-upgrade.ts @@ -21,7 +21,7 @@ export class ServiceContainerToUpgradeUiObject extends UiBaseObject { this.icon = componentToUpgrade.icon; this.version = componentToUpgrade.version; this.isAlreadyUpgrade = true; - this.isLock = componentToUpgrade.state === ComponentState.CERTIFICATION_IN_PROGRESS || componentToUpgrade.state === ComponentState.NOT_CERTIFIED_CHECKOUT; + this.isLock = componentToUpgrade.state === ComponentState.NOT_CERTIFIED_CHECKOUT; this.vspInstances = []; } diff --git a/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-ui-components/upgrade-list-item-status/upgrade-list-status-item.component.html b/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-ui-components/upgrade-list-item-status/upgrade-list-status-item.component.html index f77c3410a6..c1e9529869 100644 --- a/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-ui-components/upgrade-list-item-status/upgrade-list-status-item.component.html +++ b/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-ui-components/upgrade-list-item-status/upgrade-list-status-item.component.html @@ -13,7 +13,6 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> -
diff --git a/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-ui-components/upgrade-list-item/upgrade-list-item.component.html b/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-ui-components/upgrade-list-item/upgrade-list-item.component.html index b97e41444c..5c49735a81 100644 --- a/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-ui-components/upgrade-list-item/upgrade-list-item.component.html +++ b/catalog-ui/src/app/ng2/pages/automated-upgrade/automated-upgrade-ui-components/upgrade-list-item/upgrade-list-item.component.html @@ -13,8 +13,6 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> - -
; private componentType:string; + private modalInstance: ComponentRef; - constructor(private modalService:SdcUiComponents.ModalService, + constructor(private modalService:SdcUiServices.ModalService, private componentService:ComponentServiceNg2, private translateService:TranslateService) { } @@ -69,21 +66,21 @@ export class AutomatedUpgradeService { } private disabledAllModalButtons = ():void => { - this.modalService.getCurrentInstance().innerModalContent.instance.disabled = true; - this.modalService.getCurrentInstance().buttons[0].show_spinner = true; - this.modalService.getCurrentInstance().buttons[1].disabled = true; + this.modalInstance.instance.innerModalContent.instance.disabled = true; + this.modalInstance.instance.buttons[0].show_spinner = true; + this.modalInstance.instance.buttons[1].disabled = true; } public changeUpgradeButtonState = (isDisabled:boolean):void => { - if (this.modalService.getCurrentInstance().buttons[0].disabled !== isDisabled) { - this.modalService.getCurrentInstance().buttons[0].disabled = isDisabled; + if (this.modalInstance.instance.buttons[0].disabled !== isDisabled) { + this.modalInstance.instance.buttons[0].disabled = isDisabled; } } //TODO We will need to replace this function after sdc-ui modal new design, this is just a workaround public automatedUpgrade = ():void => { - let selectedServices = this.modalService.getCurrentInstance().innerModalContent.instance.selectedComponentsToUpgrade; + let selectedServices = this.modalInstance.instance.innerModalContent.instance.selectedComponentsToUpgrade; this.disabledAllModalButtons(); this.componentService.automatedUpgrade(this.vspComponent.componentType, this.vspComponent.uniqueId, this.convertToServerRequest(selectedServices)).subscribe((automatedUpgradeStatus:any) => { @@ -105,11 +102,11 @@ export class AutomatedUpgradeService { }); let statusModalTitle = this.getTextByComponentType("_UPGRADE_STATUS_TITLE"); - this.modalService.getCurrentInstance().setTitle(statusModalTitle); - this.modalService.getCurrentInstance().getButtons().splice(0, 1); // Remove the upgrade button - this.modalService.getCurrentInstance().buttons[0].disabled = false; // enable close again - this.modalService.getCurrentInstance().innerModalContent.destroy(); - this.modalService.createInnnerComponent(AutomatedUpgradeStatusComponent, { + this.modalInstance.instance.setTitle(statusModalTitle); + this.modalInstance.instance.getButtons().splice(0, 1); // Remove the upgrade button + this.modalInstance.instance.buttons[0].disabled = false; // enable close again + this.modalInstance.instance.innerModalContent.destroy(); + this.modalService.createInnnerComponent(this.modalInstance, AutomatedUpgradeStatusComponent, { upgradedComponentsList: upgradedComponent, upgradeStatusMap: statusMap, statusText: this.getStatusText(statusMap) @@ -250,10 +247,10 @@ export class AutomatedUpgradeService { let modalTitle = this.getTextByComponentType("_UPGRADE_TITLE"); let certificationText = isAfterCertification ? this.getTextByComponentType("_CERTIFICATION_STATUS_TEXT", {resourceName: this.vspComponent.name}) : undefined; - let upgradeVspModalConfig:IModalConfig = { + let upgradeVspModalConfig = { title: modalTitle, size: "md", - type: "custom", + type: SdcUiCommon.ModalType.custom, testId: "upgradeVspModal", buttons: [ { @@ -266,10 +263,11 @@ export class AutomatedUpgradeService { }, {text: 'CLOSE', size: 'sm', closeModal: true, type: 'secondary'} - ] - }; + ] as SdcUiCommon.IModalButtonComponent[] + } as SdcUiCommon.IModalConfig; - this.modalService.openCustomModal(upgradeVspModalConfig, AutomatedUpgradeComponent, { + this.modalInstance = this.modalService.openModal(upgradeVspModalConfig); + this.modalService.createInnnerComponent(this.modalInstance, AutomatedUpgradeComponent, { componentsToUpgrade: this.uiComponentsToUpgrade, informationText: informationalText, certificationStatusText: certificationText -- cgit 1.2.3-korg