-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref: MANAGER-15838 Signed-off-by: Nicolas Pierre-charles <[email protected]>
- Loading branch information
Nicolas Pierre-charles
committed
Jan 8, 2025
1 parent
8ed1c18
commit bd661ab
Showing
29 changed files
with
630 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
...es/manager-react-components/src/components/content/price/translations/Messages_fr_FR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/manager/apps/ips/public/translations/listing/Messages_fr_FR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"title": "Listing page", | ||
"listing_resultats": "résultats" | ||
"listing_resultats": "résultats", | ||
"orderIps": "Commander des IPs" | ||
} |
17 changes: 17 additions & 0 deletions
17
packages/manager/apps/ips/public/translations/order/Messages_fr_FR.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"title": "Commander des Additional IP", | ||
"back_link": "Retour à la page précédente", | ||
"ip_version_title": "Sélectionner la version de l'adresse IP", | ||
"ip_version_description": "Pour un certain nombre de cas, vous aurez peut-être besoin d'une IPv4 standard, la plus utilisée, ou d'une nouvelle version du protocole - l'IPv6. Veuillez noter que la liste des produits compatibles peut varier.", | ||
"ipv4_card_title": "IPv4", | ||
"ipv4_card_description": "Standard Internet (à partir d'aujourd'hui). Protocole d'adressage le plus couramment utilisé sur Internet, donc le plus couramment pris en charge.", | ||
"ipv6_card_title": "IPv6", | ||
"ipv6_card_badge_label": "beta", | ||
"ipv6_card_description": "Lorsque de grands blocs IP sont nécessaires et qu'un schéma d'adressage hiérarchique est défini, l'IPv6 est le meilleur choix. Assurez-vous que tous vos clients sont en mesure d'utiliser le nouveau protocole ainsi que vos services", | ||
"service_selection_title": "Sélectionnez le service pour lequel vous désirez acheter des Additional IP", | ||
"service_selection_select_label": "Service", | ||
"service_selection_select_placeholder": "Sélectionnez...", | ||
"service_selection_select_vrack_option_group_label": "Réseau Privé vRack", | ||
"region_selection_title": "Sélectionnez une région pour votre nouvelle Additional IP", | ||
"error_message": "Une erreur est survenue: {{error}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
85 changes: 85 additions & 0 deletions
85
packages/manager/apps/ips/src/components/OptionCard/OptionCard.component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import React from 'react'; | ||
import { | ||
IntervalUnitType, | ||
OvhSubsidiary, | ||
Price, | ||
} from '@ovh-ux/manager-react-components'; | ||
import { ShellContext } from '@ovh-ux/manager-react-shell-client'; | ||
import { | ||
ODS_CARD_COLOR, | ||
ODS_SPINNER_SIZE, | ||
ODS_TEXT_PRESET, | ||
} from '@ovhcloud/ods-components'; | ||
import { | ||
OdsCard, | ||
OdsDivider, | ||
OdsSpinner, | ||
OdsText, | ||
} from '@ovhcloud/ods-components/react'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
export const selectedBorderColor = '#0050D7'; | ||
|
||
export type OptionCardProps = { | ||
className?: string; | ||
isDisabled?: boolean; | ||
isSelected?: boolean; | ||
onClick?: () => void; | ||
title: React.ReactNode; | ||
description: string; | ||
price: number; | ||
}; | ||
|
||
export const OptionCard: React.FC<OptionCardProps> = ({ | ||
className, | ||
isDisabled, | ||
isSelected, | ||
onClick, | ||
title, | ||
description, | ||
price, | ||
}) => { | ||
const { environment } = React.useContext(ShellContext); | ||
const { t, i18n } = useTranslation(); | ||
const stateStyle = isDisabled | ||
? 'cursor-not-allowed bg-neutral-100' | ||
: 'cursor-pointer'; | ||
const color = isSelected ? ODS_CARD_COLOR.primary : ODS_CARD_COLOR.neutral; | ||
const borderStyle = isSelected | ||
? `border-[2px] border-[${selectedBorderColor}]` | ||
: 'm-[1px]'; | ||
return ( | ||
<OdsCard | ||
className={`flex flex-col p-3 ${stateStyle} ${borderStyle} ${className}`} | ||
onClick={() => !isDisabled && onClick?.()} | ||
color={color} | ||
> | ||
<OdsText | ||
className="flex justify-center mb-2" | ||
preset={ODS_TEXT_PRESET.heading4} | ||
> | ||
{title} | ||
</OdsText> | ||
<OdsText preset={ODS_TEXT_PRESET.paragraph}>{description}</OdsText> | ||
<OdsDivider className="block -ml-3 -mr-3 mt-auto mb-2" /> | ||
<OdsText | ||
preset={ODS_TEXT_PRESET.paragraph} | ||
className="flex justify-center" | ||
> | ||
{price === null ? ( | ||
<OdsSpinner size={ODS_SPINNER_SIZE.xs} /> | ||
) : ( | ||
<Price | ||
isStartingPrice | ||
suffix={t('per_ip')} | ||
value={price} | ||
tax={0} | ||
intervalUnit={IntervalUnitType.month} | ||
ovhSubsidiary={environment.user.ovhSubsidiary as OvhSubsidiary} | ||
locale={i18n.language} | ||
/> | ||
)} | ||
</OdsText> | ||
</OdsCard> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { ApiResponse, apiClient } from '@ovh-ux/manager-core-api'; | ||
import { CurrencyCode, OvhSubsidiary } from '@ovh-ux/manager-react-components'; | ||
|
||
export type CatalogIpPlan = { | ||
addonsFamily: unknown[]; | ||
consumptionBillingStrategy: string | null; | ||
details: { | ||
metadatas: { key: string; value: 'true' | 'false' }[]; | ||
pricings: { | ||
default: [ | ||
{ | ||
capacities: ('installation' | 'renew')[]; | ||
commitment: number; | ||
description: string; | ||
interval: number; | ||
intervalUnit: string; | ||
maximumQuantity: number; | ||
maximumRepeat: number; | ||
minimumQuantity: number; | ||
minimumRepeat: number; | ||
mustBeCompleted: boolean; | ||
price: { currencyCode: CurrencyCode; text: string; value: number }; | ||
priceCapInUcents: number | null; | ||
priceInUcents: number; | ||
pricingStrategy: string; | ||
}, | ||
]; | ||
}; | ||
product: { | ||
configurations: { | ||
defaultValue: string | null; | ||
isCustom: boolean; | ||
isMandatory: boolean; | ||
name: string; | ||
values: string[]; | ||
}[]; | ||
description: string; | ||
internalType: | ||
| 'cloud_service' | ||
| 'delivery' | ||
| 'deposit' | ||
| 'domain' | ||
| 'implementation_services' | ||
| 'saas_license' | ||
| 'shipping' | ||
| 'storage'; | ||
name: string; | ||
}; | ||
}; | ||
familyName?: string | null; | ||
invoiceName: string; | ||
planCode: string; | ||
pricingType: 'rental' | 'consumption'; | ||
}; | ||
|
||
export type CatalogIpsResponse = { | ||
catalogId: number; | ||
merchantCode: OvhSubsidiary; | ||
plans: CatalogIpPlan[]; | ||
}; | ||
|
||
export const getCatalogIps = ( | ||
sub: OvhSubsidiary = OvhSubsidiary.FR, | ||
): Promise<ApiResponse<CatalogIpsResponse>> => | ||
apiClient.v6.get(`/order/catalog/formatted/ip?ovhSubsidiary=${sub}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { ApiResponse, apiClient } from '@ovh-ux/manager-core-api'; | ||
|
||
export const getVrackList = (): Promise<ApiResponse<string[]>> => | ||
apiClient.v6.get('/vrack'); |
25 changes: 25 additions & 0 deletions
25
packages/manager/apps/ips/src/data/hooks/catalog.constant.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
export const IP_FAILOVER_PLANCODE = { | ||
EU: 'ip-failover-ripe', | ||
CA: 'ip-failover-arin', | ||
US: 'ip-failover-arin', | ||
}; | ||
|
||
export const DATACENTER_TO_REGION: { [datacenter: string]: string } = { | ||
RBX: 'eu-west-rbx', | ||
GRA: 'eu-west-gra', | ||
SBG: 'eu-west-sbg', | ||
PAR: 'eu-west-par', | ||
CR2: 'labeu-west-1-preprod', | ||
LIM: 'eu-west-lim', | ||
WAW: 'eu-central-waw', | ||
ERI: 'eu-west-eri', | ||
BHS: 'ca-east-bhs', | ||
YYZ: 'ca-east-tor', | ||
SGP: 'ap-southeast-sgp', | ||
SYD: 'ap-southeast-syd', | ||
YNM: 'ap-south-mum', | ||
VIN: 'us-east-vin', | ||
HIL: 'us-west-hil', | ||
}; | ||
|
||
export const getCatalogIpsQueryKey = (sub: string) => ['getCatalogIps', sub]; |
Oops, something went wrong.