Skip to content

Commit

Permalink
fix(dedicated.pcc): fix dashboard display PCC for VCD migration
Browse files Browse the repository at this point in the history
ref: MANAGER-15583 MANAGER-15584

Signed-off-by: David Arsène <[email protected]>
  • Loading branch information
darsene committed Oct 16, 2024
1 parent 18202ff commit a3cc94d
Show file tree
Hide file tree
Showing 40 changed files with 322 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ export default {
bindings: {
currentService: '<',
editDetails: '<',
onUpgradeVersion: '<',
associateIpBlockLink: '<',
onExecutionDateChange: '<',
trackingPrefix: '<',
},
template,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
<ovh-manager-pcc-dashboard-general-information
data-current-service="$ctrl.currentService"
data-edit-details="$ctrl.editDetails"
data-on-upgrade-version="$ctrl.onUpgradeVersion"
data-associate-ip-block-link="$ctrl.associateIpBlockLink"
data-on-execution-date-change="$ctrl.onExecutionDateChange"
data-tracking-prefix="$ctrl.trackingPrefix"
data-has-vcd-migration="true"
></ovh-manager-pcc-dashboard-general-information>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ export default {
bindings: {
currentService: '<',
editDetails: '<',
onUpgradeVersion: '<',
onUpgradeVersion: '<?',
associateIpBlockLink: '<',
onExecutionDateChange: '<',
onExecutionDateChange: '<?',
trackingPrefix: '<',
hasVcdMigration: '<?',
},
controller,
name: 'ovhManagerPccDashboardGeneralInformation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
</div>

<oui-tile-definition
data-ng-if="!$ctrl.hasVcdMigration"
data-term="{{:: 'ovhManagerPccDashboardGeneralInformation_commercial_range' | translate }}"
data-description="{{:: $ctrl.bindings.commercialRange }}"
></oui-tile-definition>

<oui-tile-definition
data-ng-if="!$ctrl.hasVcdMigration"
data-term="{{:: 'ovhManagerPccDashboardGeneralInformation_softwareSolution_term' | translate }}"
>
<oui-tile-description>
Expand Down Expand Up @@ -118,6 +120,7 @@
></oui-tile-definition>

<oui-tile-definition
data-ng-if="!$ctrl.hasVcdMigration"
data-term="{{:: 'ovhManagerPccDashboardGeneralInformation_numberOfDatacenters_term' | translate }}"
data-description="{{:: $ctrl.bindings.numberOfDatacenters }}"
></oui-tile-definition>
Expand Down Expand Up @@ -194,6 +197,13 @@
</oui-tile-definition>

<oui-tile-definition
data-ng-if="$ctrl.hasVcdMigration"
data-term="{{:: 'ovhManagerPccDashboardGeneralInformation_vcd_name' | translate }}"
data-description="{{:: $ctrl.bindings.vcdName || '-' }}"
></oui-tile-definition>

<oui-tile-definition
data-ng-if="!$ctrl.hasVcdMigration"
data-term="{{:: 'ovhManagerPccDashboardGeneralInformation_managementInterfaces_term' | translate }}"
>
<oui-tile-description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -38,5 +36,4 @@ export default {
VDC_MIRGRATION_GUIDE_LINK,
TRACKING_NEW_PRODUCT_BANNER,
LANGUAGE_OVERRIDE,
TRACKING_PREFIX,
};
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
</div>
</div>

<ovh-manager-pcc-managed-vcd-migration-banner
data-service-name="$ctrl.datacenter.model.serverName"
data-tracking-prefix="$ctrl.TRACKING_PREFIX"
/>

<oui-header-tabs>
<oui-header-tabs-item data-state="{{:: $ctrl.dashboardState }}"
><span data-translate="dedicatedCloud_tab_dashboard"></span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default {
dedicatedCloudVCDMigrationState: '<',
dedicatedCloudPCCMigrationState: '<',
hasVCDMigration: '<',
vcdTrackingPrefix: '<',
},
controller,
template,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export const MANAGED_PCC_MIGRATION_STATUS = {
UNKNOWN: 'unknown',
};

export const TRACKING_PREFIX = 'Baremetal::Managed_baremetal::';

export const MANAGED_VCD_MIGRATION_STATUS = {
TO_MIGRATE: 'TO_MIGRATE',
MIGRATED: 'MIGRATED',
Expand Down Expand Up @@ -190,5 +188,4 @@ export default {
MANAGED_VCD_MIGRATION_STATUS,
MANAGED_VCD_MIGRATION_STATE,
MANAGED_PCC_MIGRATION_STATUS,
TRACKING_PREFIX,
};
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { TRACKING_PREFIX } from './dedicatedCloud.constant';

export default class {
/* @ngInject */
constructor($scope, $translate) {
this.$scope = $scope;
this.$translate = $translate;
this.TRACKING_PREFIX = TRACKING_PREFIX;
}

$onInit() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<ovh-manager-pcc-managed-vcd-migration-banner
data-service-name="$ctrl.dedicatedCloud.serviceName"
data-tracking-prefix="$ctrl.TRACKING_PREFIX"
data-tracking-prefix="$ctrl.vcdTrackingPrefix"
data-vcd-migration-state="$ctrl.dedicatedCloudVCDMigrationState"
data-pcc-migration-state="$ctrl.dedicatedCloudPCCMigrationState"
data-has-vcd-migration="$ctrl.hasVCDMigration"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import template from './template.html';

export default {
bindings: {
serviceName: '<',
trackingPrefix: '<',
pccMigrationState: '<',
vcdMigrationState: '<',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"dedicatedCloud_managed_vcd_migrated": "Votre solution Hosted Private Cloud a été migrée vers VMware Cloud Director. Cette page vous permet de gérer vos blocs d'IP publiques (commande d'un nouveau bloc, réattribution d'un bloc existant vers un autre service) qui sont actuellement attachés à votre service Hosted Private Cloud et connectés à votre service VMware Cloud Director. Cette situation est temporaire et prendra fin lorsque vos blocs d'IP publiques auront été attachés automatiquement à votre service VMware Cloud Director."
"dedicatedCloud_managed_vcd_migrated": "Votre solution Hosted Private Cloud a été migrée ou est en cours de migration vers VMware Cloud Director. Cette page vous permet de gérer vos blocs d'IP publiques (commande d'un nouveau bloc, réattribution d'un bloc existant vers un autre service) qui sont actuellement attachés à votre service Hosted Private Cloud et connectés à votre service VMware Cloud Director. Cette situation est temporaire et prendra fin lorsque vos blocs d'IP publiques auront été attachés automatiquement à votre service VMware Cloud Director."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import angular from 'angular';

import moveIpComponent from '../../../components/move-ip';
import routing from './associate-ip-bloc.routing';

const moduleName = 'ovhManagerPccDashboardLightAssociateIpBloc';

angular.module(moduleName, [moveIpComponent]).config(routing);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export default /* @ngInject */ ($stateProvider) => {
$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,
},
},
);
};
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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;
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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',
},
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
},
Expand All @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,16 @@ export default /* @ngInject */ ($stateProvider) => {
'[email protected]':
'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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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) =>
Expand Down
Loading

0 comments on commit a3cc94d

Please sign in to comment.