Skip to content

Commit

Permalink
fix(web.hosting): fix wizard add multisite
Browse files Browse the repository at this point in the history
ref: MANAGER-11952

Signed-off-by: Guillaume Hyenne <[email protected]>
  • Loading branch information
ghyenne committed Jul 26, 2023
1 parent 46b533a commit 59b5d4b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ angular
'PRO',
'START',
])
.constant('HOSTING_NEW_OFFER_UPGRADES', [
'HOSTING_STARTER',
'HOSTING_STARTER_OVH',
'HOSTING_PERSO',
'HOSTING_PRO',
'HOSTING_PERFORMANCE_1',
'HOSTING_PERFORMANCE_2',
'HOSTING_PERFORMANCE_3',
'HOSTING_PERFORMANCE_4',
])
.constant('HOSTING_FLUSH_STATE', {
OK: 'ok',
CHECK: 'check',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import union from 'lodash/union';
WucConverterService,
HOSTING,
HOSTING_UPGRADES,
HOSTING_NEW_OFFER_UPGRADES,
HOSTING_OPERATION_STATUS,
DETACHABLE_PRODUCT_NAMES,
OvhHttp,
Expand All @@ -42,6 +43,7 @@ import union from 'lodash/union';
this.WucConverterService = WucConverterService;
this.HOSTING = HOSTING;
this.HOSTING_UPGRADES = HOSTING_UPGRADES;
this.HOSTING_NEW_OFFER_UPGRADES = HOSTING_NEW_OFFER_UPGRADES;
this.HOSTING_OPERATION_STATUS = HOSTING_OPERATION_STATUS;
this.DETACHABLE_PRODUCT_NAMES = DETACHABLE_PRODUCT_NAMES;
this.OvhHttp = OvhHttp;
Expand Down Expand Up @@ -491,9 +493,14 @@ import union from 'lodash/union';
* @param {string} offer
*/
getOfferCapabilities(offer) {
const formattedOffer = this.HOSTING_UPGRADES.includes(offer)
? offer
: replace(toLower(offer), /_/g, '');
let formattedOffer = '';
if (this.HOSTING_UPGRADES.includes(offer)) {
formattedOffer = offer;
} else if (this.HOSTING_NEW_OFFER_UPGRADES.includes(offer)) {
formattedOffer = replace(toLower(offer), /_/g, '-');
} else {
formattedOffer = replace(toLower(offer), /_/g, '');
}

return this.OvhHttp.get('/hosting/web/offerCapabilities', {
rootPath: 'apiv6',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@
data-wizard-step
data-wizard-step-on-load="loadStep2"
data-wizard-step-valid="model.step2Valid && !domainsAlreadyExists() && !domainIsNotValid() && isPathValid() && (selected.mode === model.mode.EXTERNAL || ((selected.ownLog === 'ACTIVE' && selected.ownLogDomain) || (!selected.ownLog || selected.ownLog === 'NONE')))"
data-ng-if="!model.needChangeOffer"
>
<div class="text-center" data-ng-if="model.domains == null">
<oui-spinner></oui-spinner>
Expand All @@ -160,7 +159,6 @@
data-wizard-step
data-wizard-step-on-load="loadStep3"
data-wizard-step-valid="!loading"
data-ng-if="!model.needChangeOffer"
>
<p
data-translate="hosting_tab_DOMAINS_configuration_add_step3_summary"
Expand Down

0 comments on commit 59b5d4b

Please sign in to comment.