From dc3fbf0f49b987e34a90ad1773476603c2f301a7 Mon Sep 17 00:00:00 2001 From: mhelhali-soufien <159853039+mhelhali-soufien@users.noreply.github.com> Date: Sun, 22 Sep 2024 04:41:38 +0200 Subject: [PATCH] fix(dedicated): add featureAvailibility to upd protocol on lb frontend (#13187) ref: MANAGER-15224 Signed-off-by: soufien mhelhali --- packages/manager/modules/iplb/src/frontends/index.js | 11 ++++++++++- .../src/frontends/iplb-frontends-edit.controller.js | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/manager/modules/iplb/src/frontends/index.js b/packages/manager/modules/iplb/src/frontends/index.js index cba5bb7c700d..0ebeb36073cb 100644 --- a/packages/manager/modules/iplb/src/frontends/index.js +++ b/packages/manager/modules/iplb/src/frontends/index.js @@ -1,3 +1,5 @@ +import ngOvhFeatureFlipping from '@ovh-ux/ng-ovh-feature-flipping'; + import IpLoadBalancerDashboardHeaderCtrl from '../header/iplb-dashboard-header.controller'; import IpLoadBalancerFrontendsCtrl from './iplb-frontends.controller'; import IpLoadBalancerFrontendDeleteCtrl from './delete/iplb-frontends-delete.controller'; @@ -10,9 +12,10 @@ import IplbFrontendsTemplate from './iplb-frontends.html'; import IplbHeaderTemplate from '../header/iplb-dashboard-header.html'; const moduleName = 'ovhManagerIplbFrontends'; +const LB_FRONTEND_UDP_AVAILABILITY = 'lb-frontend-udp'; angular - .module(moduleName, ['ui.router']) + .module(moduleName, ['ui.router', ngOvhFeatureFlipping]) .config( /* @ngInject */ ($stateProvider) => { $stateProvider @@ -59,6 +62,12 @@ angular resolve: { breadcrumb: /* @ngInject */ ($translate) => $translate.instant('iplb_frontends_add'), + udpAvailability: /* @ngInject */ (ovhFeatureFlipping) => + ovhFeatureFlipping + .checkFeatureAvailability(LB_FRONTEND_UDP_AVAILABILITY) + .then((feature) => + feature.isFeatureAvailable(LB_FRONTEND_UDP_AVAILABILITY), + ), }, }) .state('iplb.detail.frontends.update', { diff --git a/packages/manager/modules/iplb/src/frontends/iplb-frontends-edit.controller.js b/packages/manager/modules/iplb/src/frontends/iplb-frontends-edit.controller.js index 261338b77234..79cdc9c29b44 100644 --- a/packages/manager/modules/iplb/src/frontends/iplb-frontends-edit.controller.js +++ b/packages/manager/modules/iplb/src/frontends/iplb-frontends-edit.controller.js @@ -18,6 +18,7 @@ export default class IpLoadBalancerFrontendsEditCtrl { IpLoadBalancerFailoverIpService, IpLoadBalancerFrontendsService, IpLoadBalancerZoneService, + udpAvailability, ) { this.$q = $q; this.$state = $state; @@ -29,6 +30,7 @@ export default class IpLoadBalancerFrontendsEditCtrl { this.IpLoadBalancerFailoverIpService = IpLoadBalancerFailoverIpService; this.IpLoadBalancerFrontendsService = IpLoadBalancerFrontendsService; this.IpLoadBalancerZoneService = IpLoadBalancerZoneService; + this.udpAvailability = udpAvailability; this.initLoaders(); } @@ -187,6 +189,10 @@ export default class IpLoadBalancerFrontendsEditCtrl { } else { this.farms.load(); } + + if (!this.udpAvailability) { + this.protocols = this.protocols.filter((protocol) => protocol !== 'udp'); + } } static validateSelection(value) {