Skip to content

Commit

Permalink
feat(dedicated.ip): naviigate user to api console
Browse files Browse the repository at this point in the history
ref: MANAGER-14604

Signed-off-by: Sachin Ramesh <[email protected]>
  • Loading branch information
sachinrameshn committed Oct 10, 2024
1 parent 4461f51 commit 7807f50
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 4 deletions.
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
7 changes: 7 additions & 0 deletions packages/manager/apps/dedicated/client/app/ip/ip.routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
} from './ip.constant';

const allowByoipFeatureName = 'ip:byoip';
const allowDeleteByoipService = 'ip:deleteByoipService';

export const listRouting = {
reloadOnSearch: false,
Expand Down Expand Up @@ -143,6 +144,12 @@ export default /* @ngInject */ ($stateProvider) => {
ovhFeatureFlipping
.checkFeatureAvailability(allowByoipFeatureName)
.then((feature) => feature.isFeatureAvailable(allowByoipFeatureName)),
isDeleteByoipServiceAvailable: /* @ngInject */ (ovhFeatureFlipping) =>
ovhFeatureFlipping
.checkFeatureAvailability(allowDeleteByoipService)
.then((feature) =>
feature.isFeatureAvailable(allowDeleteByoipService),
),
goToByoipConfiguration: /* @ngInject */ ($state) => () => {
return $state.go('app.ip.byoip');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default /* @ngInject */
Ip,
trackClick,
isByoipAvailable,
isDeleteByoipServiceAvailable,
goToGameFirewall,
orderIpAvailable,
trackPage,
Expand All @@ -43,6 +44,7 @@ export default /* @ngInject */
$scope.goToOrganisation = goToOrganisation;
$scope.goToVrack = goToVrack;
$scope.isByoipAvailable = isByoipAvailable;
$scope.isDeleteByoipServiceAvailable = isDeleteByoipServiceAvailable;
$scope.orderIpAvailable = orderIpAvailable;
$scope.selection = { service: null, serviceType: null };
$scope.listParams = {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ <h4 data-translate="ip_addresses_grid_header"></h4>
data-params="listParams"
data-on-param-deleted="onListParamDeleted(param)"
data-go-to-statistics="goToStatistics"
data-is-delete-byoip-service-available="isDeleteByoipServiceAvailable"
>
<ip-list-header>
<div class="d-flex flex-column flex-lg-row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@
"ip_byoip_aggregate_slicing_not_available_error_message": "Aucune configuration de segmentation/agrégation disponible. Pour plus d’informations, veuillez consulter notre guide : <a href=\"{{ url }}\" target=\"_blank\" rel=\"noopener\">ici</a>",
"ip_byoip_aggregate_ip_doesnt_exist_error_message": "Une autre action de segmentation ou d'agrégation a été effectuée pour cette adresse IP.",
"ip_byoip_delete_block_title": "Supprimer le bloc",
"ip_byoip_delete_block_description": "Ce bloc d'IP fait partie d'un plus grand bloc BYOIP. Veuillez vous rendre sur <a href='{{ link }}'>mes services</a> et choisir `résilier` si vous souhaitez annuler votre service BYOIP",
"ip_byoip_delete_block_description_info1": "Ce bloc d'IP fait partie d'un plus grand bloc BYOIP. Veuillez vous rendre sur <a href='{{ link }}'>mes services</a> et choisir `résilier` si vous souhaitez annuler votre service BYOIP.",
"ip_byoip_delete_block_description_info2": "Ce bloc IP fait partie d'un plus grand bloc BYOIP. Veuillez utiliser l'API <a href=\"{{ link }}\" target=\"_blank\">(link)</a> si vous souhaitez annuler votre service BYOIP.",
"ip_edit_or_assosiate_description": "Cette section vous permet de personnaliser les informations publiques sur votre bloc IP (informations présentes sur la base whois).",
"ip_edit_or_assosiate_title": "Voir/Modifier les informations sur le bloc IP",
"ip_edit_or_assosiate_network_tab": "Réseau",
Expand Down

0 comments on commit 7807f50

Please sign in to comment.