Skip to content

Commit

Permalink
Merge pull request #3609 from ovh/hotfix/2020-09-14
Browse files Browse the repository at this point in the history
Hotfixes release
  • Loading branch information
antleblanc authored Sep 14, 2020
2 parents ac395ed + e8f79ea commit 2076e65
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 22 deletions.
23 changes: 20 additions & 3 deletions packages/manager/apps/dedicated/client/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -127,7 +127,6 @@ angular
'ovh-angular-responsive-tabs',
'ovh-api-services',
ovhManagerAtInternetConfiguration,
ovhManagerPccDashboard,
ovhManagerIplb,
ovhManagerPccResourceUpgrade,
ovhManagerServerSidebar,
Expand Down Expand Up @@ -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 || /</.test(param);
});
if (invalidParams) {
$location.search('');
}
});

// manage restriction on billing section for enterprise account
// see src/billing/billingApp.js for resolve restriction on billing states
$transitions.onError({}, (transition) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class DomainDnsZoneActivateController {
checkoutOrderCart(autoPayWithPreferredPaymentMethod, cartId, isOptionFree) {
this.checkoutLoading = true;
this.DomainDnsZoneActivateService.checkoutOrderCart(
isOptionFree || autoPayWithPreferredPaymentMethod,
autoPayWithPreferredPaymentMethod,
cartId,
)
.then((order) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"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",
"@ovh-ux/ng-at-internet": "^5.3.0",
"@ovh-ux/ng-at-internet-ui-router-plugin": "^3.1.0",
"angular": "^1.7.5"
}
}
}
30 changes: 17 additions & 13 deletions packages/manager/modules/at-internet-configuration/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/modules/notifications-sidebar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -27,4 +27,4 @@
"moment": "^2.24.0",
"ovh-api-services": "^9.39.1"
}
}
}

0 comments on commit 2076e65

Please sign in to comment.