From 6646239688474204aaa0ad71e70ca124052ca1b5 Mon Sep 17 00:00:00 2001 From: Thibault Barske Date: Fri, 30 Aug 2024 18:04:34 +0200 Subject: [PATCH 1/3] feat(billing-components): add cancel subscription on nutanix us product Remove cancel subscription of "billing:management" feature flipping for nutanix product ref: MANAGER-15062 Signed-off-by: Thibault Barske --- .../service-actions.constants.js | 1 + .../services-actions.controller.js | 16 ++++++++++++---- .../services-actions/services-actions.html | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/manager/modules/billing-components/src/components/services-actions/service-actions.constants.js b/packages/manager/modules/billing-components/src/components/services-actions/service-actions.constants.js index 52c7065e7bea..8ffa3550cafd 100644 --- a/packages/manager/modules/billing-components/src/components/services-actions/service-actions.constants.js +++ b/packages/manager/modules/billing-components/src/components/services-actions/service-actions.constants.js @@ -16,6 +16,7 @@ export const SERVICE_TYPE = { VRACK_SERVICES: 'VRACK_SERVICES_RESOURCE', VRACK: 'VRACK', VMWARE_CLOUD_DIRECTOR_ORGANIZATION: 'VMWARE_CLOUD_DIRECTOR_ORGANIZATION', + NUTANIX: 'NUTANIX', }; export const RENEW_URL = { diff --git a/packages/manager/modules/billing-components/src/components/services-actions/services-actions.controller.js b/packages/manager/modules/billing-components/src/components/services-actions/services-actions.controller.js index 17a9f6928049..eb59db8a92e1 100644 --- a/packages/manager/modules/billing-components/src/components/services-actions/services-actions.controller.js +++ b/packages/manager/modules/billing-components/src/components/services-actions/services-actions.controller.js @@ -15,13 +15,13 @@ export default class ServicesActionsCtrl { this.SERVICE_TYPE = SERVICE_TYPE; this.isLoading = true; + this.billingManagementAvailabilityAndHaveAutorenewLink = false; } $onInit() { const fetchAutoRenewLink = this.$q.defer(); - if (!this.billingManagementAvailability) { - fetchAutoRenewLink.resolve(null); - } else if (this.$injector.has('shellClient')) { + + if (this.$injector.has('shellClient')) { this.$injector .get('shellClient') .navigation.getURL('dedicated', '#/billing/autorenew') @@ -36,6 +36,8 @@ export default class ServicesActionsCtrl { } return fetchAutoRenewLink.promise.then((link) => { this.autorenewLink = link; + this.billingManagementAvailabilityAndHaveAutorenewLink = + this.billingManagementAvailability && !!this.autorenewLink; this.isLoading = false; if (this.service.SERVICE_TYPE !== this.SERVICE_TYPE.VRACK) { this.initLinks(); @@ -120,12 +122,18 @@ export default class ServicesActionsCtrl { case SERVICE_TYPE.VEEAM_BACKUP: this.resiliateLink = `${this.autorenewLink}/terminate-service?id=${this.service.id}${serviceTypeParam}`; break; - default: + case SERVICE_TYPE.NUTANIX: this.resiliateLink = this.service.canResiliateByEndRule() ? resiliationByEndRuleLink : this.autorenewLink && `${this.autorenewLink}/delete?serviceId=${this.service.serviceId}${serviceTypeParam}`; break; + default: + this.resiliateLink = this.service.canResiliateByEndRule() + ? resiliationByEndRuleLink + : this.billingManagementAvailabilityAndHaveAutorenewLink && + `${this.autorenewLink}/delete?serviceId=${this.service.serviceId}${serviceTypeParam}`; + break; } } diff --git a/packages/manager/modules/billing-components/src/components/services-actions/services-actions.html b/packages/manager/modules/billing-components/src/components/services-actions/services-actions.html index 4bee43f329d0..a55f9ea81f11 100644 --- a/packages/manager/modules/billing-components/src/components/services-actions/services-actions.html +++ b/packages/manager/modules/billing-components/src/components/services-actions/services-actions.html @@ -2,7 +2,7 @@ aria-label="{{:: 'billing_services_actions_menu_label' | translate }}" compact data-placement="end" - data-ng-if="!$ctrl.isLoading && ($ctrl.autorenewLink || $ctrl.service.canBeEngaged || $ctrl.service.hasPendingEngagement)" + data-ng-if="!$ctrl.isLoading && ($ctrl.billingManagementAvailabilityAndHaveAutorenewLink || $ctrl.service.serviceType === $ctrl.SERVICE_TYPE.NUTANIX || $ctrl.service.canBeEngaged || $ctrl.service.hasPendingEngagement)" >
Date: Mon, 9 Sep 2024 09:19:18 +0200 Subject: [PATCH 2/3] feat(*): replace nutanix terminate procedure with agora services Replace terminate procedure with agora services to be sure work with US case ref: MANAGER-15062 Signed-off-by: Thibault Barske --- .../confirm-terminate.constants.js | 1 + .../services-actions.component.js | 2 + .../services-actions.controller.js | 14 +++--- .../services-actions/services-actions.html | 8 ++-- .../subscription-tile.component.js | 2 + .../subscription-tile/subscription-tile.html | 2 + .../terminate-agora-service/component.js | 1 + .../terminate-agora-service/template.html | 1 + .../translations/Messages_de_DE.json | 8 +++- .../translations/Messages_en_GB.json | 8 +++- .../translations/Messages_es_ES.json | 8 +++- .../translations/Messages_fr_CA.json | 6 ++- .../translations/Messages_fr_FR.json | 6 ++- .../translations/Messages_it_IT.json | 8 +++- .../translations/Messages_pl_PL.json | 8 +++- .../translations/Messages_pt_PT.json | 8 +++- .../legacy/translations/Messages_de_DE.json | 3 +- .../legacy/translations/Messages_en_GB.json | 3 +- .../legacy/translations/Messages_es_ES.json | 3 +- .../legacy/translations/Messages_fr_CA.json | 1 + .../legacy/translations/Messages_fr_FR.json | 1 + .../legacy/translations/Messages_it_IT.json | 3 +- .../legacy/translations/Messages_pl_PL.json | 3 +- .../legacy/translations/Messages_pt_PT.json | 3 +- .../src/dashboard/general-info/component.js | 1 + .../src/dashboard/general-info/module.js | 2 + .../general-info/resiliate/constant.js | 5 +++ .../dashboard/general-info/resiliate/index.js | 22 ++++++++++ .../resiliate/resiliate.module.js | 19 ++++++++ .../resiliate/resiliate.routing.js | 43 +++++++++++++++++++ .../src/dashboard/general-info/routing.js | 4 ++ .../src/dashboard/general-info/template.html | 4 +- .../translations/Messages_de_DE.json | 3 +- .../translations/Messages_en_GB.json | 3 +- .../translations/Messages_es_ES.json | 3 +- .../translations/Messages_fr_CA.json | 3 +- .../translations/Messages_it_IT.json | 3 +- .../translations/Messages_pl_PL.json | 3 +- .../translations/Messages_pt_PT.json | 3 +- 39 files changed, 194 insertions(+), 38 deletions(-) create mode 100644 packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/constant.js create mode 100644 packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/index.js create mode 100644 packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/resiliate.module.js create mode 100644 packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/resiliate.routing.js diff --git a/packages/manager/modules/billing-components/src/components/cancellation-form/confirm-terminate.constants.js b/packages/manager/modules/billing-components/src/components/cancellation-form/confirm-terminate.constants.js index bd66bfcd498c..c13aa5809ce8 100644 --- a/packages/manager/modules/billing-components/src/components/cancellation-form/confirm-terminate.constants.js +++ b/packages/manager/modules/billing-components/src/components/cancellation-form/confirm-terminate.constants.js @@ -7,6 +7,7 @@ export const SERVICE_WITH_AGORA_TERMINATION = [ 'vrack-services', 'okms', 'logs-account', + 'nutanix', ]; export const SERVICE_GROUP_WITH_AGORA_TERMINATION_REGEX = /hycu-vms-*|(logs-enterprise(-hds)?$)/; diff --git a/packages/manager/modules/billing-components/src/components/services-actions/services-actions.component.js b/packages/manager/modules/billing-components/src/components/services-actions/services-actions.component.js index e65a8afb3ac0..2b9e68fb16f7 100644 --- a/packages/manager/modules/billing-components/src/components/services-actions/services-actions.component.js +++ b/packages/manager/modules/billing-components/src/components/services-actions/services-actions.component.js @@ -10,6 +10,8 @@ export default { getCancelCommitmentLink: '&?', getCancelResiliationLink: '&?', getResiliationLink: '&?', + handleGoToResiliation: '&?', + isCustomResiliationHandle: ' diff --git a/packages/manager/modules/billing-components/src/components/subscription-tile/subscription-tile.component.js b/packages/manager/modules/billing-components/src/components/subscription-tile/subscription-tile.component.js index 8c0d2b7e761e..47c6b1321a01 100644 --- a/packages/manager/modules/billing-components/src/components/subscription-tile/subscription-tile.component.js +++ b/packages/manager/modules/billing-components/src/components/subscription-tile/subscription-tile.component.js @@ -16,6 +16,8 @@ export default { commitImpressionData: ' diff --git a/packages/manager/modules/billing/src/autoRenew/actions/terminate-agora-service/component.js b/packages/manager/modules/billing/src/autoRenew/actions/terminate-agora-service/component.js index ad2344d2f2db..9675cc05da78 100644 --- a/packages/manager/modules/billing/src/autoRenew/actions/terminate-agora-service/component.js +++ b/packages/manager/modules/billing/src/autoRenew/actions/terminate-agora-service/component.js @@ -6,6 +6,7 @@ export default { goBack: '<', id: '<', serviceType: '<', + serviceName: ' { + $stateProvider.state('nutanix.dashboard.general-info.resiliate.**', { + url: '/resiliate', + lazyLoad: ($transition$) => { + const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad'); + + return import('./resiliate.module').then((mod) => + $ocLazyLoad.inject(mod.default || mod), + ); + }, + }); + }, +); + +export default moduleName; diff --git a/packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/resiliate.module.js b/packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/resiliate.module.js new file mode 100644 index 000000000000..6d53d17d0313 --- /dev/null +++ b/packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/resiliate.module.js @@ -0,0 +1,19 @@ +import angular from 'angular'; + +import '@uirouter/angularjs'; +import 'angular-translate'; + +import ovhManagerBillingComponents from '@ovh-ux/manager-billing-components'; +import routing from './resiliate.routing'; + +const moduleName = 'ovhManagerNutanixDashboardGeneralInfoResiliate'; + +angular + .module(moduleName, [ + 'pascalprecht.translate', + 'ui.router', + ovhManagerBillingComponents, + ]) + .config(routing); + +export default moduleName; diff --git a/packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/resiliate.routing.js b/packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/resiliate.routing.js new file mode 100644 index 000000000000..a244ce1c0ec3 --- /dev/null +++ b/packages/manager/modules/nutanix/src/dashboard/general-info/resiliate/resiliate.routing.js @@ -0,0 +1,43 @@ +import { SERVICE_TYPE } from './constant'; + +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state('nutanix.dashboard.general-info.resiliate', { + url: '/resiliate', + views: { + modal: { + component: 'billingAutorenewTerminateAgoraService', + }, + }, + params: { + serviceName: null, + }, + layout: 'modal', + resolve: { + serviceType: () => SERVICE_TYPE, + id: /* @ngInject */ (serviceInfo) => serviceInfo.serviceId, + goBack: /* @ngInject */ ($state, $timeout, Alerter, serviceName) => ( + message, + type, + ) => { + const promise = $state.go('nutanix.dashboard.general-info', { + serviceName, + }); + + if (message) { + promise.then(() => + $timeout(() => + Alerter.set( + `alert-${type}`, + message, + null, + 'nutanix-dashboard-alert', + ), + ), + ); + } + + return promise; + }, + }, + }); +}; diff --git a/packages/manager/modules/nutanix/src/dashboard/general-info/routing.js b/packages/manager/modules/nutanix/src/dashboard/general-info/routing.js index 31d16c400c7f..1c4bc2c29ced 100644 --- a/packages/manager/modules/nutanix/src/dashboard/general-info/routing.js +++ b/packages/manager/modules/nutanix/src/dashboard/general-info/routing.js @@ -55,6 +55,10 @@ export default /* @ngInject */ ($stateProvider) => { ), goToRedeploy: /* @ngInject */ ($state) => () => $state.go('nutanix.dashboard.general-info.redeploy'), + goToResiliate: /* @ngInject */ ($state) => (serviceName) => + $state.go('nutanix.dashboard.general-info.resiliate', { + serviceName, + }), breadcrumb: /* @ngInject */ ($translate) => $translate.instant('nutanix_dashboard_general_info'), isPackTypeAvailable: /* @ngInject */ (ovhFeatureFlipping) => diff --git a/packages/manager/modules/nutanix/src/dashboard/general-info/template.html b/packages/manager/modules/nutanix/src/dashboard/general-info/template.html index 5c26c669c24d..d4b28b9f1ead 100644 --- a/packages/manager/modules/nutanix/src/dashboard/general-info/template.html +++ b/packages/manager/modules/nutanix/src/dashboard/general-info/template.html @@ -1,3 +1,4 @@ +
@@ -247,10 +248,11 @@ go-to-commit="$ctrl.goToCommit()" go-to-cancel-commit="$ctrl.goToCancelCommit()" go-to-cancel-resiliation="$ctrl.goToCancelResiliation()" - go-to-resiliation="$ctrl.goToResiliation()" service-infos="$ctrl.serviceInfo" user="$ctrl.user" tracking-prefix="{{ ::$ctrl.trackingPrefix }}" + is-custom-resiliation-handle="true" + handle-go-to-resiliation="$ctrl.goToResiliate($ctrl.serviceName)" >
diff --git a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_de_DE.json b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_de_DE.json index b8a135603c98..b2268df9f79c 100644 --- a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_de_DE.json +++ b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_de_DE.json @@ -4,5 +4,6 @@ "nutanix_dashboard_guides_header": "Anleitungen", "nutanix_dashboard_guides_header_all_guides": "Alle Anleitungen", "nutanix_dashboard_cluster_warning1": "Ihre Nutanix-Lizenz muss vor dem [{{endDate}}] auf Ihrem Cluster in Prism Central registriert werden.", - "nutanix_dashboard_cluster_warning2": "Registrieren Sie Ihre Lizenz" + "nutanix_dashboard_cluster_warning2": "Registrieren Sie Ihre Lizenz", + "nutanix_dashboard_service_suspended": "Der Dienst wurde gekündigt." } diff --git a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_en_GB.json b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_en_GB.json index 280930eb5cbd..f3bcecfbf5dc 100644 --- a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_en_GB.json +++ b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_en_GB.json @@ -4,5 +4,6 @@ "nutanix_dashboard_guides_header": "Guides", "nutanix_dashboard_guides_header_all_guides": "All guides", "nutanix_dashboard_cluster_warning1": "You must register your Nutanix licence on your cluster in Prism Central before [{{endDate}}]", - "nutanix_dashboard_cluster_warning2": "Register your licence" + "nutanix_dashboard_cluster_warning2": "Register your licence", + "nutanix_dashboard_service_suspended": "The service has been cancelled." } diff --git a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_es_ES.json b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_es_ES.json index a9d20aa01796..1382e103f76c 100644 --- a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_es_ES.json +++ b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_es_ES.json @@ -4,5 +4,6 @@ "nutanix_dashboard_guides_header": "Guías", "nutanix_dashboard_guides_header_all_guides": "Todas las guías", "nutanix_dashboard_cluster_warning1": "Debe registrar su licencia Nutanix en su cluster en Prism Central antes del [{{endDate}}].", - "nutanix_dashboard_cluster_warning2": "Registre su licencia" + "nutanix_dashboard_cluster_warning2": "Registre su licencia", + "nutanix_dashboard_service_suspended": "El servicio se ha dado de baja." } diff --git a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_fr_CA.json b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_fr_CA.json index 8740d0bc844f..b559f616c93c 100644 --- a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_fr_CA.json +++ b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_fr_CA.json @@ -4,5 +4,6 @@ "nutanix_dashboard_guides_header": "Guides", "nutanix_dashboard_guides_header_all_guides": "Tous les guides", "nutanix_dashboard_cluster_warning1": "Vous devez enregistrer votre licence Nutanix sur votre cluster dans Prism Central avant le [{{endDate}}]", - "nutanix_dashboard_cluster_warning2": "Enregistrez votre licence" + "nutanix_dashboard_cluster_warning2": "Enregistrez votre licence", + "nutanix_dashboard_service_suspended": "Le service a été résilié." } diff --git a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_it_IT.json b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_it_IT.json index 0b3430de092f..41bb236052a1 100644 --- a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_it_IT.json +++ b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_it_IT.json @@ -4,5 +4,6 @@ "nutanix_dashboard_guides_header": "Guide", "nutanix_dashboard_guides_header_all_guides": "Tutte le guide", "nutanix_dashboard_cluster_warning1": "Registra la tua licenza Nutanix sul tuo cluster in Prism Central prima del [{{endDate}}]", - "nutanix_dashboard_cluster_warning2": "Registra la tua licenza" + "nutanix_dashboard_cluster_warning2": "Registra la tua licenza", + "nutanix_dashboard_service_suspended": "Il servizio è stato disattivato." } diff --git a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_pl_PL.json b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_pl_PL.json index df0d592a3bcf..8e1953fadfac 100644 --- a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_pl_PL.json +++ b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_pl_PL.json @@ -4,5 +4,6 @@ "nutanix_dashboard_guides_header": "Przewodniki", "nutanix_dashboard_guides_header_all_guides": "Wszystkie przewodniki", "nutanix_dashboard_cluster_warning1": "Należy zarejestrować licencję Nutanix na klastrze w Prism Central przed [{{endDate}}]", - "nutanix_dashboard_cluster_warning2": "Zarejestruj licencję" + "nutanix_dashboard_cluster_warning2": "Zarejestruj licencję", + "nutanix_dashboard_service_suspended": "Usługa została zakończona." } diff --git a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_pt_PT.json b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_pt_PT.json index 15d155aba7cd..7ac08086157f 100644 --- a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_pt_PT.json +++ b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_pt_PT.json @@ -4,5 +4,6 @@ "nutanix_dashboard_guides_header": "Manuais", "nutanix_dashboard_guides_header_all_guides": "Todos os manuais", "nutanix_dashboard_cluster_warning1": "Deve registar a licença Nutanix no seu cluster em Prism Central antes de [{{endDate}}]", - "nutanix_dashboard_cluster_warning2": "Registe a sua licença" + "nutanix_dashboard_cluster_warning2": "Registe a sua licença", + "nutanix_dashboard_service_suspended": "O serviço foi rescindido." } From 5086461b86ae1aa7cfad7a39ee9b18023658c776 Mon Sep 17 00:00:00 2001 From: Thibault Barske Date: Fri, 15 Nov 2024 12:28:27 +0100 Subject: [PATCH 3/3] feat(nutanix): add error page on suspended services ref: MANAGER-15294 Signed-off-by: Thibault Barske --- .../src/dashboard/nodes/node/routing.js | 28 +++++++++++++++++- .../nutanix/src/dashboard/nodes/routing.js | 28 +++++++++++++++++- .../modules/nutanix/src/dashboard/routing.js | 29 ++++++++++++++++++- .../translations/Messages_fr_FR.json | 3 +- 4 files changed, 84 insertions(+), 4 deletions(-) diff --git a/packages/manager/modules/nutanix/src/dashboard/nodes/node/routing.js b/packages/manager/modules/nutanix/src/dashboard/nodes/node/routing.js index 0762d36b5928..9aa6e84e9f8a 100644 --- a/packages/manager/modules/nutanix/src/dashboard/nodes/node/routing.js +++ b/packages/manager/modules/nutanix/src/dashboard/nodes/node/routing.js @@ -6,7 +6,33 @@ export default /* @ngInject */ ($stateProvider) => { component: 'nutanixNode', }, }, - redirectTo: 'nutanix.dashboard.nodes.node.general-info', + redirectTo: (transition) => { + const $translatePromise = transition.injector().getAsync('$translate'); + const serviceInfoPromise = transition.injector().getAsync('serviceInfo'); + + return Promise.all([$translatePromise, serviceInfoPromise]).then( + ([$translate, serviceInfo]) => { + if (serviceInfo.isResiliated()) { + return { + state: 'error', + params: { + detail: { + message: $translate.instant( + 'nutanix_dashboard_service_suspended', + ), + status: 'EXPIRED', + code: 404, + }, + to: { + state: 'nutanix.index', + }, + }, + }; + } + return 'nutanix.dashboard.nodes.node.general-info'; + }, + ); + }, resolve: { nodeId: /* @ngInject */ ($transition$) => $transition$.params().nodeId, node: /* @ngInject */ (nodeId, NutanixService) => diff --git a/packages/manager/modules/nutanix/src/dashboard/nodes/routing.js b/packages/manager/modules/nutanix/src/dashboard/nodes/routing.js index 06446d1feca3..60e869f8749f 100644 --- a/packages/manager/modules/nutanix/src/dashboard/nodes/routing.js +++ b/packages/manager/modules/nutanix/src/dashboard/nodes/routing.js @@ -1,7 +1,33 @@ export default /* @ngInject */ ($stateProvider) => { $stateProvider.state('nutanix.dashboard.nodes', { url: '/nodes', - redirectTo: 'nutanix.dashboard.nodes.all', + redirectTo: (transition) => { + const $translatePromise = transition.injector().getAsync('$translate'); + const serviceInfoPromise = transition.injector().getAsync('serviceInfo'); + + return Promise.all([$translatePromise, serviceInfoPromise]).then( + ([$translate, serviceInfo]) => { + if (serviceInfo.isResiliated()) { + return { + state: 'error', + params: { + detail: { + message: $translate.instant( + 'nutanix_dashboard_service_suspended', + ), + status: 'EXPIRED', + code: 404, + }, + to: { + state: 'nutanix.dashboard.nodes.all', + }, + }, + }; + } + return 'nutanix.dashboard.nodes.node.general-info'; + }, + ); + }, resolve: { breadcrumb: /* @ngInject */ ($translate) => $translate.instant('nutanix_dashboard_nodes'), diff --git a/packages/manager/modules/nutanix/src/dashboard/routing.js b/packages/manager/modules/nutanix/src/dashboard/routing.js index 4999b33f11e7..a0846668f796 100644 --- a/packages/manager/modules/nutanix/src/dashboard/routing.js +++ b/packages/manager/modules/nutanix/src/dashboard/routing.js @@ -3,7 +3,34 @@ import { OLD_CLUSTER_PLAN_CODE } from './constants'; export default /* @ngInject */ ($stateProvider) => { $stateProvider.state('nutanix.dashboard', { url: '/:serviceName', - redirectTo: 'nutanix.dashboard.general-info', + redirectTo: (transition) => { + const $translatePromise = transition.injector().getAsync('$translate'); + const serviceInfoPromise = transition.injector().getAsync('serviceInfo'); + + return Promise.all([$translatePromise, serviceInfoPromise]).then( + ([$translate, serviceInfo]) => { + if (serviceInfo.isResiliated()) { + return { + state: 'error', + params: { + detail: { + message: $translate.instant( + 'nutanix_dashboard_service_suspended', + ), + status: 'EXPIRED', + code: 404, + }, + to: { + state: 'nutanix.index', + }, + }, + }; + } + + return 'nutanix.dashboard.general-info'; + }, + ); + }, component: 'nutanixDashboard', resolve: { trackingPrefix: /* @ngInject */ () => 'hpc::nutanix::cluster', diff --git a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_fr_FR.json b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_fr_FR.json index 8740d0bc844f..b559f616c93c 100644 --- a/packages/manager/modules/nutanix/src/dashboard/translations/Messages_fr_FR.json +++ b/packages/manager/modules/nutanix/src/dashboard/translations/Messages_fr_FR.json @@ -4,5 +4,6 @@ "nutanix_dashboard_guides_header": "Guides", "nutanix_dashboard_guides_header_all_guides": "Tous les guides", "nutanix_dashboard_cluster_warning1": "Vous devez enregistrer votre licence Nutanix sur votre cluster dans Prism Central avant le [{{endDate}}]", - "nutanix_dashboard_cluster_warning2": "Enregistrez votre licence" + "nutanix_dashboard_cluster_warning2": "Enregistrez votre licence", + "nutanix_dashboard_service_suspended": "Le service a été résilié." }