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(*): add node nutanix resilitate popin #14603

Merged
Merged
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,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
Loading