Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export const CATEGORIES_MAP = {
'hosting-performance-2': 'PERFORMANCE',
'hosting-performance-3': 'PERFORMANCE',
'hosting-performance-4': 'PERFORMANCE',
'hosting-free-100M': 'FREE_100M',
'hosting-starter': 'STARTER',
'hosting-startup': 'STARTUP',
'hosting-agency': 'AGENCY',
'hosting-agency-plus': 'AGENCY_PLUS',
'hosting-agency-max': 'AGENCY_MAX',
};

export const CLOUDWEB_OFFER = ['cloudweb1', 'cloudweb2', 'cloudweb3'];
Expand All @@ -30,6 +36,12 @@ export const VERSION_MAP = {
'hosting-performance-2': 'PERFORMANCE_2',
'hosting-performance-3': 'PERFORMANCE_3',
'hosting-performance-4': 'PERFORMANCE_4',
'hosting-free-100M': 'FREE_100M',
'hosting-starter': 'STARTER',
'hosting-startup': 'STARTUP',
'hosting-agency': 'AGENCY',
'hosting-agency-plus': 'AGENCY_PLUS',
'hosting-agency-max': 'AGENCY_MAX',
};

export const BADGES = {
Expand All @@ -47,6 +59,18 @@ export const NEW_OFFERS_PLAN_CODES = {
PERFORMANCE_4: 'hosting-performance-4',
};

export const OFFERS_PLAN_CODES = {
FREE_100M: 'hosting-free-100M',
STARTER: 'hosting-starter',
PERSO: 'hosting-perso',
STARTUP: 'hosting-startup',
PRO: 'hosting-pro',
PERFORMANCE_1: 'hosting-performance-1',
AGENCY: 'hosting-agency',
AGENCY_PLUS: 'hosting-agency-plus',
AGENCY_MAX: 'hosting-agency-max',
};

export const WEB_CLOUD_DB_VALUES = '512MB RAM - 8GB';

export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
NEW_OFFERS_END_DATE,
BADGES,
NEW_OFFERS_PLAN_CODES,
OFFERS_PLAN_CODES,
CATEGORIES_MAP,
VERSION_MAP,
CLOUDWEB_OFFER,
Expand All @@ -15,10 +16,174 @@ import {

export default class WebComponentsHostingDomainOffersController {
/* @ngInject */
constructor($translate, $filter) {
constructor($translate, $filter, ovhFeatureFlipping) {
this.$translate = $translate;
this.ovhFeatureFlipping = ovhFeatureFlipping;
const bytes = $filter('bytes');

this.OFFERS = {
FREE_100M: {
TECHNICALS: [
{ prefix: 'sites', values: [1] },
{ prefix: 'disk', values: ['100 Mo SSD'] },
{ prefix: 'emailStorage', values: [1, '5 Go'] },
],
SELECTORS: {
FREE_100M: {
planCode: OFFERS_PLAN_CODES.FREE_100M,
},
},
},
STARTER: {
TECHNICALS: [
{ prefix: 'sites', values: [1] },
{ prefix: 'nddFree', values: [1] },
{ prefix: 'emailStorage', values: [2, '5 Go'] },
{ prefix: 'disk', values: ['1 Go SSD'] },
{ prefix: 'cms', values: [] },
],
SELECTORS: {
STARTER: {
planCode: OFFERS_PLAN_CODES.STARTER,
},
},
},
PERSO: {
TECHNICALS: [
{ prefix: 'sites', values: [5] },
{ prefix: 'nddFree', values: [1] },
{ prefix: 'emailStorage', values: [10, '5 Go'] },
{ prefix: 'disk', values: ['100 Go SSD'] },
{ prefix: 'cms', values: [] },
],
SELECTORS: {
PERSO: {
planCode: OFFERS_PLAN_CODES.PERSO,
},
},
},
STARTUP: {
TECHNICALS: [
{ prefix: 'vcores', values: ['< 1'] },
{ prefix: 'ram', values: ['< 1 Go'] },
{ prefix: 'backupIncluded', values: [] },
{ prefix: 'uptime', values: ['99,9%'] },
{ prefix: 'disk', values: ['100 Go SSD'] },
{ prefix: 'sites', values: [5] },
{ prefix: 'emailStorage', values: [10, '5 Go'] },
{ prefix: 'dbs', values: [5, '1 Go'] },
{ prefix: 'nddFree', values: [1] },
],
SELECTORS: {
STARTUP: {
planCode: OFFERS_PLAN_CODES.STARTUP,
},
},
},
PRO: {
TECHNICALS: [
{ prefix: 'vcores', values: [1] },
{ prefix: 'ram', values: ['2 Go'] },
{ prefix: 'backupIncluded', values: [] },
{ prefix: 'uptime', values: ['99,9%'] },
{ prefix: 'disk', values: ['250 Go SSD'] },
{ prefix: 'sites', values: [100] },
{ prefix: 'emailStorage', values: [100, '5 Go'] },
{ prefix: 'dbs', values: [10, '2 Go'] },
{ prefix: 'nddFree', values: [1] },
{ prefix: 'cdn', values: [] },
],
SELECTORS: {
PRO: {
planCode: OFFERS_PLAN_CODES.PRO,
},
},
},
PERFORMANCE: {
TECHNICALS: [
{ prefix: 'vcores', values: [2] },
{ prefix: 'ram', values: ['4 Go'] },
{ prefix: 'backupIncluded', values: [] },
{ prefix: 'uptime', values: ['99,9%'] },
{ prefix: 'disk', values: ['500 Go'] },
{ prefix: 'sites', values: [150] },
{ prefix: 'emailStorage', values: [1000, '5 Go'] },
{ prefix: 'dbs', values: [20, '2 Go'] },
{ prefix: 'webcloudDb', values: [] },
{ prefix: 'nddFree', values: [1] },
{ prefix: 'cdn', values: [] },
],
SELECTORS: {
PERFORMANCE_1: {
planCode: OFFERS_PLAN_CODES.PERFORMANCE_1,
},
},
},
AGENCY: {
TECHNICALS: [
{ prefix: 'sites', values: [200] },
{ prefix: 'disk', values: ['500 Go SSD'] },
{ prefix: 'ram', values: ['8 Go'] },
{ prefix: 'vcores', values: [6] },
{ prefix: 'backupIncluded', values: [] },
{ prefix: 'uptime', values: ['99,9%'] },
{ prefix: 'userManagement', values: [] },
{ prefix: 'emailStorage', values: [1000, '5 Go'] },
{ prefix: 'dbs', values: [30, '2 Go'] },
{ prefix: 'webcloudDb', values: [] },
{ prefix: 'cdn', values: [] },
{ prefix: 'git', values: [] },
],
SELECTORS: {
AGENCY: {
planCode: OFFERS_PLAN_CODES.AGENCY,
},
},
},
AGENCY_PLUS: {
TECHNICALS: [
{ prefix: 'sites', values: [500] },
{ prefix: 'disk', values: ['700 Go SSD'] },
{ prefix: 'ram', values: ['12 Go'] },
{ prefix: 'vcores', values: [10] },
{ prefix: 'backupIncluded', values: [] },
{ prefix: 'uptime', values: ['99,9%'] },
{ prefix: 'userManagement', values: [] },
{ prefix: 'emailStorage', values: [1000, '5 Go'] },
{ prefix: 'dbs', values: [40, '2 Go'] },
{ prefix: 'webcloudDb', values: [] },
{ prefix: 'cdn', values: [] },
{ prefix: 'git', values: [] },
],
SELECTORS: {
AGENCY_PLUS: {
planCode: OFFERS_PLAN_CODES.AGENCY_PLUS,
},
},
},
AGENCY_MAX: {
TECHNICALS: [
{ prefix: 'sites', values: [3000] },
{ prefix: 'disk', values: ['1 To SSD'] },
{ prefix: 'ram', values: ['16 Go'] },
{ prefix: 'vcores', values: [14] },
{ prefix: 'backupIncluded', values: [] },
{ prefix: 'uptime', values: ['99,9%'] },
{ prefix: 'userManagement', values: [] },
{ prefix: 'emailStorage', values: [1000, '5 Go'] },
{ prefix: 'dbs', values: [50, '2 Go'] },
{ prefix: 'webcloudDb', values: [] },
{ prefix: 'cdn', values: [] },
{ prefix: 'git', values: [] },
],
SELECTORS: {
AGENCY_MAX: {
planCode: OFFERS_PLAN_CODES.AGENCY_MAX,
},
},
},
};

this.NEW_OFFERS = {
PERSO: {
TECHNICALS: [
Expand Down Expand Up @@ -89,7 +254,19 @@ export default class WebComponentsHostingDomainOffersController {
}

$onInit() {
this.groupedOffers = this.buildOffersGroup();
return this.ovhFeatureFlipping
.checkFeatureAvailability(['web-hosting:change-offer'])
.then((featureAvailability) => {
this.useNewOffers = featureAvailability.isFeatureAvailable(
'web-hosting:change-offer',
);
})
.catch(() => {
this.useNewOffers = false;
})
.finally(() => {
this.groupedOffers = this.buildOffersGroup();
});
}

static buildBadgeModel(type, className) {
Expand Down Expand Up @@ -193,7 +370,8 @@ export default class WebComponentsHostingDomainOffersController {
}

getNewOffer(offerCategory) {
return this.NEW_OFFERS[offerCategory.toUpperCase()];
const offers = this.useNewOffers ? this.OFFERS : this.NEW_OFFERS;
return offers[offerCategory.toUpperCase()];
}

getOfferTechnicalsInfo(offerCategory) {
Expand All @@ -202,10 +380,13 @@ export default class WebComponentsHostingDomainOffersController {
let serviceDatas = values[1];
if (prefix === 'services' && !serviceDatas)
serviceDatas = WEB_CLOUD_DB_VALUES;
return this.$translate.instant(
`web_components_hosting_domain_offers_offer_${offerCategory}_technicals_${prefix}`,
{ value1: values[0], value2: serviceDatas },
);
const key = this.useNewOffers
? `web_components_hosting_domain_offers_${prefix}`
: `web_components_hosting_domain_offers_offer_${offerCategory}_technicals_${prefix}`;
return this.$translate.instant(key, {
value1: values[0],
value2: serviceDatas,
});
},
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,22 @@
"web_components_hosting_domain_offers_offer_badge_current": "Derzeitiges Angebot",
"web_components_hosting_domain_offers_offer_select_version_placeholder": "Version auswählen",
"web_components_hosting_domain_offers_offer_select_version_performance": "{{coreNumber}} vCores, {{ramSize}} RAM",
"web_components_hosting_domain_offers_offer_price": "{{priceValue}} zzgl. MwSt./Monat"
}
"web_components_hosting_domain_offers_offer_price": "{{priceValue}} zzgl. MwSt./Monat",
"web_components_hosting_domain_offers_offer_agency": "Agentur",
"web_components_hosting_domain_offers_offer_agency_plus": "Agentur Plus",
"web_components_hosting_domain_offers_offer_agency_max": "Agentur Max",
"web_components_hosting_domain_offers_sites": "{{value1}} Seiten",
"web_components_hosting_domain_offers_disk": "{{value1}}",
"web_components_hosting_domain_offers_emailStorage": "{{value1}} E-Mails {{value2}}",
"web_components_hosting_domain_offers_cms": "CMS 1-Klick",
"web_components_hosting_domain_offers_nddFree": "{{value1}} NDD kostenlos",
"web_components_hosting_domain_offers_vcores": "{{value1}} vCore",
"web_components_hosting_domain_offers_ram": "{{value1}} RAM",
"web_components_hosting_domain_offers_backupIncluded": "Backup inklusive",
"web_components_hosting_domain_offers_uptime": "Uptime {{value1}}",
"web_components_hosting_domain_offers_dbs": "{{value1}} DB {{value2}}",
"web_components_hosting_domain_offers_webcloudDb": "WebCloud DB",
"web_components_hosting_domain_offers_cdn": "CDN",
"web_components_hosting_domain_offers_git": "GIT",
"web_components_hosting_domain_offers_userManagement": "Benutzerverwaltung"
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,22 @@
"web_components_hosting_domain_offers_offer_badge_current": "Current solution",
"web_components_hosting_domain_offers_offer_select_version_placeholder": "Choose a version",
"web_components_hosting_domain_offers_offer_select_version_performance": "{{coreNumber}} vCores, {{ramSize}} RAM",
"web_components_hosting_domain_offers_offer_price": "{{priceValue}} ex. VAT/month"
}
"web_components_hosting_domain_offers_offer_price": "{{priceValue}} ex. VAT/month",
"web_components_hosting_domain_offers_offer_agency": "Agency",
"web_components_hosting_domain_offers_offer_agency_plus": "Agency Plus",
"web_components_hosting_domain_offers_offer_agency_max": "Agency Max",
"web_components_hosting_domain_offers_sites": "{{value1}} Sites",
"web_components_hosting_domain_offers_disk": "{{value1}}",
"web_components_hosting_domain_offers_emailStorage": "{{value1}} emails {{value2}}",
"web_components_hosting_domain_offers_cms": "CMS 1click",
"web_components_hosting_domain_offers_nddFree": "{{value1}} free domain",
"web_components_hosting_domain_offers_vcores": "{{value1}} vCore",
"web_components_hosting_domain_offers_ram": "{{value1}} of RAM",
"web_components_hosting_domain_offers_backupIncluded": "Backup included",
"web_components_hosting_domain_offers_uptime": "Uptime {{value1}}",
"web_components_hosting_domain_offers_dbs": "{{value1}} database {{value2}}",
"web_components_hosting_domain_offers_webcloudDb": "WebCloud Database",
"web_components_hosting_domain_offers_cdn": "CDN",
"web_components_hosting_domain_offers_git": "GIT",
"web_components_hosting_domain_offers_userManagement": "User management"
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,22 @@
"web_components_hosting_domain_offers_offer_badge_current": "Producto actual",
"web_components_hosting_domain_offers_offer_select_version_placeholder": "Elegir una versión",
"web_components_hosting_domain_offers_offer_select_version_performance": "{{coreNumber}} vCores, {{ramSize}} RAM",
"web_components_hosting_domain_offers_offer_price": "{{priceValue}}/mes + IVA"
}
"web_components_hosting_domain_offers_offer_price": "{{priceValue}}/mes + IVA",
"web_components_hosting_domain_offers_offer_agency": "Agencia",
"web_components_hosting_domain_offers_offer_agency_plus": "Agencia más",
"web_components_hosting_domain_offers_offer_agency_max": "Agencia máxima",
"web_components_hosting_domain_offers_sites": "{{value1}} Sitios",
"web_components_hosting_domain_offers_disk": "{{value1}}",
"web_components_hosting_domain_offers_emailStorage": "{{value1}} correos {{value2}}",
"web_components_hosting_domain_offers_cms": "CMS 1clic",
"web_components_hosting_domain_offers_nddFree": "{{value1}} ndd gratis",
"web_components_hosting_domain_offers_vcores": "{{value1}} vCore",
"web_components_hosting_domain_offers_ram": "{{value1}} de RAM",
"web_components_hosting_domain_offers_backupIncluded": "Backup incluido",
"web_components_hosting_domain_offers_uptime": "Uptime {{value1}}",
"web_components_hosting_domain_offers_dbs": "{{value1}} db {{value2}}",
"web_components_hosting_domain_offers_webcloudDb": "WebCloud DB",
"web_components_hosting_domain_offers_cdn": "CDN",
"web_components_hosting_domain_offers_git": "GIT",
"web_components_hosting_domain_offers_userManagement": "Gestión de usuario"
}
Loading
Loading