Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/manager 15294 - Add error on nutanix suspended services #14123

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -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'),
Expand Down
29 changes: 28 additions & 1 deletion packages/manager/modules/nutanix/src/dashboard/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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é."
}
Loading