Skip to content

Commit

Permalink
merge: sync master to develop
Browse files Browse the repository at this point in the history
Signed-off-by: Anoop N <[email protected]>
  • Loading branch information
anooparveti authored Oct 30, 2024
2 parents 3c7493b + a1956d6 commit 1e8a424
Show file tree
Hide file tree
Showing 104 changed files with 1,081 additions and 619 deletions.
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sonar.projectName=manager
sonar.sources=.
sonar.sourceEncoding=UTF-8
sonar.ws.timeout=60
sonar.projectVersion=radon-sheep-6
sonar.projectVersion=neptunium-wildebeest

sonar.exclusions=node_modules/**, **/node_modules/**, **/dist/**, **/semantic/**, **/coverage/**, **/static/**, **/mock/**, **/mockServiceWorker.js
sonar.coverage.exclusions=**/*.spec.js
Expand Down
17 changes: 17 additions & 0 deletions packages/manager/apps/dedicated/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [19.63.0](https://github.com/ovh/manager/compare/@ovh-ux/[email protected]...@ovh-ux/[email protected]) (2024-10-29)


### Bug Fixes

* **dedicated-cloud:** replace description by name in breadcrumb ([#13249](https://github.com/ovh/manager/issues/13249)) ([b1d1b3a](https://github.com/ovh/manager/commit/b1d1b3a2ceeda15462f28620dc7a789ac0edc92e))


### Features

* **dedicated.ip:** navigate user to api console ([#12236](https://github.com/ovh/manager/issues/12236)) ([4df8cb5](https://github.com/ovh/manager/commit/4df8cb5530b0bd280773740ad540b7f29c482c23))
* **dedicated:** modify the delay message for order confirmation ([#12560](https://github.com/ovh/manager/issues/12560)) ([7fdb3e5](https://github.com/ovh/manager/commit/7fdb3e5078ea921b2bba39bd562277281f507550))





## [19.62.2](https://github.com/ovh/manager/compare/@ovh-ux/[email protected]...@ovh-ux/[email protected]) (2024-10-24)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,6 @@ export default class {
datacenterId: this.datacenter.model.id,
destinationId,
value,
}).result.then((newValue) => {
if (contextTitle === 'dedicatedCloud_datacenter_name') {
this.datacenter.model.name = newValue;
} else {
this.datacenter.model.description = newValue;
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export default class {
'dedicatedCloud_dashboard_nameModifying_success',
),
value,
}).result.then((newDescription) => {
this.dedicatedCloud.description = newDescription;
});
}).result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import isUndefined from 'lodash/isUndefined';
import set from 'lodash/set';
import snakeCase from 'lodash/snakeCase';
import some from 'lodash/some';
import toNumber from 'lodash/toNumber';

import {
DEDICATED_CLOUD_CONSTANTS,
Expand Down Expand Up @@ -344,59 +343,18 @@ class DedicatedCloudService {
);
}

getDatacenterInformations(serviceName, datacenterId, forceRefresh) {
return this.OvhHttp.get(
'/sws/dedicatedCloud/{serviceName}/datacenters/{datacenterId}',
{
rootPath: '2api',
urlParams: {
serviceName,
datacenterId,
},
cache: 'SUB_DATACENTERS',
clearCache: forceRefresh,
},
);
}

updateDatacenterName(serviceName, datacenterId, name) {
return this.OvhHttp.put(
'/dedicatedCloud/{serviceName}/datacenter/{datacenterId}',
{
rootPath: 'apiv6',
urlParams: {
serviceName,
datacenterId,
},
data: {
name,
},
},
);
getDatacenterInformations(serviceName, datacenterId) {
return this.$http
.get(`/sws/dedicatedCloud/${serviceName}/datacenters/${datacenterId}`, {
serviceType: 'aapi',
})
.then(({ data }) => data);
}

updateDatacenterDescription(serviceName, datacenterId, description) {
return this.OvhHttp.put(
'/dedicatedCloud/{serviceName}/datacenter/{datacenterId}',
{
rootPath: 'apiv6',
urlParams: {
serviceName,
datacenterId,
},
data: {
description,
},
broadcast: 'global_display_name_change',
broadcastParam: {
stateParams: {
productId: serviceName,
datacenterId: toNumber(datacenterId),
},
displayName: description,
},
},
);
updateDatacenterData(serviceName, datacenterId, data) {
return this.$http
.put(`/dedicatedCloud/${serviceName}/datacenter/${datacenterId}`, data)
.then(({ data: result }) => result);
}

/* ------- SUB DATACENTER HOSTS -------*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,52 @@ angular.module('App').controller(
'NameEditionCtrl',
class NameEditionCtrl {
/* @ngInject */
constructor($translate, $uibModalInstance, Alerter, DedicatedCloud, data) {
constructor(
$translate,
$interval,
$state,
$uibModalInstance,
Alerter,
DedicatedCloud,
data,
) {
this.$translate = $translate;
this.$interval = $interval;
this.$state = $state;
this.$uibModalInstance = $uibModalInstance;
this.Alerter = Alerter;
this.DedicatedCloud = DedicatedCloud;
this.data = data;
this.$poll = null;
}

pollTask(taskId) {
this.$poll = this.$interval(() => {
this.DedicatedCloud.getOperation(this.data.productId, {
taskId,
})
.then(({ state }) => {
if (state === 'done') {
this.stopPollTask();
this.$state.reload();
}
})
.catch(this.stopPollTask);
}, 3000);
}

stopPollTask() {
if (this.$poll) {
this.$interval.cancel(this.$poll);
this.$poll = null;
}
}

updateDescription() {
this.updating = true;

return this.updateName()
.then(() => {
.then((data) => {
if (this.data.successText) {
this.Alerter.success(
this.data.successText,
Expand All @@ -25,6 +58,9 @@ angular.module('App').controller(
}

this.$uibModalInstance.close(this.newValue);
if (data?.taskId) {
this.pollTask(data.taskId);
}
})
.catch((err) => {
const message = this.$translate.instant(
Expand Down Expand Up @@ -59,21 +95,15 @@ angular.module('App').controller(
);
break;
case 'dedicatedCloud_datacenter_name':
this.modalContextTitle = 'dedicatedCloud_datacenter_name';
this.updateName = () =>
this.DedicatedCloud.updateDatacenterName(
this.data.productId,
this.data.datacenterId,
this.newValue,
);
break;
case 'dedicatedCloud_datacenter_description':
this.modalContextTitle = 'dedicatedCloud_datacenter_description';
this.modalContextTitle = this.data.contextTitle;
this.updateName = () =>
this.DedicatedCloud.updateDatacenterDescription(
this.DedicatedCloud.updateDatacenterData(
this.data.productId,
this.data.datacenterId,
this.newValue,
this.modalContextTitle.endsWith('name')
? { name: this.newValue }
: { description: this.newValue },
);
break;
default:
Expand All @@ -82,5 +112,9 @@ angular.module('App').controller(
break;
}
}

$onDestroy() {
this.stopPollTask();
}
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<form name="updateNameForm" novalidate>
<oui-modal
data-primary-label="{{ :: 'common_change' | translate }}"
data-primary-disabled="updateNameForm.$invalid"
data-primary-disabled="updateNameForm.$invalid || $ctrl.newValue === $ctrl.data.value"
data-primary-action="$ctrl.updateDescription()"
data-secondary-label="{{ :: 'common_cancel' | translate }}"
data-secondary-action="$ctrl.$uibModalInstance.dismiss()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ export default /* @ngInject */ ($stateProvider) => {
...backup,
datacenterId: datacenter.id,
datacenterName:
datacenter.description ||
datacenter.displayName ||
datacenter.id.toString(),
datacenter.displayName || datacenter.id.toString(),
}),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default /* @ngInject */ ($stateProvider) => {
DedicatedCloud.getDatacenterInformations(
serviceName,
datacenterId,
true,
).then((datacenter) => ({
model: {
...datacenter,
Expand Down Expand Up @@ -58,7 +57,7 @@ export default /* @ngInject */ ($stateProvider) => {
'dedicatedCloudDatacenterAlert',
);
},
breadcrumb: /* @ngInject */ (datacenterId) => datacenterId,
breadcrumb: /* @ngInject */ (datacenter) => datacenter.model.name,
},
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ip_byoip_disclaimer_description_point_3": " - dass dieser IP-Adressbereich eine gute Reputation hat.",
"ip_byoip_disclaimer_confirm_text": "Bestätigen",
"ip_byoip_disclaimer_cancel_text": "Abbrechen",
"ip_byoip_disclaimer_ordering_delay_message": "Bitte beachten Sie, dass dieser Prozess bis zu zwei Wochen in Anspruch nehmen kann. Wir entschuldigen uns für die Unannehmlichkeiten."
"ip_byoip_disclaimer_ordering_delay_message": "Bitte beachten Sie, dass dieser Vorgang ungefähr 3 Wochen dauern kann. Wir entschuldigen uns für die Unannehmlichkeiten."
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ip_byoip_disclaimer_description_point_3": " - This IP address range has a healthy reputation.",
"ip_byoip_disclaimer_confirm_text": "Confirm",
"ip_byoip_disclaimer_cancel_text": "Cancel",
"ip_byoip_disclaimer_ordering_delay_message": "Please note that this process may take up to two weeks. We apologise for the inconvenience."
"ip_byoip_disclaimer_ordering_delay_message": "Please note that this process might take around three weeks. We apologise for the inconvenience."
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ip_byoip_disclaimer_description_point_3": " - este rango de direcciones IP tiene una buena reputación.",
"ip_byoip_disclaimer_confirm_text": "Confirmar",
"ip_byoip_disclaimer_cancel_text": "Cancelar",
"ip_byoip_disclaimer_ordering_delay_message": "Tenga en cuenta que este proceso puede tardar hasta dos semanas. Rogamos disculpe las molestias ocasionadas."
"ip_byoip_disclaimer_ordering_delay_message": "Tenga en cuenta que este proceso puede tardar aproximadamente 3 semanas. Rogamos disculpe las molestias ocasionadas."
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ip_byoip_disclaimer_description_point_1": " - Être le propriétaire de la plage d'adresses IP renseignée.",
"ip_byoip_disclaimer_description_point_2": " - M'engager à faire en sorte que la plage d'adresses IP renseignée ne soit pas annoncée sur Internet par plusieurs réseaux simultanément (multi-homing)",
"ip_byoip_disclaimer_description_point_3": " - Avoir une réputation saine sur cette plage d'adresses IP",
"ip_byoip_disclaimer_ordering_delay_message": "Veuillez noter que ce processus peut prendre jusqu'à deux semaines. Nous vous prions de nous excuser pour ce désagrément.",
"ip_byoip_disclaimer_ordering_delay_message": "Veuillez noter que ce processus peut prendre approximativement 3 semaines. Nous vous prions de nous excuser pour ce désagrément.",
"ip_byoip_disclaimer_confirm_text": "Valider",
"ip_byoip_disclaimer_cancel_text": "Annuler"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ip_byoip_disclaimer_description_point_1": " - Être le propriétaire de la plage d'adresses IP renseignée.",
"ip_byoip_disclaimer_description_point_2": " - M'engager à faire en sorte que la plage d'adresses IP renseignée ne soit pas annoncée sur Internet par plusieurs réseaux simultanément (multi-homing)",
"ip_byoip_disclaimer_description_point_3": " - Avoir une réputation saine sur cette plage d'adresses IP",
"ip_byoip_disclaimer_ordering_delay_message": "Veuillez noter que ce processus peut prendre jusqu'à deux semaines. Nous vous prions de nous excuser pour ce désagrément.",
"ip_byoip_disclaimer_ordering_delay_message": "Veuillez noter que ce processus peut prendre approximativement 3 semaines. Nous vous prions de nous excuser pour ce désagrément.",
"ip_byoip_disclaimer_confirm_text": "Valider",
"ip_byoip_disclaimer_cancel_text": "Annuler"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ip_byoip_disclaimer_description_point_3": " - di avere una buona reputazione su questa classe di indirizzi IP",
"ip_byoip_disclaimer_confirm_text": "Conferma",
"ip_byoip_disclaimer_cancel_text": "Annulla",
"ip_byoip_disclaimer_ordering_delay_message": "Questo processo potrebbe durare fino a due settimane. Ci scusiamo per l'inconveniente."
"ip_byoip_disclaimer_ordering_delay_message": "Ti ricordiamo che questo processo potrebbe richiedere circa 3 settimane. Ci scusiamo per l'inconveniente."
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ip_byoip_disclaimer_description_point_3": " - wskazany zakres adresów IP posiada pozytywną reputację",
"ip_byoip_disclaimer_confirm_text": "Zatwierdź",
"ip_byoip_disclaimer_cancel_text": "Anuluj",
"ip_byoip_disclaimer_ordering_delay_message": "Pamiętaj, że proces ten może potrwać do dwóch tygodni. Przepraszamy za niedogodności."
"ip_byoip_disclaimer_ordering_delay_message": "Proces ten może potrwać około 3 tygodni. Przepraszamy za niedogodności."
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"ip_byoip_disclaimer_description_point_3": " - Ter boa reputação neste intervalo de endereços IP.",
"ip_byoip_disclaimer_confirm_text": "Validar",
"ip_byoip_disclaimer_cancel_text": "Anular",
"ip_byoip_disclaimer_ordering_delay_message": "Tenha em conta que este processo pode levar até duas semanas. Pedimos desculpa pelo incómodo."
"ip_byoip_disclaimer_ordering_delay_message": "Tenha em conta que este processo pode demorar cerca de 3 semanas. Pedimos desculpa pelo incómodo."
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ export const BYOIP_USAGE_GUIDE_URL = {
'https://help.ovhcloud.com/csm/en-gb-network-bring-your-own-ip?id=kb_article_view&sysparm_article=KB0044849',
};

export const US_API_CONSOLE_LINK = 'https://api.us.ovhcloud.com/console/';

export default {
TRACKING_PREFIX_SLICE,
TRACKING_PREFIX_AGGREGATE,
BYOIP_SLICE_PARK_IT_FIRST_ERROR_REGEX,
BYOIP_USAGE_GUIDE_URL,
US_API_CONSOLE_LINK,
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { US_API_CONSOLE_LINK } from '../constants';

export default class IpByoipDeleteController {
/* @ngInject */
constructor($scope, coreURLBuilder) {
Expand All @@ -11,6 +13,7 @@ export default class IpByoipDeleteController {
'dedicated',
'#/billing/autorenew',
);
this.apiConsoleUrl = US_API_CONSOLE_LINK;
this.cancelAction = () => {
this.$scope.resetAction();
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
on-dismiss="$ctrl.cancelAction()"
>
<p
data-translate="ip_byoip_delete_block_description"
data-translate-values="{ link: $ctrl.serviceLink }"
data-translate="{{'ip_byoip_delete_block_description' + ($ctrl.data.isDeleteByoipServiceAvailable ? '_info1' : '_info2')}}"
data-translate-values="{ link: ($ctrl.data.isDeleteByoipServiceAvailable ? $ctrl.serviceLink : $ctrl.apiConsoleUrl) }"
></p>
</oui-modal>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default {
trackPage: '<',
trackingData: '<',
goToStatistics: '<',
isDeleteByoipServiceAvailable: '<',
},
transclude: {
actions: '?ipListActions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export default class IpListController {
$scope.params = self.params || null;
$scope.isAdditionalIp = self.isAdditionalIp;
$scope.isAdmin = coreConfig.getUser().auth?.roles?.includes(ADMIN_ROLE);
$scope.isDeleteByoipServiceAvailable = self.isDeleteByoipServiceAvailable;

$scope.tracking = {
'enable-permanent-mitigation': `${TRACKING_PREFIX}::enable-permanent-mitigation`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<button
type="button"
class="btn btn-link"
data-ng-click="setAction('ip/byoip/delete/ip-ip-byoip-delete', { ipBlock: ipBlock }, 'info')"
data-ng-click="setAction('ip/byoip/delete/ip-ip-byoip-delete', { ipBlock: ipBlock, isDeleteByoipServiceAvailable }, 'info')"
data-oui-tooltip="{{ !ipBlock.canBeTerminated ? ('ip_failover_impossible_delete' | translate) : '' }}"
data-oui-tooltip-placement="left"
data-ng-bind=":: ('ip_table_manage_delete_ipblock' | translate) + ADDITIONAL_IP"
Expand Down
Loading

0 comments on commit 1e8a424

Please sign in to comment.