diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard-light/dedicatedCloud-dashboard-light.component.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard-light/dedicatedCloud-dashboard-light.component.js index 3e8c7756529e..ce0c4bbdfb33 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard-light/dedicatedCloud-dashboard-light.component.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard-light/dedicatedCloud-dashboard-light.component.js @@ -4,9 +4,7 @@ export default { bindings: { currentService: '<', editDetails: '<', - onUpgradeVersion: '<', associateIpBlockLink: '<', - onExecutionDateChange: '<', trackingPrefix: '<', }, template, diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard-light/dedicatedCloud-dashboard-light.html b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard-light/dedicatedCloud-dashboard-light.html index 49ca0bab0549..04ae1d54f1a2 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard-light/dedicatedCloud-dashboard-light.html +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard-light/dedicatedCloud-dashboard-light.html @@ -3,10 +3,9 @@ diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard/tiles/general-information/general-information.component.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard/tiles/general-information/general-information.component.js index f8edc932b30a..25d6f26e6613 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard/tiles/general-information/general-information.component.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard/tiles/general-information/general-information.component.js @@ -5,10 +5,11 @@ export default { bindings: { currentService: '<', editDetails: '<', - onUpgradeVersion: '<', + onUpgradeVersion: ' @@ -118,6 +120,7 @@ > @@ -194,6 +197,13 @@ + + diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard/tiles/general-information/translations/Messages_fr_FR.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard/tiles/general-information/translations/Messages_fr_FR.json index 2a880af839e6..fcaa390a37cc 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard/tiles/general-information/translations/Messages_fr_FR.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dashboard/tiles/general-information/translations/Messages_fr_FR.json @@ -25,6 +25,7 @@ "ovhManagerPccDashboardGeneralInformation_commercial_range": "Gamme commerciale", "ovhManagerPccDashboardGeneralInformation_numberOfDatacenters_term": "Nombre de datacenters", + "ovhManagerPccDashboardGeneralInformation_vcd_name": "Nom du VCD", "ovhManagerPccDashboardGeneralInformation_numberOfIPBlocks_term": "Nombre de blocs IP", "ovhManagerPccDashboardGeneralInformation_numberOfIPBlocks_definition_ripe": "RIPE", diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.constants.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.constants.js index 35b5c8e112b7..073b28b8ab93 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.constants.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.constants.js @@ -10,8 +10,6 @@ export const DEDICATED_CLOUD_DATACENTER = { }, }; -export const TRACKING_PREFIX = 'Enterprise::PrivateCloud::'; - export const COMMERCIAL_RANGE_NAME_EOL = [ 'dedicated_cloud_2016', 'cdi_2018', @@ -38,5 +36,4 @@ export default { VDC_MIRGRATION_GUIDE_LINK, TRACKING_NEW_PRODUCT_BANNER, LANGUAGE_OVERRIDE, - TRACKING_PREFIX, }; diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.controller.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.controller.js index 6960a485f3d7..28bcd222c063 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.controller.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.controller.js @@ -4,7 +4,6 @@ import { COMMERCIAL_RANGE_NAME_EOL, VDC_MIRGRATION_GUIDE_LINK, TRACKING_NEW_PRODUCT_BANNER, - TRACKING_PREFIX, } from './dedicatedCloud-datacenter.constants'; export default class { @@ -15,7 +14,6 @@ export default class { this.ovhManagerPccDatacenterService = ovhManagerPccDatacenterService; this.ovhSubsidiary = coreConfig.getUser().ovhSubsidiary; this.TRACKING_NEW_PRODUCT_BANNER = TRACKING_NEW_PRODUCT_BANNER; - this.TRACKING_PREFIX = TRACKING_PREFIX; } $onInit() { diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.html b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.html index 03f33cd8b918..a00a3130ced7 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.html +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dedicatedCloud-datacenter.html @@ -24,11 +24,6 @@ - - { + $stateProvider.state( + 'app.dedicatedCloud.details.dashboard-light.associate-ip-bloc', + { + url: '/associate-ip-bloc', + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + !hasVCDMigration + ? 'app.dedicatedCloud.details.dashboard.associate-ip-bloc' + : false, + ); + }, + params: { + ips: null, + }, + views: { + modal: { + component: 'ovhManagerDedicatedMoveIp', + }, + }, + layout: 'modal', + resolve: { + ips: /* @ngInject */ (currentService) => + currentService.ips?.map(({ network }) => network), + goBack: /* @ngInject */ ($state) => () => $state.go('^'), + trackingPrefix: () => + 'dedicated::dedicatedClouds::dashboard::associate-ip-bloc', + breadcrumb: () => null, + }, + }, + ); +}; diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/associate-ip-bloc/index.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/associate-ip-bloc/index.js new file mode 100644 index 000000000000..71b71ee6d45f --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/associate-ip-bloc/index.js @@ -0,0 +1,24 @@ +import angular from 'angular'; +import '@uirouter/angularjs'; +import 'oclazyload'; + +const moduleName = 'ovhManagerPccDashboardAssociateIpBlocLazyloading'; + +angular.module(moduleName, ['oc.lazyLoad', 'ui.router']).config( + /* @ngInject */ ($stateProvider) => { + $stateProvider.state( + 'app.dedicatedCloud.details.dashboard-light.associate-ip-bloc.**', + { + url: '/associate-ip-bloc', + lazyLoad: ($transition$) => { + const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad'); + return import('./associate-ip-bloc.module').then((mod) => + $ocLazyLoad.inject(mod.default || mod), + ); + }, + }, + ); + }, +); + +export default moduleName; diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/dedicatedCloudLight.module.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/dedicatedCloudLight.module.js index 89c5a684d33b..9cd00c973a1f 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/dedicatedCloudLight.module.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/dedicatedCloudLight.module.js @@ -1,10 +1,13 @@ import angular from 'angular'; import dashboardLightModule from '../../components/dedicated-cloud/dashboard-light'; +import associateIpBloc from './associate-ip-bloc'; import routing from './dedicatedCloudLight.routing'; const moduleName = 'ovhManagerDedicatedCloudLightModule'; -angular.module(moduleName, [dashboardLightModule]).config(routing); +angular + .module(moduleName, [dashboardLightModule, associateIpBloc]) + .config(routing); export default moduleName; diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/dedicatedCloudLight.routing.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/dedicatedCloudLight.routing.js index ecc9e83dc06d..b7c2a8bb3735 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/dedicatedCloudLight.routing.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/dedicatedCloudLight.routing.js @@ -1,6 +1,6 @@ export default /* @ngInject */ ($stateProvider) => { - $stateProvider.state('app.dedicatedCloud.details.dashboard.light', { - url: '/tag/migration-vcd', + $stateProvider.state('app.dedicatedCloud.details.dashboard-light', { + url: '/migration-vcd', redirectTo: (transition) => { return transition .injector() @@ -15,8 +15,14 @@ export default /* @ngInject */ ($stateProvider) => { }, resolve: { breadcrumb: () => null, + associateIpBlockLink: /* @ngInject */ ($state) => () => + $state.href( + 'app.dedicatedCloud.details.dashboard-light.associate-ip-bloc', + ), }, reloadOnSearch: false, - component: 'pccDashboardLight', + views: { + pccView: 'pccDashboardLight', + }, }); }; diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/index.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/index.js index be798f4fef3a..66bca8b16945 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/index.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard-light/index.js @@ -6,8 +6,8 @@ const moduleName = 'dedicatedCloudDashboardLightLazyloading'; angular.module(moduleName, ['oc.lazyLoad', 'ui.router']).config( /* @ngInject */ ($stateProvider) => { - $stateProvider.state('app.dedicatedCloud.details.dashboard.light.**', { - url: '/tag/migration-vcd', + $stateProvider.state('app.dedicatedCloud.details.dashboard-light.**', { + url: '/migration-vcd', lazyLoad: ($transition$) => { const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad'); return import('./dedicatedCloudLight.module').then((mod) => diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard/associate-ip-bloc/associate-ip-bloc.routing.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard/associate-ip-bloc/associate-ip-bloc.routing.js index e715caf4ea21..0c97c87060ed 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard/associate-ip-bloc/associate-ip-bloc.routing.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/dashboard/associate-ip-bloc/associate-ip-bloc.routing.js @@ -1,10 +1,18 @@ -import map from 'lodash/map'; - export default /* @ngInject */ ($stateProvider) => { $stateProvider.state( 'app.dedicatedCloud.details.dashboard.associate-ip-bloc', { url: '/associate-ip-bloc', + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.dedicatedCloud.details.dashboard-light.associate-ip-bloc' + : false, + ); + }, params: { ips: null, }, @@ -16,7 +24,7 @@ export default /* @ngInject */ ($stateProvider) => { layout: 'modal', resolve: { ips: /* @ngInject */ (currentService) => - map(currentService.ips, (ip) => ip.network), + currentService.ips?.map((ip) => ip.network), goBack: /* @ngInject */ (goBackToDashboard) => goBackToDashboard, trackingPrefix: () => 'dedicated::dedicatedClouds::dashboard::associate-ip-bloc', diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dedicatedCloud-datacenter.routing.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dedicatedCloud-datacenter.routing.js index 03fc4f479c5a..4969d1fa99ca 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dedicatedCloud-datacenter.routing.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dedicatedCloud-datacenter.routing.js @@ -5,7 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { 'dedicatedCloudView@app.dedicatedCloud.details': 'ovhManagerDedicatedCloudDatacenter', }, - redirectTo: 'app.dedicatedCloud.details.datacenter.details.dashboard', + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.dedicatedCloud.details.dashboard-light' + : 'app.dedicatedCloud.details.datacenter.details.dashboard', + ); + }, resolve: { datacenterId: /* @ngInject */ ($transition$) => $transition$.params().datacenterId, diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenters/dedicatedCloud-datacenters.routes.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenters/dedicatedCloud-datacenters.routes.js index 3d541bf7d42c..81fed434d914 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenters/dedicatedCloud-datacenters.routes.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenters/dedicatedCloud-datacenters.routes.js @@ -5,6 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { views: { pccView: 'ovhManagerPccDatacenters', }, + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.dedicatedCloud.details.dashboard-light' + : false, + ); + }, resolve: { addDatacenter: /* @ngInject */ ($state) => () => $state.go('app.dedicatedCloud.details.datacenter.add-datacenter'), diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/details/dedicatedCloud.routing.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/details/dedicatedCloud.routing.js index b0d7594502a6..40dbc457541e 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/details/dedicatedCloud.routing.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/details/dedicatedCloud.routing.js @@ -30,13 +30,11 @@ export default /* @ngInject */ ($stateProvider) => { return transition .injector() .getAsync('hasVCDMigration') - .then((hasVCDMigration) => { - if (hasVCDMigration) { - return 'app.dedicatedCloud.details.dashboard.light'; - } - - return 'app.dedicatedCloud.details.dashboard'; - }) + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.dedicatedCloud.details.dashboard-light' + : 'app.dedicatedCloud.details.dashboard', + ) .catch(() => 'app.dedicatedCloud.details.dashboard'); }, resolve: { @@ -322,6 +320,8 @@ export default /* @ngInject */ ($stateProvider) => { ) => { Alerter.set(`alert-${type}`, message, null, 'dedicatedCloud'); }, + trackingPrefix: () => 'dedicated::dedicatedClouds', + vcdTrackingPrefix: () => 'Enterprise::PrivateCloud::', usesLegacyOrder: /* @ngInject */ (currentService) => currentService.usesLegacyOrder, newProductUrl: /* @ngInject */ (ovhFeatureFlipping, coreConfig) => diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/license/dedicatedCloud-license.routes.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/license/dedicatedCloud-license.routes.js index bb508c4fa46d..81edab6c8559 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/license/dedicatedCloud-license.routes.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/license/dedicatedCloud-license.routes.js @@ -4,6 +4,16 @@ export default /* @ngInject */ ($stateProvider) => { views: { pccView: 'ovhManagerPccLicense', }, + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.dedicatedCloud.details.dashboard-light' + : false, + ); + }, resolve: { goToEnableLicense: /* @ngInject */ ($state) => () => $state.go('app.dedicatedCloud.details.license.enable'), diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/operation/dedicatedCloud-operation.routes.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/operation/dedicatedCloud-operation.routes.js index b3fa0ed9f322..9ecd62bdff2a 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/operation/dedicatedCloud-operation.routes.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/operation/dedicatedCloud-operation.routes.js @@ -5,6 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { views: { pccView: 'ovhManagerPccOperation', }, + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.dedicatedCloud.details.dashboard-light' + : false, + ); + }, resolve: { goToExecutionDateEdit: /* @ngInject */ ($state, productId) => (task) => $state.go('app.dedicatedCloud.details.operation.execution-date-edit', { diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/security/dedicatedCloud-security.routes.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/security/dedicatedCloud-security.routes.js index 728b8bc7100d..df42489cde7c 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/security/dedicatedCloud-security.routes.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/security/dedicatedCloud-security.routes.js @@ -5,6 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { views: { pccView: 'ovhManagerPccSecurity', }, + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.dedicatedCloud.details.dashboard-light' + : false, + ); + }, resolve: { goBack: /* @ngInject */ (goBackToState, OvhApiDedicatedCloud) => ( message = false, diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/associate-ip-bloc.module.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/associate-ip-bloc.module.js new file mode 100644 index 000000000000..811fefb6c431 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/associate-ip-bloc.module.js @@ -0,0 +1,13 @@ +import angular from 'angular'; + +import moveIpComponent from '../../../components/move-ip'; +import routing from './associate-ip-bloc.routing'; + +const moduleName = 'managedBaremetalDashboardLightAssociateIpBloc'; + +angular + .module(moduleName, [moveIpComponent]) + .config(routing) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/associate-ip-bloc.routing.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/associate-ip-bloc.routing.js new file mode 100644 index 000000000000..5f966661734e --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/associate-ip-bloc.routing.js @@ -0,0 +1,35 @@ +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state( + 'app.managedBaremetal.details.dashboard-light.associate-ip-bloc', + { + url: '/associate-ip-bloc', + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + !hasVCDMigration + ? 'app.managedBaremetal.details.dashboard.associate-ip-bloc' + : false, + ); + }, + params: { + ips: null, + }, + views: { + modal: { + component: 'ovhManagerDedicatedMoveIp', + }, + }, + layout: 'modal', + resolve: { + ips: /* @ngInject */ (currentService) => + currentService.ips?.map(({ network }) => network), + goBack: /* @ngInject */ ($state) => () => $state.go('^'), + trackingPrefix: () => + 'dedicated::dedicatedClouds::dashboard::associate-ip-bloc', + breadcrumb: () => null, + }, + }, + ); +}; diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/index.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/index.js new file mode 100644 index 000000000000..3bef92ef62c2 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/associate-ip-bloc/index.js @@ -0,0 +1,24 @@ +import angular from 'angular'; +import '@uirouter/angularjs'; +import 'oclazyload'; + +const moduleName = 'managedBaremetalDashboardAssociateIpBlocLazyloading'; + +angular.module(moduleName, ['oc.lazyLoad', 'ui.router']).config( + /* @ngInject */ ($stateProvider) => { + $stateProvider.state( + 'app.managedBaremetal.details.dashboard-light.associate-ip-bloc.**', + { + url: '/associate-ip-bloc', + lazyLoad: ($transition$) => { + const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad'); + return import('./associate-ip-bloc.module').then((mod) => + $ocLazyLoad.inject(mod.default || mod), + ); + }, + }, + ); + }, +); + +export default moduleName; diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/dedicatedCloudLight.module.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/dedicatedCloudLight.module.js index a1fd99442ee4..44b24d968e7a 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/dedicatedCloudLight.module.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/dedicatedCloudLight.module.js @@ -1,10 +1,13 @@ import angular from 'angular'; import dashboardLightModule from '../../components/dedicated-cloud/dashboard-light'; +import associateIpBloc from './associate-ip-bloc'; import routing from './dedicatedCloudLight.routing'; const moduleName = 'ovhManagerManagedBaremetalLightModule'; -angular.module(moduleName, [dashboardLightModule]).config(routing); +angular + .module(moduleName, [dashboardLightModule, associateIpBloc]) + .config(routing); export default moduleName; diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/dedicatedCloudLight.routing.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/dedicatedCloudLight.routing.js index 892aaccbb5ba..acd4d222e10c 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/dedicatedCloudLight.routing.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/dedicatedCloudLight.routing.js @@ -1,6 +1,6 @@ export default /* @ngInject */ ($stateProvider) => { - $stateProvider.state('app.managedBaremetal.details.dashboard.light', { - url: '/tag/migration-vcd', + $stateProvider.state('app.managedBaremetal.details.dashboard-light', { + url: '/migration-vcd', redirectTo: (transition) => { return transition .injector() @@ -15,8 +15,14 @@ export default /* @ngInject */ ($stateProvider) => { }, resolve: { breadcrumb: () => null, + associateIpBlockLink: /* @ngInject */ ($state) => () => + $state.href( + 'app.managedBaremetal.details.dashboard-light.associate-ip-bloc', + ), }, reloadOnSearch: false, - component: 'pccDashboardLight', + views: { + pccView: 'pccDashboardLight', + }, }); }; diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/index.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/index.js index 90c8557a4e9d..fb944ffadc8d 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/index.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard-light/index.js @@ -6,7 +6,7 @@ const moduleName = 'managedBaremetalDashboardLightLazyloading'; angular.module(moduleName, ['oc.lazyLoad', 'ui.router']).config( /* @ngInject */ ($stateProvider) => { - $stateProvider.state('app.managedBaremetal.details.dashboard.light.**', { + $stateProvider.state('app.managedBaremetal.details.dashboard-light.**', { url: '/migration-vcd', lazyLoad: ($transition$) => { const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad'); diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard/associate-ip-bloc/associate-ip-bloc.routing.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard/associate-ip-bloc/associate-ip-bloc.routing.js index f8a93f5375e4..228d11643d3b 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard/associate-ip-bloc/associate-ip-bloc.routing.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/dashboard/associate-ip-bloc/associate-ip-bloc.routing.js @@ -5,6 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { 'app.managedBaremetal.details.dashboard.associate-ip-bloc', { url: '/associate-ip-bloc', + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.managedBaremetal.details.dashboard-light.associate-ip-bloc' + : false, + ); + }, params: { ips: null, }, diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/datacenter/datacenter.routing.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/datacenter/datacenter.routing.js index d6616ce2bdcb..f7817d4e95ec 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/datacenter/datacenter.routing.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/datacenter/datacenter.routing.js @@ -5,7 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { 'dedicatedCloudView@app.managedBaremetal.details': 'ovhManagerDedicatedCloudDatacenter', }, - redirectTo: 'app.managedBaremetal.details.datacenters.datacenter.dashboard', + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.managedBaremetal.details.dashboard-light' + : 'app.managedBaremetal.details.datacenters.datacenter.dashboard', + ); + }, resolve: { datacenterId: /* @ngInject */ ($transition$) => $transition$.params().datacenterId, diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/datacenters/datacenters.routes.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/datacenters/datacenters.routes.js index abf6611e0fd8..8d874a5336bd 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/datacenters/datacenters.routes.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/datacenters/datacenters.routes.js @@ -5,6 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { views: { pccView: 'ovhManagerPccDatacenters', }, + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.managedBaremetal.details.dashboard-light' + : false, + ); + }, resolve: { addDatacenter: /* @ngInject */ ($state) => () => $state.go('app.managedBaremetal.details.datacenters.add-datacenter'), diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/details/managed-baremetal.routing.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/details/managed-baremetal.routing.js index 57cdcbc0283a..613f643db050 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/details/managed-baremetal.routing.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/details/managed-baremetal.routing.js @@ -28,13 +28,11 @@ export default /* @ngInject */ ($stateProvider) => { return transition .injector() .getAsync('hasVCDMigration') - .then((hasVCDMigration) => { - if (hasVCDMigration) { - return 'app.managedBaremetal.details.dashboard.light'; - } - - return 'app.managedBaremetal.details.dashboard'; - }) + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.managedBaremetal.details.dashboard-light' + : 'app.managedBaremetal.details.dashboard', + ) .catch(() => 'app.managedBaremetal.details.dashboard'); }, resolve: { @@ -293,6 +291,7 @@ export default /* @ngInject */ ($stateProvider) => { Alerter.set(`alert-${type}`, message, null, 'dedicatedCloud'); }, trackingPrefix: () => 'dedicated::managedBaremetal', + vcdTrackingPrefix: () => 'Baremetal::Managed_baremetal::', usesLegacyOrder: /* @ngInject */ (currentService) => currentService.usesLegacyOrder, dedicatedCloudVCDMigrationState: /* @ngInject */ ( diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/license/license.routes.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/license/license.routes.js index 15293d47348b..9cecb0c1b34a 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/license/license.routes.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/license/license.routes.js @@ -4,6 +4,16 @@ export default /* @ngInject */ ($stateProvider) => { views: { pccView: 'ovhManagerPccLicense', }, + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.managedBaremetal.details.dashboard-light' + : false, + ); + }, resolve: { goToEnableLicense: /* @ngInject */ ($state) => () => $state.go('app.managedBaremetal.details.license.enable'), diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/operation/operation.routes.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/operation/operation.routes.js index 0f0c151d196d..4001e2032405 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/operation/operation.routes.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/operation/operation.routes.js @@ -5,6 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { views: { pccView: 'ovhManagerPccOperation', }, + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.managedBaremetal.details.dashboard-light' + : false, + ); + }, resolve: { goToExecutionDateEdit: /* @ngInject */ ($state, productId) => (task) => $state.go( diff --git a/packages/manager/apps/dedicated/client/app/managedBaremetal/security/security.routes.js b/packages/manager/apps/dedicated/client/app/managedBaremetal/security/security.routes.js index 00bde24e7016..686ea97d4832 100644 --- a/packages/manager/apps/dedicated/client/app/managedBaremetal/security/security.routes.js +++ b/packages/manager/apps/dedicated/client/app/managedBaremetal/security/security.routes.js @@ -5,6 +5,16 @@ export default /* @ngInject */ ($stateProvider) => { views: { pccView: 'ovhManagerPccSecurity', }, + redirectTo: (transition) => { + return transition + .injector() + .getAsync('hasVCDMigration') + .then((hasVCDMigration) => + hasVCDMigration + ? 'app.managedBaremetal.details.dashboard-light' + : false, + ); + }, resolve: { goBack: /* @ngInject */ (goBackToState, OvhApiDedicatedCloud) => ( message = false,