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 24e48f89a12b..a7406f8bc801 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é." }