Skip to content

Commit

Permalink
feat(dedicated.server): rbx1 eol banner
Browse files Browse the repository at this point in the history
ref: MANAGER-16530

Signed-off-by: Quentin Pavy <[email protected]>
  • Loading branch information
Quentin Pavy committed Dec 31, 2024
1 parent 8c9e43f commit 3b60540
Show file tree
Hide file tree
Showing 12 changed files with 56 additions and 3 deletions.
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,6 @@
import template from './template.html';

export default {
name: 'ovhManagerBmServerComponentsRbx1EolBanner',
template,
};
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,3 @@
<oui-message data-type="warning" class="mb-4">
<p data-translate="rbx1_eol_banner_title"></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 guide de migration."
}
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

0 comments on commit 3b60540

Please sign in to comment.