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(dedicated.server): rbx1 eol banner #14742

Merged
merged 3 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -26,9 +26,12 @@ export const UPGRADE_TYPE = {
STORAGE: 'storage',
};

export const RBX1_DATACENTER = 'RBX_1';

export default {
ELIGIBLE_FOR_UPGRADE,
COMMIT_IMPRESSION_TRACKING_DATA,
RECOMMIT_IMPRESSION_TRACKING_DATA,
UPGRADE_TYPE,
RBX1_DATACENTER,
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import includes from 'lodash/includes';
import isEmpty from 'lodash/isEmpty';

import UpgradeTask from './upgrade/upgrade-task.class';
import { ELIGIBLE_FOR_UPGRADE } from './dashboard.constants';
import { ELIGIBLE_FOR_UPGRADE, RBX1_DATACENTER } from './dashboard.constants';
import { UPGRADE_MODE } from './upgrade/upgrade.constants';

export default /* @ngInject */ ($stateProvider) => {
Expand Down Expand Up @@ -334,6 +334,12 @@ export default /* @ngInject */ ($stateProvider) => {
})
: null,
),
displayRbxEolBanner: /* @ngInject */ (features, server) => {
return (
features.isFeatureAvailable('dedicated-server:rbx1-eol-banner') &&
server.datacenter === RBX1_DATACENTER
);
},
},
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default /* @ngInject */ ($stateProvider) => {
'dedicated-server:dns',
'dedicated-server:upgradeWithTicket',
'dedicated-server:vmac-unavailable-banner',
'dedicated-server:rbx1-eol-banner',
]),
ola: /* @ngInject */ (
$stateParams,
Expand Down
1 change: 1 addition & 0 deletions packages/manager/modules/bm-server-components/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ export { default as serverSecondaryDns } from './secondary-dns';
export { default as serverMainPage } from './server';
export { default as serverDashboard } from './server-dashboard';
export { default as vmacUnavailableBanner } from './vmac-unavailable-banner';
export { default as rbx1EolBanner } from './rbx1-eol-banner';
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import controller from './controller';
import template from './template.html';

export default {
controller,
name: 'ovhManagerBmServerComponentsRbx1EolBanner',
template,
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
export const GUIDE_LINKS = {
DEFAULT: 'https://www.ovhcloud.com/en-ie/lp/end-service-rbx-1/',
ASIA: 'https://www.ovhcloud.com/asia/lp/end-service-rbx-1/',
AU: 'https://www.ovhcloud.com/en-au/lp/end-service-rbx-1/',
CA: 'https://www.ovhcloud.com/en-ca/lp/end-service-rbx-1/',
DE: 'https://www.ovhcloud.com/de/lp/end-service-rbx-1/',
ES: 'https://www.ovhcloud.com/es-es/lp/end-service-rbx-1/',
FR: 'https://www.ovhcloud.com/fr/lp/end-service-rbx-1/',
GB: 'https://www.ovhcloud.com/en-gb/lp/end-service-rbx-1/',
IE: 'https://www.ovhcloud.com/en-ie/lp/end-service-rbx-1/',
IN: 'https://www.ovhcloud.com/en-in/lp/end-service-rbx-1/',
IT: 'https://www.ovhcloud.com/it/lp/end-service-rbx-1/',
MA: 'https://www.ovhcloud.com/fr-ma/lp/end-service-rbx-1/',
NL: 'https://www.ovhcloud.com/nl/lp/end-service-rbx-1/',
PL: 'https://www.ovhcloud.com/pl/lp/end-service-rbx-1/',
PT: 'https://www.ovhcloud.com/pt/lp/end-service-rbx-1/',
QC: 'https://www.ovhcloud.com/fr-ca/lp/end-service-rbx-1/',
SN: 'https://www.ovhcloud.com/fr-sn/lp/end-service-rbx-1/',
SG: 'https://www.ovhcloud.com/en-sg/lp/end-service-rbx-1/',
TN: 'https://www.ovhcloud.com/fr-tn/lp/end-service-rbx-1/',
US: 'https://www.ovhcloud.com/en/lp/end-service-rbx-1/',
WE: 'https://www.ovhcloud.com/en-ie/lp/end-service-rbx-1/',
WS: 'https://www.ovhcloud.com/es/lp/end-service-rbx-1/',
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { GUIDE_LINKS } from './constants';

export default class RbxEolBannerController {
/* @ngInject */
constructor(coreConfig) {
this.guideLink =
GUIDE_LINKS[coreConfig.getUser().ovhSubsidiary] || GUIDE_LINKS.DEFAULT;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import angular from 'angular';
import '@ovh-ux/ng-translate-async-loader';
import 'angular-translate';
import '@ovh-ux/ui-kit';

import component from './component';

const moduleName = 'ovhManagerRbx1EolBanner';

angular
.module(moduleName, [
'oui',
'ngTranslateAsyncLoader',
'pascalprecht.translate',
])
.component(component.name, component)
.run(/* @ngTranslationsInject:json ./translations */);

export default moduleName;
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<oui-message data-type="warning" class="mb-4">
<p
data-translate="rbx1_eol_banner_title"
data-translate-values="{guideLink: $ctrl.guideLink}"
></p>
</oui-message>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rbx1_eol_banner_title": "ATTENTION: Pour vous permettre de migrer vos services de RBX1 dont la modernisation est prévue cette année, la période de migration des serveurs est étendue jusqu'au 30 juin 2025. Pour plus de détail, merci de vous référer au mail reçu et de consulter notre <a href=\"{{guideLink}}\" target=\"_blank\">guide de migration</a>."
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export default {
goToTrafficOrder: '<',
goToTrafficCancel: '<',
serverType: '<?',
displayRbxEolBanner: '<?',
},
controller,
template,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
</span>
</oui-message>

<ovh-manager-bm-server-components-rbx1-eol-banner
data-ng-if="$ctrl.displayRbxEolBanner"
></ovh-manager-bm-server-components-rbx1-eol-banner>

<ovh-manager-bm-server-components-vmac-unavailable-banner
data-ng-if="$ctrl.isVmacUnavailableBannerAvailable"
data-service-id="$ctrl.serviceInfos.serviceId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import '@ovh-ux/ui-kit';
import 'angular-translate';

import vmacUnavailableBanner from '../vmac-unavailable-banner';
import rbx1EolBanner from '../rbx1-eol-banner';
import service from '../server/server.service';
import bandwidthVrackOrderService from '../server/server.bandwidth-vrack-order.service';
import featureAvailability from '../server/server.feature-availability';
Expand All @@ -12,7 +13,12 @@ import component from './dashboard.component';
const moduleName = 'ovhManagerBmServerComponentsServerDashboard';

angular
.module(moduleName, ['oui', 'pascalprecht.translate', vmacUnavailableBanner])
.module(moduleName, [
'oui',
'pascalprecht.translate',
vmacUnavailableBanner,
rbx1EolBanner,
])
.component('serverDashboard', component)
.service('Server', service)
.service('BandwidthVrackOrderService', bandwidthVrackOrderService)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default class RbxEolBannerController {
export default class VmacUnavailableBannerController {
/* @ngInject */
constructor(VmacUnavailableBannerService) {
this.VmacUnavailableBannerService = VmacUnavailableBannerService;
Expand Down
Loading