diff --git a/packages/manager/apps/dedicated/client/app/app.js b/packages/manager/apps/dedicated/client/app/app.js index a822c102631f..4dcc3509952d 100644 --- a/packages/manager/apps/dedicated/client/app/app.js +++ b/packages/manager/apps/dedicated/client/app/app.js @@ -2,6 +2,7 @@ import { Environment } from '@ovh-ux/manager-config'; import get from 'lodash/get'; import has from 'lodash/has'; import set from 'lodash/set'; +import values from 'lodash/values'; import isString from 'lodash/isString'; import ngAtInternet from '@ovh-ux/ng-at-internet'; import ngAtInternetUiRouterPlugin from '@ovh-ux/ng-at-internet-ui-router-plugin'; @@ -56,7 +57,6 @@ import dedicatedCloudTerminate from './dedicatedCloud/terminate/terminate.module import dedicatedCloudDashboard from './dedicatedCloud/dashboard'; import dedicatedUniverseComponents from './dedicatedUniverseComponents'; import errorPage from './error'; -import ovhManagerPccDashboard from './dedicatedCloud/dashboard'; import ovhManagerPccResourceUpgrade from './dedicatedCloud/resource/upgrade'; import dedicatedServer from './dedicated/server'; @@ -127,7 +127,6 @@ angular 'ovh-angular-responsive-tabs', 'ovh-api-services', ovhManagerAtInternetConfiguration, - ovhManagerPccDashboard, ovhManagerIplb, ovhManagerPccResourceUpgrade, ovhManagerServerSidebar, @@ -219,12 +218,30 @@ angular ssoAuthentication.login().then(() => User.getUser()); }) .run( - /* @ngInject */ ($rootScope, $state, $transitions, coreConfig) => { + /* @ngInject */ ( + $location, + $rootScope, + $state, + $transitions, + coreConfig, + ) => { $rootScope.$on('$locationChangeStart', () => { // eslint-disable-next-line no-param-reassign delete $rootScope.isLeftMenuVisible; }); + // if query params contains unescaped '<' value then + // clear query params to avoid html injection + $transitions.onBefore({}, () => { + let invalidParams = false; + values($location.search()).forEach((param) => { + invalidParams = invalidParams || / { diff --git a/packages/manager/apps/dedicated/client/app/dedicated/server/server.service.js b/packages/manager/apps/dedicated/client/app/dedicated/server/server.service.js index 940e75d51549..b0ddff9bfd5a 100644 --- a/packages/manager/apps/dedicated/client/app/dedicated/server/server.service.js +++ b/packages/manager/apps/dedicated/client/app/dedicated/server/server.service.js @@ -5,6 +5,7 @@ import filter from 'lodash/filter'; import find from 'lodash/find'; import head from 'lodash/head'; import indexOf from 'lodash/indexOf'; +import includes from 'lodash/includes'; import map from 'lodash/map'; import parseInt from 'lodash/parseInt'; import set from 'lodash/set'; @@ -2139,9 +2140,10 @@ export default class ServerF { getSms(productId) { let promises = []; - if (this.coreConfig.getRegion() === 'CA') { + if (includes(['CA', 'US'], this.coreConfig.getRegion())) { return this.$q.when([]); } + return this.get(productId, '', { proxypass: true, urlPath: this.path.sms, diff --git a/packages/manager/apps/web/client/app/domain/zone/activate/activate.controller.js b/packages/manager/apps/web/client/app/domain/zone/activate/activate.controller.js index 906b4e0f1010..9b35e00aff6d 100644 --- a/packages/manager/apps/web/client/app/domain/zone/activate/activate.controller.js +++ b/packages/manager/apps/web/client/app/domain/zone/activate/activate.controller.js @@ -87,7 +87,7 @@ export default class DomainDnsZoneActivateController { checkoutOrderCart(autoPayWithPreferredPaymentMethod, cartId, isOptionFree) { this.checkoutLoading = true; this.DomainDnsZoneActivateService.checkoutOrderCart( - isOptionFree || autoPayWithPreferredPaymentMethod, + autoPayWithPreferredPaymentMethod, cartId, ) .then((order) => { diff --git a/packages/manager/modules/at-internet-configuration/package.json b/packages/manager/modules/at-internet-configuration/package.json index 7653e82c8f7e..b88a800decd8 100644 --- a/packages/manager/modules/at-internet-configuration/package.json +++ b/packages/manager/modules/at-internet-configuration/package.json @@ -12,7 +12,7 @@ "author": "OVH SAS", "main": "./src/index.js", "dependencies": { - "@ovh-ux/manager-config": "^0.4.0" + "@ovh-ux/manager-config": "^1.1.1" }, "peerDependencies": { "@ovh-ux/manager-core": "^9.0.0", @@ -20,4 +20,4 @@ "@ovh-ux/ng-at-internet-ui-router-plugin": "^3.1.0", "angular": "^1.7.5" } -} \ No newline at end of file +} diff --git a/packages/manager/modules/at-internet-configuration/src/index.js b/packages/manager/modules/at-internet-configuration/src/index.js index e0e1346ae1e0..cff3029e408c 100644 --- a/packages/manager/modules/at-internet-configuration/src/index.js +++ b/packages/manager/modules/at-internet-configuration/src/index.js @@ -33,9 +33,9 @@ angular atInternetUiRouterPluginProvider.addStateNameFilter((routeName) => { let route = routeName || ''; atInternetConfigurationProvider.stateRules.forEach((rule) => { - route.replace(rule.pattern, rule.replacement); + route = route.replace(rule.pattern, rule.replacement); }); - route = routeName.replace(/\./g, '::'); + route = route.replace(/\./g, '::'); return atInternetConfigurationProvider.prefix ? `${atInternetConfigurationProvider.prefix}::${route}` : route; @@ -47,20 +47,24 @@ angular const cookie = $cookies.get(USER_ID); const tag = atInternet.getTag(); if (trackingEnabled) { - if (cookie) { - tag.clientSideUserId.set(cookie); - } else { - const value = tag.clientSideUserId.get(); - tag.clientSideUserId.store(); + try { + if (cookie) { + tag.clientSideUserId.set(cookie); + } else { + const value = tag.clientSideUserId.get(); + tag.clientSideUserId.store(); - const element = document.getElementById('manager-tms-iframe'); + const element = document.getElementById('manager-tms-iframe'); - if (element) { - element.contentWindow.postMessage({ - id: 'ClientUserId', - value, - }); + if (element) { + element.contentWindow.postMessage({ + id: 'ClientUserId', + value, + }); + } } + } catch (e) { + // nothing to do. } } }, diff --git a/packages/manager/modules/notifications-sidebar/package.json b/packages/manager/modules/notifications-sidebar/package.json index 3fab9e77ed0d..5e0cab666070 100644 --- a/packages/manager/modules/notifications-sidebar/package.json +++ b/packages/manager/modules/notifications-sidebar/package.json @@ -15,7 +15,7 @@ "lodash": "^4.17.15" }, "peerDependencies": { - "@ovh-ux/manager-config": "^0.4.0", + "@ovh-ux/manager-config": "^1.1.1", "@ovh-ux/manager-core": "^9.0.0 || ^10.0.0", "@ovh-ux/ng-at-internet": "^5.1.0", "@ovh-ux/ng-ovh-api-wrappers": "^3.0.0", @@ -27,4 +27,4 @@ "moment": "^2.24.0", "ovh-api-services": "^9.39.1" } -} \ No newline at end of file +}