From dd658a739447cae516dd11f27a4c8f46f7cd4899 Mon Sep 17 00:00:00 2001 From: Cyrille Bourgois Date: Mon, 14 Sep 2020 10:46:14 +0200 Subject: [PATCH 1/6] fix(at-internet): prevents errors if clientSideUserId is not available (#3608) Signed-off-by: Cyrille Bourgois --- .../at-internet-configuration/src/index.js | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/manager/modules/at-internet-configuration/src/index.js b/packages/manager/modules/at-internet-configuration/src/index.js index e0e1346ae1e0..b43db66dba3b 100644 --- a/packages/manager/modules/at-internet-configuration/src/index.js +++ b/packages/manager/modules/at-internet-configuration/src/index.js @@ -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. } } }, From 399fc8abde60ca86fa2bf0ef7909699d780ae0cb Mon Sep 17 00:00:00 2001 From: Cyrille Bourgois Date: Fri, 11 Sep 2020 16:10:43 +0200 Subject: [PATCH 2/6] build(deps): bump @ovh-ux/manager-config to use latest (#3603) bump `@ovh-ux/manager-config` in `@ovh-ux/manager-at-internet-configuration` and `@ovh-ux/manager-notifications-sidebar` to use `^1.1.1` instead of `^0.4.0` Signed-off-by: Cyrille Bourgois --- .../manager/modules/at-internet-configuration/package.json | 4 ++-- packages/manager/modules/notifications-sidebar/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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/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 +} From 59fea650609c6cfc3401bc74d30f13fb058dcfa0 Mon Sep 17 00:00:00 2001 From: Florian Renaut Date: Mon, 14 Sep 2020 10:58:41 +0200 Subject: [PATCH 3/6] fix(dedicated): escape query params (#3604) ref: DTRSD-11881 Signed-off-by: frenauvh --- .../manager/apps/dedicated/client/app/app.js | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) 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 || / { From 077861c004a157c76cc3e9b5620eb2e70078f099 Mon Sep 17 00:00:00 2001 From: lizardK Date: Mon, 14 Sep 2020 11:19:30 +0200 Subject: [PATCH 4/6] fix(dedicated.server): no sms monitoring in US (#3605) ref: MANAGER-5632 Signed-off-by: cyril.biencourt Co-authored-by: cyril.biencourt --- .../dedicated/client/app/dedicated/server/server.service.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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, From b62d0292f87b9185b688c8f05991d7129af43562 Mon Sep 17 00:00:00 2001 From: Marie JONES Date: Mon, 14 Sep 2020 13:26:04 +0200 Subject: [PATCH 5/6] fix: assign new value for route replacement (#3582) Signed-off-by: Marie JONES --- .../manager/modules/at-internet-configuration/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/manager/modules/at-internet-configuration/src/index.js b/packages/manager/modules/at-internet-configuration/src/index.js index b43db66dba3b..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; From e8f79ea93a7732d023d0f44d3bb9492b7e0f3756 Mon Sep 17 00:00:00 2001 From: Marie JONES Date: Mon, 14 Sep 2020 14:38:20 +0200 Subject: [PATCH 6/6] fix(domain.zone.activate): only autopay depending on payment method (#3569) Signed-off-by: Marie JONES --- .../web/client/app/domain/zone/activate/activate.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) => {