Skip to content

Commit

Permalink
fix(hycu): express order URLs and edit pack parameters
Browse files Browse the repository at this point in the history
ref: MANAGER-15953

Signed-off-by: Thibaud Crespin <[email protected]>
  • Loading branch information
Thibaud Crespin authored and ThibaudCrespin committed Nov 7, 2024
1 parent 1e797df commit 146951f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/manager/apps/hycu/src/hooks/order/useOrderHYCU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ import { useMemo } from 'react';
interface HYCUOrder {
planCode: string;
region: OvhSubsidiary;
serviceName?: string;
}

const useOrderHYCU = ({ planCode, region }: HYCUOrder) => {
const useOrderHYCU = ({ planCode, region, serviceName = '' }: HYCUOrder) => {
const orderBaseUrl = useOrderURL('express_review_base');
const orderLink = useMemo(() => {
const HYCUProductSettings = getHYCUProductSettings({
planCode,
region,
serviceName,
});
if (planCode) return `${orderBaseUrl}?products=~(${HYCUProductSettings})`;
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default function EditPack() {
const { orderLink, redirectToOrder } = useOrderHYCU({
planCode: selectedPack,
region: subsidiary,
serviceName,
});

const header = {
Expand Down
11 changes: 7 additions & 4 deletions packages/manager/modules/order/src/order.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,15 @@ export const getVcdProductSettings = ({
export const getHYCUProductSettings = ({
planCode,
region,
serviceName = '',
}: {
planCode: string;
region: string;
serviceName?: string;
}) =>
JSURL.stringify({
productId: 'licenseHycu',
serviceName,
planCode,
duration: 'P1M',
pricingMode: 'default',
Expand Down Expand Up @@ -203,19 +206,19 @@ export const ORDER_URLS = {
TN: 'https://eco.ovhcloud.com/fr-tn/',
},
express_review_base: {
CZ: 'https://www.ovh.cz/order/express/#/express/review',
CZ: 'https://www.ovh.ie/order/express/#/express/review',
DE: 'https://www.ovh.de/order/express/#/express/review',
ES: 'https://www.ovh.es/order/express/#/express/review',
FI: 'https://www.ovh-hosting.fi/order/express/#/express/review',
FI: 'https://www.ovh.ie/order/express/#/express/review',
FR: 'https://www.ovh.com/fr/order/express/#/express/review',
GB: 'https://www.ovh.co.uk/order/express/#/express/review',
IE: 'https://www.ovh.ie/order/express/#/express/review',
IT: 'https://www.ovh.it/order/express/#/express/review',
LT: 'https://www.ovh.lt/order/express/#/express/review',
LT: 'https://www.ovh.ie/order/express/#/express/review',
NL: 'https://www.ovh.nl/order/express/#/express/review',
PL: 'https://www.ovh.pl/order/express/#/express/review',
PT: 'https://www.ovh.pt/order/express/#/express/review',
MA: 'https://www.ovh.ma/order/express/#/express/review',
MA: 'https://www.ovh.com/ma/order/express/#/express/review',
SN: 'https://www.ovh.sn/order/express/#/express/review',
TN: 'https://www.ovh.com/tn/order/express/#/express/review',
},
Expand Down

0 comments on commit 146951f

Please sign in to comment.