Skip to content

Commit

Permalink
feat(web-office): add modal order licenses
Browse files Browse the repository at this point in the history
ref:MANAGER-16712

Signed-off-by: stif59100 <steeve.vanderstocken@ovhcloud.com>
  • Loading branch information
stif59100 committed Jan 30, 2025
1 parent 112da57 commit fa8eb05
Show file tree
Hide file tree
Showing 29 changed files with 1,254 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
"common_field_error_minlength": "Veuillez saisir un minimum de {{minlength}} caractères.",
"common_field_error_maxlength": "Veuillez saisir un maximum de {{maxlength}} caractères.",
"common_field_error_pattern": "Veuillez saisir un format valide.",
"consumption": "Consommation",
"licences": "Licences",
"guides": "Consulter nos guides en ligne",
"users": "Utilisateurs",
"users_order_licenses": "Commander plus de licences",
"users_order_users": "Ajouter un utilisateur",
"users_delete": "Suppression d'un utilisateur",
"cta_cancel": "Annuler",
"cta_confirm": "Valider",
"common_field_error_password": "Mot de passe invalide",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@
"dashboard_users_status_unconfigured": "Non configuré",
"dashboard_users_action_user_change_password": "Changer le mot de passe",
"dashboard_users_action_user_edit": "Editer le compte",
"dashboard_users_action_user_delete": "Supprimer le compte",
"dashboard_users_order_button_licenses": "Commander plus de licences",
"dashboard_users_order_button_users": "Ajouter un utilisateur"
"dashboard_users_action_user_delete": "Supprimer le compte"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dashboard_users_order_licences_quantity": "Nombre",
"dashboard_users_order_licences_type": "Type de licence",
"dashboard_users_order_licences_message_1": "En validant vous serez redirigé vers le bon de commande.",
"dashboard_users_order_licences_message_2": "Revenez ici une fois le paiement effectué pour configurer vos nouveaux utilisateurs"
}
1 change: 1 addition & 0 deletions packages/manager/apps/web-office/src/api/_mock_/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './license';
export * from './user';
export * from './order';
99 changes: 99 additions & 0 deletions packages/manager/apps/web-office/src/api/_mock_/order.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import {
CurrencyCode,
IntervalUnitType,
OvhSubsidiary,
} from '@ovh-ux/manager-react-components';
import { order } from '@/api/order';

export const orderCatalogMock: order.publicOrder.Catalog = {
catalogId: 6185,
locale: {
currencyCode: CurrencyCode.EUR,
subsidiary: OvhSubsidiary.FR,
taxRate: 20,
},
plans: [
{
planCode: 'microsoft-365-apps-for-enterprise-pp-nce',
invoiceName: 'Microsoft 365 Apps for Enterprise',
addonFamilies: [],
product: 'officePrepaid',
pricingType: order.cart.GenericProductPricingTypeEnum.RENTAL,
consumptionConfiguration: null,
pricings: [
{
phase: 0,
capacities: [
order.cart.GenericProductPricingCapacitiesEnum.INSTALLATION,
order.cart.GenericProductPricingCapacitiesEnum.RENEW,
],
commitment: 0,
description: 'Microsoft 365 Apps for Enterprise',
interval: 1,
intervalUnit: IntervalUnitType.month,
quantity: {
min: 1,
max: null,
},
repeat: {
min: 1,
max: null,
},
price: 1705000000,
tax: 341000000,
mode: 'default',
strategy: order.cart.GenericProductPricingStrategyEnum.TIERED,
mustBeCompleted: false,
type: order.cart.GenericProductPricingTypeEnum.RENTAL,
promotions: [],
engagementConfiguration: null,
},
],
configurations: [],
family: null,
blobs: {
commercial: {
name: 'Microsoft 365',
price: {
precision: 2,
},
},
},
},
],
products: [
{
name: 'microsoft-365-apps-for-enterprise-pp-nce',
description: 'Microsoft 365 Apps for enterprise prepaid under NCE',
blobs: null,
configurations: [
{
name: 'zip_code',
isCustom: true,
isMandatory: false,
values: null,
},
{
name: 'country',
isCustom: true,
isMandatory: false,
values: null,
},
{
name: 'vat_number',
isCustom: true,
isMandatory: false,
values: null,
},
{
name: 'existing_tenant_service_name',
isCustom: true,
isMandatory: false,
values: null,
},
],
},
],
addons: [],
planFamilies: [],
};
18 changes: 18 additions & 0 deletions packages/manager/apps/web-office/src/api/order/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { v6 } from '@ovh-ux/manager-core-api';
import { OvhSubsidiary } from '@ovh-ux/manager-react-components';
import { order } from './type';

// GET

export const getOrderCatalog = async ({
ovhSubsidiary,
productName,
}: {
ovhSubsidiary: OvhSubsidiary;
productName: string;
}) => {
const { data } = await v6.get<order.publicOrder.Catalog>(
`/order/catalog/public/${productName}?ovhSubsidiary=${ovhSubsidiary}`,
);
return data;
};
4 changes: 4 additions & 0 deletions packages/manager/apps/web-office/src/api/order/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './api';
export * from './key';
export * from './type';
export * from './utils';
6 changes: 6 additions & 0 deletions packages/manager/apps/web-office/src/api/order/key.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { OvhSubsidiary } from '@ovh-ux/manager-react-components';

export const getOrderCatalogQueryKey = (
ovhSubsidiary: OvhSubsidiary,
productName: string,
) => ['get', 'order', 'catalog', productName, ovhSubsidiary];
Loading

0 comments on commit fa8eb05

Please sign in to comment.