Skip to content

Commit

Permalink
fix(web): check dns zone availabilty (#9613)
Browse files Browse the repository at this point in the history
Check DNS Zone availability in Step 1
ref: DTRSD-115429

Signed-off-by: Anoop N <[email protected]>
  • Loading branch information
anooparveti authored Jul 28, 2023
1 parent 5bc514d commit 8075e98
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@ import { TEMPLATES } from '../../domain/zone/activate/activate.constants';

export default class newDnsZoneCtrl {
/* @ngInject */
constructor($translate, atInternet, Alerter, constants) {
constructor(
$anchorScroll,
$location,
$translate,
atInternet,
Alerter,
constants,
) {
this.$anchorScroll = $anchorScroll;
this.$location = $location;
this.$translate = $translate;
this.atInternet = atInternet;
this.Alerter = Alerter;
Expand Down Expand Up @@ -57,6 +66,10 @@ export default class newDnsZoneCtrl {
});
}

static getAlerterId(alerter) {
return alerter.replaceAll('.', '_');
}

getConfiguration() {
return map(this.configuration, (value, label) => ({
label,
Expand All @@ -75,9 +88,12 @@ export default class newDnsZoneCtrl {
}

onDnsOrderError(error) {
const message = error?.data?.message || error.message;
this.$location.hash(newDnsZoneCtrl.getAlerterId(this.alerts.main));
this.$anchorScroll();
return this.Alerter.error(
this.$translate.instant('domains_newdnszone_order_error', {
message: error.message,
message,
}),
this.alerts.main,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
</oui-guide-menu>
</oui-header>

<div data-ovh-alert="{{$ctrl.alerts.main}}"></div>
<div
data-ng-attr-id="{{:: $ctrl.constructor.getAlerterId($ctrl.alerts.main)}}"
data-ovh-alert="{{$ctrl.alerts.main}}"
></div>
<p data-translate="domains_newdnszone_order_example"></p>
<p class="font-italic" data-translate="domains_newdnszone_order_usage"></p>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default /* @ngInject */ ($stateProvider) => {
return promise;
},

isZoneValid: /* @ngInject */ () => () => Promise.resolve(true),
isZoneValid: /* @ngInject */ ($q) => () => $q.resolve(true),
breadcrumb: /* @ngInject */ ($translate) =>
$translate.instant('domains_newdnszone_order_title'),
},
Expand Down

0 comments on commit 8075e98

Please sign in to comment.