Skip to content

Commit

Permalink
feat(*): add node nutanix resilitate popin
Browse files Browse the repository at this point in the history
ref: MANAGER-15716

Signed-off-by: Thibault Barske <[email protected]>
  • Loading branch information
tibs245 committed Dec 16, 2024
1 parent 7282d85 commit 497511c
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default {
goBack: '<',
id: '<',
serviceType: '<',
serviceName: '<?',
},
controller,
template,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default class TerminateAgoraServiceController {
this.goBack(
this.$translate.instant(
`autorenew_agora_terminate_service_success_${this.serviceType}`,
{ serviceName: this.serviceName },
),
'success',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<oui-message data-type="warning" class="mb-2">
<span
data-translate="{{:: 'autorenew_agora_terminate_service_warning_' + $ctrl.serviceType}}"
data-translate-values="{ 'serviceName': $ctrl.serviceName }"
></span>
</oui-message>
<oui-field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@
"autorenew_agora_terminate_service_error_DBAAS_LOGS": "Une erreur est survenue lors de la demande de résiliation de votre LDP. {{error}}",
"autorenew_agora_terminate_service_error_VRACK_SERVICES_RESOURCE": "Une erreur est survenue lors de la demande de résiliation de vRack Services. {{error}}",
"autorenew_agora_terminate_service_error_VMWARE_CLOUD_DIRECTOR_BACKUP": "Une erreur est survenue lors de la demande de résiliation de Managed Veeam for VCD. {{error}}",
"autorenew_agora_terminate_service_confirm_input": "Entrez \"TERMINATE\" dans le champ ci-dessous pour confirmer"
"autorenew_agora_terminate_service_confirm_input": "Entrez \"TERMINATE\" dans le champ ci-dessous pour confirmer",
"autorenew_agora_terminate_service_NUTANIX_NODE": "Résilier ce noeud",
"autorenew_agora_terminate_service_warning_NUTANIX_NODE": "Vous allez résilier la souscription du noeud \"{{serviceName}}\".",
"autorenew_agora_terminate_service_success_NUTANIX_NODE": "Votre demande de résiliation de votre \"{{serviceName}}\" a été prise en compte. Un e-mail contenant la procédure vous a été envoyé.",
"autorenew_agora_terminate_service_error_NUTANIX_NODE": "Votre demande de résiliation n'a pas été prise en compte : {{error}}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import addNodes from './add-nodes';
import poweronNode from './poweron-node';
import poweroffNode from './poweroff-node';
import uninstallNode from './uninstall-node';
import resiliateNode from './resiliate-node';

const moduleName = 'ovhManagerNutanixAllNodes';

Expand All @@ -25,6 +26,7 @@ angular
poweronNode,
poweroffNode,
uninstallNode,
resiliateNode,
])
.config(routing)
.component('nutanixAllNodes', component)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const SERVICE_TYPE = 'NUTANIX_NODE';

export default {
SERVICE_TYPE,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import angular from 'angular';
import '@uirouter/angularjs';
import 'oclazyload';

const moduleName = 'ovhManagerNutanixDashboardNodeResiliateLazyLoad';

angular.module(moduleName, ['ui.router', 'oc.lazyLoad']).config(
/* @ngInject */ ($stateProvider) => {
$stateProvider.state('nutanix.dashboard.nodes.all.resiliate-node.**', {
url: '/resiliate/:nodeId',
lazyLoad: ($transition$) => {
const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad');

return import('./resiliate.module').then((mod) =>
$ocLazyLoad.inject(mod.default || mod),
);
},
});
},
);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -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 = 'ovhManagerNutanixDashboardNodeResiliate';

angular
.module(moduleName, [
'pascalprecht.translate',
'ui.router',
ovhManagerBillingComponents,
])
.config(routing);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { SERVICE_TYPE } from './constant';

export default /* @ngInject */ ($stateProvider) => {
$stateProvider.state('nutanix.dashboard.nodes.all.resiliate-node', {
url: '/resiliate/:nodeName',
views: {
modal: {
component: 'billingAutorenewTerminateAgoraService',
},
},
params: {
serviceName: null,
},
layout: 'modal',
resolve: {
serviceType: () => SERVICE_TYPE,
nodeName: /* @ngInject */ ($transition$) =>
$transition$.params().nodeName,
serviceName: /* @ngInject */ (nodeName) => nodeName,
id: /* ngInject */ (server) => server.serviceId,
server: /* @ngInject */ (nodeName, NutanixService) =>
NutanixService.getServer(nodeName),
goBack: /* @ngInject */ (
$state,
$timeout,
Alerter,
clusterServiceName,
) => (message, type) => {
const promise = $state.go('nutanix.dashboard.nodes.all', {
clusterServiceName,
});

if (message) {
promise.then(() =>
$timeout(() =>
Alerter.set(
`alert-${type}`,
message,
null,
'nutanix_dashboard_alert',
),
),
);
}

return promise;
},
},
});
};
2 changes: 2 additions & 0 deletions packages/manager/modules/nutanix/src/dashboard/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ export default /* @ngInject */ ($stateProvider) => {
NutanixService.getServer(nodeId),
serviceName: /* @ngInject */ ($transition$) =>
$transition$.params().serviceName,
clusterServiceName: /* @ngInject */ ($transition$) =>
$transition$.params().serviceName,
serviceInfo: /* @ngInject */ (NutanixService, serviceName) =>
NutanixService.getServiceInfo(serviceName),
serviceDetails: /* @ngInject */ (NutanixService, serviceInfo) =>
Expand Down

0 comments on commit 497511c

Please sign in to comment.