-
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-15843 Signed-off-by: Nicolas Pierre-charles <[email protected]>
- Loading branch information
Nicolas Pierre-charles
committed
Jan 24, 2025
1 parent
743eae7
commit 7504dbd
Showing
23 changed files
with
445 additions
and
254 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
packages/manager-react-components/src/components/content/index.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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export * from './headers/headers.component'; | ||
export * from './price/price.component'; | ||
export * from './price/price.utils'; | ||
export * from './dashboard-tile/dashboard-tile.component'; | ||
export * from './dashboard-tile/tile-block.component'; |
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
2 changes: 0 additions & 2 deletions
2
packages/manager/apps/ips/public/translations/ips/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,6 +1,4 @@ | ||
{ | ||
"per_ip": "/IP", | ||
"per_ip_full": "par adresse IP", | ||
"breadcrumb_root_label": "Toutes les IPs", | ||
"order": "Commander une IP" | ||
} |
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
113 changes: 0 additions & 113 deletions
113
packages/manager/apps/ips/src/components/OfferCard/OfferCard.component.tsx
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/manager/apps/ips/src/components/OfferCard/offer-card.scss
This file was deleted.
Oops, something went wrong.
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
11 changes: 11 additions & 0 deletions
11
packages/manager/apps/ips/src/data/hooks/catalog/catalog.utils.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
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
58 changes: 58 additions & 0 deletions
58
packages/manager/apps/ips/src/data/hooks/useServiceList.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,58 @@ | ||
import { useQueries } from '@tanstack/react-query'; | ||
import { getVrackList } from '../api/vrack'; | ||
import { ServiceType } from '../api/ips'; | ||
|
||
export const ipParkingOptionValue = 'parking'; | ||
|
||
/** | ||
* Fetch the list of available services to order an additional IP | ||
*/ | ||
export const useServiceList = () => { | ||
const queries = useQueries({ | ||
queries: [ | ||
{ | ||
queryKey: ['dedicatedCloud'], | ||
queryFn: () => [], | ||
}, | ||
{ | ||
queryKey: ['server'], | ||
queryFn: () => [], | ||
}, | ||
{ | ||
queryKey: ['vps'], | ||
queryFn: () => [], | ||
}, | ||
{ | ||
queryKey: ['vrack'], | ||
queryFn: getVrackList, | ||
}, | ||
], | ||
}); | ||
|
||
return { | ||
getServiceType: (serviceId: string) => { | ||
if (serviceId === ipParkingOptionValue) { | ||
return ServiceType.ipParking; | ||
} | ||
if (queries[0]?.data?.includes(serviceId)) { | ||
return ServiceType.dedicatedCloud; | ||
} | ||
if (queries[1]?.data?.includes(serviceId)) { | ||
return ServiceType.server; | ||
} | ||
if (queries[2]?.data?.includes(serviceId)) { | ||
return ServiceType.vps; | ||
} | ||
return queries[3]?.data?.data?.includes(serviceId) | ||
? ServiceType.vrack | ||
: ServiceType.unknown; | ||
}, | ||
dedicatedCloud: queries[0]?.data, | ||
server: queries[1], | ||
vps: queries[2], | ||
vrack: queries[3]?.data?.data, | ||
isError: queries.some((query) => query.isError), | ||
error: queries.find((query) => query.error), | ||
isLoading: queries.some((query) => query.isLoading), | ||
}; | ||
}; |
Oops, something went wrong.