From e62d5d018258afe813bd41eec32fb3e1cdb5d711 Mon Sep 17 00:00:00 2001 From: Yann Lojewski Date: Thu, 17 Oct 2024 16:38:23 +0200 Subject: [PATCH] fix(pci.cloud-archive): fix list and confing pages (#13637) ref: INC0083962 Signed-off-by: Yann Lojewski --- .../project/regions-list/regions-list.controller.js | 8 ++++++-- .../storages/cloud-archives/cloud-archives.routing.js | 11 +++++++++++ .../project/storages/containers/add/add.controller.js | 4 +++- .../projects/project/storages/containers/add/add.html | 4 ++-- .../storages/containers/containers.controller.js | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/packages/manager/modules/pci/src/components/project/regions-list/regions-list.controller.js b/packages/manager/modules/pci/src/components/project/regions-list/regions-list.controller.js index b4a7d152d09f..5e92f788b538 100644 --- a/packages/manager/modules/pci/src/components/project/regions-list/regions-list.controller.js +++ b/packages/manager/modules/pci/src/components/project/regions-list/regions-list.controller.js @@ -163,7 +163,9 @@ export default class RegionsListController { } }) .finally(() => { - this.loadEnd(); + if (this.loadEnd) { + this.loadEnd(); + } }); } else { this.regionsByDeploymentMode = this.regions; @@ -221,7 +223,9 @@ export default class RegionsListController { ); this.macroRegion = this.region?.macroRegion.text; } - this.loadEnd(); + if (this.loadEnd) { + this.loadEnd(); + } } } diff --git a/packages/manager/modules/pci/src/projects/project/storages/cloud-archives/cloud-archives.routing.js b/packages/manager/modules/pci/src/projects/project/storages/cloud-archives/cloud-archives.routing.js index 0d9f339845f5..5ea6e732eb88 100644 --- a/packages/manager/modules/pci/src/projects/project/storages/cloud-archives/cloud-archives.routing.js +++ b/packages/manager/modules/pci/src/projects/project/storages/cloud-archives/cloud-archives.routing.js @@ -105,6 +105,17 @@ export default /* @ngInject */ ($stateProvider) => { $translate.instant( 'pci_projects_project_storages_containers_archive_title', ), + + regions: /* @ngInject */ (PciProjectRegions, projectId) => + PciProjectRegions.getAvailableRegions(projectId).then((regions) => { + return regions.reduce((acc, region) => { + acc[region.name] = region; + return acc; + }, {}); + }), + + catalog: /* @ngInject */ (PciStoragesObjectStorageService) => + PciStoragesObjectStorageService.getCatalog(), }, }); }; diff --git a/packages/manager/modules/pci/src/projects/project/storages/containers/add/add.controller.js b/packages/manager/modules/pci/src/projects/project/storages/containers/add/add.controller.js index 8a64c79e33ea..db52780a6665 100644 --- a/packages/manager/modules/pci/src/projects/project/storages/containers/add/add.controller.js +++ b/packages/manager/modules/pci/src/projects/project/storages/containers/add/add.controller.js @@ -78,7 +78,9 @@ export default class PciStoragesContainersAddController { deploymentMode: null, }); this.container.region = null; - this.container.offer = OBJECT_CONTAINER_OFFER_STORAGE_STANDARD; + this.container.offer = this.archive + ? null + : OBJECT_CONTAINER_OFFER_STORAGE_STANDARD; this.userModel = { linkedMode: { diff --git a/packages/manager/modules/pci/src/projects/project/storages/containers/add/add.html b/packages/manager/modules/pci/src/projects/project/storages/containers/add/add.html index eb618d6ed2e8..15d6ff37c8b6 100644 --- a/packages/manager/modules/pci/src/projects/project/storages/containers/add/add.html +++ b/packages/manager/modules/pci/src/projects/project/storages/containers/add/add.html @@ -302,7 +302,7 @@

{ acc.push({ ...container, - deploymentMode: this.regions[container.region].type, + deploymentMode: this.regions?.[container.region].type || null, }); return acc; }, []);