diff --git a/packages/manager/apps/hub/eslint.config.mjs b/packages/manager/apps/hub/eslint.config.mjs
new file mode 100644
index 000000000000..7c28ea25dd2f
--- /dev/null
+++ b/packages/manager/apps/hub/eslint.config.mjs
@@ -0,0 +1,54 @@
+// Full adoption
+/*import { eslintSharedConfig } from '@ovh-ux/manager-static-analysis-kit';
+
+export default eslintSharedConfig;
+*/
+
+// Progressive adoption
+// import { a11yEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/a11y';
+// import {
+// complexityJsxTsxConfig,
+// complexityTsJsConfig,
+// } from '@ovh-ux/manager-static-analysis-kit/eslint/complexity';
+// import { cssEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/css';
+import { htmlEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/html';
+// import { importEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/imports';
+import { javascriptEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/javascript';
+// import { checkFileEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/naming-conventions';
+import { prettierEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/prettier';
+// import { reactEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/react';
+import { tailwindJsxConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/tailwind-jsx';
+// import { tanStackQueryEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/tanstack';
+// import { vitestEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/tests';
+import { typescriptEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/typescript';
+// import { storybookEslintConfig } from '@ovh-ux/manager-static-analysis-kit/eslint/storybook';
+
+// Progressive and disable full rules
+export default [
+ {
+ ...typescriptEslintConfig,
+ rules: {
+ ...typescriptEslintConfig.rules,
+ '@typescript-eslint/no-unnecessary-type-constraint': 'off',
+ '@typescript-eslint/no-unused-vars': 'off',
+ '@typescript-eslint/no-unsafe-return': 'off',
+ '@typescript-eslint/require-await': 'off',
+ '@typescript-eslint/no-unsafe-member-access': 'off',
+ '@typescript-eslint/no-misused-promises': 'off',
+ '@typescript-eslint/no-unsafe-enum-comparison': 'off',
+ '@typescript-eslint/no-unsafe-argument': 'off',
+ '@typescript-eslint/no-unsafe-assignment': 'off',
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off',
+ '@typescript-eslint/no-explicit-any': 'off',
+ '@typescript-eslint/no-floating-promises': 'off',
+ '@typescript-eslint/no-unsafe-call': 'off',
+ '@typescript-eslint/unbound-method': 'off',
+ '@typescript-eslint/no-redundant-type-constituents': 'off',
+ '@typescript-eslint/no-duplicate-type-constituents': 'off',
+ },
+ },
+ javascriptEslintConfig,
+ htmlEslintConfig,
+ tailwindJsxConfig,
+ prettierEslintConfig,
+];
diff --git a/packages/manager/apps/hub/package.json b/packages/manager/apps/hub/package.json
index 359a416c8a26..a2bcd483bf69 100644
--- a/packages/manager/apps/hub/package.json
+++ b/packages/manager/apps/hub/package.json
@@ -12,6 +12,9 @@
"author": "OVH SAS",
"scripts": {
"build": "tsc && vite build",
+ "build:strict": "tsc --project tsconfig.strict.json && vite build",
+ "lint:modern": "manager-lint --config eslint.config.mjs ./src",
+ "lint:modern:fix": "manager-lint --fix --config eslint.config.mjs ./src",
"start": "vite",
"test": "manager-test run",
"test:watch": "manager-test watch"
@@ -42,6 +45,7 @@
},
"devDependencies": {
"@ovh-ux/manager-tailwind-config": "^0.5.5",
+ "@ovh-ux/manager-static-analysis-kit": "^0.11.0",
"@ovh-ux/manager-tests-setup": "^0.2.0",
"@ovh-ux/manager-vite-config": "^0.13.4",
"@tanstack/react-query-devtools": "^5.51.21",
diff --git a/packages/manager/apps/hub/src/App.tsx b/packages/manager/apps/hub/src/App.tsx
index 0fa1519f427c..6db6cc4abeee 100644
--- a/packages/manager/apps/hub/src/App.tsx
+++ b/packages/manager/apps/hub/src/App.tsx
@@ -1,14 +1,15 @@
import React, { Suspense } from 'react';
+
+import { RouterProvider, createHashRouter, createRoutesFromElements } from 'react-router-dom';
+
import { QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
+
import { odsSetup } from '@ovhcloud/ods-common-core';
-import {
- RouterProvider,
- createHashRouter,
- createRoutesFromElements,
-} from 'react-router-dom';
-import Routes from '@/routes/routes';
+
import queryClient from '@/queryClient';
+import Routes from '@/routes/routes';
+
import Loading from './components/Loading/Loading';
odsSetup();
diff --git a/packages/manager/apps/hub/src/__mocks__/ReactQueryWrapper.tsx b/packages/manager/apps/hub/src/__mocks__/ReactQueryWrapper.tsx
index 3f3d389854ce..6f137da5bd04 100644
--- a/packages/manager/apps/hub/src/__mocks__/ReactQueryWrapper.tsx
+++ b/packages/manager/apps/hub/src/__mocks__/ReactQueryWrapper.tsx
@@ -1,14 +1,13 @@
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { PropsWithChildren } from 'react';
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+
export function ReactQueryWrapper({
children,
client,
}: PropsWithChildren<{ client?: QueryClient }>) {
const queryClient = client ?? new QueryClient();
- return (
- {children}
- );
+ return {children};
}
export default ReactQueryWrapper;
diff --git a/packages/manager/apps/hub/src/__mocks__/ShellContextWrapper.tsx b/packages/manager/apps/hub/src/__mocks__/ShellContextWrapper.tsx
index c334cd73dc3c..522ea2ffe6d8 100644
--- a/packages/manager/apps/hub/src/__mocks__/ShellContextWrapper.tsx
+++ b/packages/manager/apps/hub/src/__mocks__/ShellContextWrapper.tsx
@@ -1,12 +1,10 @@
-/* eslint-disable import/no-extraneous-dependencies */
-import { vi } from 'vitest';
-import { render } from '@testing-library/react';
-/* eslint-enable import/no-extraneous-dependencies */
-import {
- ShellContext,
- ShellContextType,
-} from '@ovh-ux/manager-react-shell-client';
import { ReactNode } from 'react';
+
+import { render } from '@testing-library/react';
+import { vi } from 'vitest';
+
+import { ShellContext, ShellContextType } from '@ovh-ux/manager-react-shell-client';
+
import { deepMerge } from '@/utils/deepMerge';
const baseShellContext = {
diff --git a/packages/manager/apps/hub/src/__mocks__/billingServices.ts b/packages/manager/apps/hub/src/__mocks__/billingServices.ts
index ea37e8ff18b4..c7e33911fa9a 100644
--- a/packages/manager/apps/hub/src/__mocks__/billingServices.ts
+++ b/packages/manager/apps/hub/src/__mocks__/billingServices.ts
@@ -1,7 +1,4 @@
-import {
- HubBillingServices,
- BillingService,
-} from '@/billing/types/billingServices.type';
+import { BillingService, HubBillingServices } from '@/billing/types/billingServices.type';
const serviceResiliated = new BillingService({
canDeleteAtExpiration: false,
@@ -21,8 +18,7 @@ const serviceResiliated = new BillingService({
serviceId: 'serviceResiliated',
serviceType: 'HOSTING_WEB',
status: 'TERMINATED',
- url:
- 'https://www.ovh.com/manager/#/web/configuration/hosting/serviceResiliated',
+ url: 'https://www.ovh.com/manager/#/web/configuration/hosting/serviceResiliated',
});
const serviceWithManualRenewNotResiliatedWithoutDebt = new BillingService({
canDeleteAtExpiration: false,
@@ -42,8 +38,7 @@ const serviceWithManualRenewNotResiliatedWithoutDebt = new BillingService({
serviceId: 'serviceWithManualRenewNotResiliatedWithoutDebt',
serviceType: 'DOMAIN',
status: 'ACTIVE',
- url:
- 'https://www.ovh.com/manager/#/web/configuration/domain/serviceWithManualRenewNotResiliatedWithoutDebt/information',
+ url: 'https://www.ovh.com/manager/#/web/configuration/domain/serviceWithManualRenewNotResiliatedWithoutDebt/information',
});
const serviceOneShotWithoutResiliation = new BillingService({
canDeleteAtExpiration: false,
@@ -63,8 +58,7 @@ const serviceOneShotWithoutResiliation = new BillingService({
serviceId: 'serviceOneShotWithoutResiliation',
serviceType: 'DEDICATED_SERVER',
status: 'ACTIVE',
- url:
- 'https://www.ovh.com/manager/#/dedicated/server/serviceOneShotWithoutResiliation',
+ url: 'https://www.ovh.com/manager/#/dedicated/server/serviceOneShotWithoutResiliation',
});
const serviceWithoutUrlAndSuspendedBilling = new BillingService({
canDeleteAtExpiration: false,
@@ -104,8 +98,7 @@ const serviceInDebt = new BillingService({
serviceId: 'serviceOneShotWithoutResiliation',
serviceType: 'DEDICATED_SERVER',
status: 'PENDING_DEBT',
- url:
- 'https://www.ovh.com/manager/#/dedicated/server/serviceOneShotWithoutResiliation',
+ url: 'https://www.ovh.com/manager/#/dedicated/server/serviceOneShotWithoutResiliation',
});
const serviceWithAutomaticRenewNotResiliated = new BillingService({
canDeleteAtExpiration: false,
@@ -125,8 +118,7 @@ const serviceWithAutomaticRenewNotResiliated = new BillingService({
serviceId: 'serviceWithAutomaticRenewNotResiliated',
serviceType: 'HOSTING_WEB',
status: 'ACTIVE',
- url:
- 'https://www.ovh.com/manager/#/web/configuration/hosting/serviceWithAutomaticRenewNotResiliated',
+ url: 'https://www.ovh.com/manager/#/web/configuration/hosting/serviceWithAutomaticRenewNotResiliated',
});
export const NoServices: HubBillingServices = {
diff --git a/packages/manager/apps/hub/src/__mocks__/catalog.ts b/packages/manager/apps/hub/src/__mocks__/catalog.ts
index 962516a63d41..0c55f4fba9a9 100644
--- a/packages/manager/apps/hub/src/__mocks__/catalog.ts
+++ b/packages/manager/apps/hub/src/__mocks__/catalog.ts
@@ -1,13 +1,7 @@
export const catalogData = {
'Hosted Private Cloud': [
{
- categories: [
- 'Catalogs',
- 'Hosted Private Cloud',
- 'Platform',
- 'VMware',
- 'VMware on OVHcloud',
- ],
+ categories: ['Catalogs', 'Hosted Private Cloud', 'Platform', 'VMware', 'VMware on OVHcloud'],
category: 'Platform',
description:
'VMware on OVHcloud is a unique solution on the market, offering cloud scalability on a 100% dedicated hardware infrastructure. Your infrastructure virtualisation is powered by VMware technology, and entirely managed by OVHcloud. ',
@@ -16,20 +10,14 @@ export const catalogData = {
id: 20414,
lang: 'en_GB',
name: 'VMware on OVHcloud',
- order:
- 'https://www.ovhcloud.com/it/enterprise/products/hosted-private-cloud/prices/',
+ order: 'https://www.ovhcloud.com/it/enterprise/products/hosted-private-cloud/prices/',
productName: 'PRIVATE_CLOUD',
regionTags: ['EU', 'US', 'CA'],
universe: 'Hosted Private Cloud',
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Hosted Private Cloud',
- 'Platform',
- 'SAP HANA on Private Cloud',
- ],
+ categories: ['Catalogs', 'Hosted Private Cloud', 'Platform', 'SAP HANA on Private Cloud'],
category: 'Platform',
description:
'This new platform combines SAP HANA-certified HCI servers with our VMware on OVHcloud infrastructure. It enables secure hosting and effortless deployment of your most critical SAP environments in a sovereign cloud.',
@@ -95,12 +83,7 @@ export const catalogData = {
url: 'https://ovhcloud.com/en-gb/managed-bare-metal/',
},
{
- categories: [
- 'Catalogs',
- 'Bare Metal Cloud',
- 'Storage and Backup',
- 'Enterprise File Storage',
- ],
+ categories: ['Catalogs', 'Bare Metal Cloud', 'Storage and Backup', 'Enterprise File Storage'],
category: 'Storage and Backup',
description:
'Enterprise File Storage, powered by NetApp. Connect of all your OVHcloud solutions to a high-performance file storage service for your most critical business applications.',
@@ -113,20 +96,14 @@ export const catalogData = {
productName: 'NETAPP',
regionTags: ['EU', 'CA'],
universe: 'Bare Metal Cloud',
- url:
- 'https://ovhcloud.com/en-gb/storage-solutions/enterprise-file-storage/',
+ url: 'https://ovhcloud.com/en-gb/storage-solutions/enterprise-file-storage/',
},
],
};
export const rawCatalogData = [
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Storage and Backup',
- 'Block Storage',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Storage and Backup', 'Block Storage'],
category: 'Storage and Backup',
description:
'Create storage volumes, which can be used as additional disks and secured via triple replication for data.',
@@ -140,12 +117,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Storage and Backup',
- 'Cloud Archive',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Storage and Backup', 'Cloud Archive'],
category: 'Storage and Backup',
description:
'Archive your data over the long term in a cloud storage space, accessible via standard protocols.',
@@ -159,12 +131,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Data Analytics',
- 'Data Processing',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Data Analytics', 'Data Processing'],
category: 'Data Analytics',
description: 'Launch your Apache Spark processing tasks quickly and easily',
featureAvailability: 'data-processing',
@@ -178,12 +145,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Web Hosting & Domains',
- 'Email solutions',
- 'Email Pro',
- ],
+ categories: ['Catalogs', 'Web Hosting & Domains', 'Email solutions', 'Email Pro'],
category: 'Email solutions',
description:
'As the most comprehensive and widely-used business email solution on the market, Exchange offers many features — including contact, folder and calendar sharing, and email syncing.',
@@ -199,12 +161,7 @@ export const rawCatalogData = [
url: 'https://ovhcloud.com/en-gb/emails/email-pro/',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Storage and Backup',
- 'Instance Backup',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Storage and Backup', 'Instance Backup'],
category: 'Storage and Backup',
description: 'Get a backup service for your instances',
id: 20390,
@@ -217,12 +174,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Web Hosting & Domains',
- 'Collaborative Solutions',
- 'Microsoft 365',
- ],
+ categories: ['Catalogs', 'Web Hosting & Domains', 'Collaborative Solutions', 'Microsoft 365'],
category: 'Collaborative Solutions',
description:
'Securely access and edit your documents anytime, anywhere, so you can work however you work best. ',
@@ -276,12 +228,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Storage and Backup',
- 'Object Storage',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Storage and Backup', 'Object Storage'],
category: 'Storage and Backup',
description: 'Enjoy unlimited on-demand storage, accessible via S3 API.',
id: 20407,
@@ -294,13 +241,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Hosted Private Cloud',
- 'Platform',
- 'VMware',
- 'VMware on OVHcloud',
- ],
+ categories: ['Catalogs', 'Hosted Private Cloud', 'Platform', 'VMware', 'VMware on OVHcloud'],
category: 'Platform',
description:
'VMware on OVHcloud is a unique solution on the market, offering cloud scalability on a 100% dedicated hardware infrastructure. Your infrastructure virtualisation is powered by VMware technology, and entirely managed by OVHcloud. ',
@@ -309,20 +250,14 @@ export const rawCatalogData = [
id: 20414,
lang: 'en_GB',
name: 'VMware on OVHcloud',
- order:
- 'https://www.ovhcloud.com/it/enterprise/products/hosted-private-cloud/prices/',
+ order: 'https://www.ovhcloud.com/it/enterprise/products/hosted-private-cloud/prices/',
productName: 'PRIVATE_CLOUD',
regionTags: ['EU', 'US', 'CA'],
universe: 'Hosted Private Cloud',
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Web Hosting & Domains',
- 'Databases',
- 'Private SQL Databases',
- ],
+ categories: ['Catalogs', 'Web Hosting & Domains', 'Databases', 'Private SQL Databases'],
category: 'Databases',
description:
'Works perfectly alongside all of our OVHcloud products, e.g. VPS, dedicated servers, Public Cloud instances and Cloud Web hosting',
@@ -357,12 +292,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Web Hosting & Domains',
- 'Web Hosting options',
- 'Visibility Pro',
- ],
+ categories: ['Catalogs', 'Web Hosting & Domains', 'Web Hosting options', 'Visibility Pro'],
category: 'Web Hosting options',
description:
'Get your business on the map, wherever your customers are. Receive alerts, and reply quickly to customer reviews. Save time with an easy-to-use, centralised management interface.',
@@ -375,12 +305,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Storage and Backup',
- 'Volume Snapshot',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Storage and Backup', 'Volume Snapshot'],
category: 'Storage and Backup',
description: 'Trigger a snapshot on your Block Storage volumes',
id: 20426,
@@ -393,12 +318,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Containers and orchestration',
- 'Workflow Management',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Containers and orchestration', 'Workflow Management'],
category: 'Containers and orchestration',
description:
'Automate your tasks to operate cloud resources based on your business logic, and adapt them to suit any situation',
@@ -412,12 +332,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Hosted Private Cloud',
- 'Platform',
- 'Nutanix on OVHcloud',
- ],
+ categories: ['Catalogs', 'Hosted Private Cloud', 'Platform', 'Nutanix on OVHcloud'],
category: 'Platform',
description:
'The Nutanix on OVHcloud solution combines Nutanix Cloud Platform software licences with dedicated, Nutanix-qualified OVHcloud Hosted Private Cloud infrastructure — so you can pre-deploy a Nutanix hyperconverged environment (HCI) in just a few hours.',
@@ -448,8 +363,7 @@ export const rawCatalogData = [
{
categories: ['Catalogs', 'Public Cloud', 'Storage and Backup', 'Databases'],
category: 'Storage and Backup',
- description:
- 'Harness the power of your data by maintaining control of your resources.',
+ description: 'Harness the power of your data by maintaining control of your resources.',
featureAvailability: 'databases',
id: 20466,
lang: 'en_GB',
@@ -461,12 +375,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'AI & machine learning',
- 'AI Notebooks',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'AI & machine learning', 'AI Notebooks'],
category: 'AI & machine learning',
description:
'Get a quick, simple start launching your Jupyter or VS Code notebooks in the cloud',
@@ -481,12 +390,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'AI & machine learning',
- 'AI Training',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'AI & machine learning', 'AI Training'],
category: 'AI & machine learning',
description:
'Train your AI, machine learning and deep learning models efficiently and easily, and optimise your GPU usage.',
@@ -500,12 +404,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Management Interfaces',
- 'Horizon',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Management Interfaces', 'Horizon'],
category: 'Management Interfaces',
description:
'Use the original OpenStack web interface to effortlessly manage your cloud resources',
@@ -567,12 +466,7 @@ export const rawCatalogData = [
url: 'https://ovhcloud.com/en-gb/managed-bare-metal/',
},
{
- categories: [
- 'Catalogs',
- 'Bare Metal Cloud',
- 'Storage and Backup',
- 'Enterprise File Storage',
- ],
+ categories: ['Catalogs', 'Bare Metal Cloud', 'Storage and Backup', 'Enterprise File Storage'],
category: 'Storage and Backup',
description:
'Enterprise File Storage, powered by NetApp. Connect of all your OVHcloud solutions to a high-performance file storage service for your most critical business applications.',
@@ -585,8 +479,7 @@ export const rawCatalogData = [
productName: 'NETAPP',
regionTags: ['EU', 'CA'],
universe: 'Bare Metal Cloud',
- url:
- 'https://ovhcloud.com/en-gb/storage-solutions/enterprise-file-storage/',
+ url: 'https://ovhcloud.com/en-gb/storage-solutions/enterprise-file-storage/',
},
{
categories: ['Catalogs', 'Network', 'Network Services', 'Floating IP'],
@@ -604,12 +497,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Network',
- 'Network Services',
- 'OVHcloud Load Balancer',
- ],
+ categories: ['Catalogs', 'Network', 'Network Services', 'OVHcloud Load Balancer'],
category: 'Network Services',
description:
'Scale to meet your demand with any of our cloud solutions, in any of our datacentres. With the OVHcloud Load Balancer, you can balance the load between services spread across multiple datacentres.',
@@ -653,12 +541,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Hosted Private Cloud',
- 'Storage and Backup',
- 'Veeam Enterprise',
- ],
+ categories: ['Catalogs', 'Hosted Private Cloud', 'Storage and Backup', 'Veeam Enterprise'],
category: 'Storage and Backup',
description:
'Unlock the power of Veeam Backup & Replication. With OVHcloud, you can enjoy total freedom in terms of how you configure your backups once you have deployed your solution.',
@@ -673,12 +556,7 @@ export const rawCatalogData = [
url: 'https://ovhcloud.com/en-gb/storage-solutions/veeam-enterprise',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Data Analytics',
- 'Logs Data Platform',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Data Analytics', 'Logs Data Platform'],
category: 'Data Analytics',
description:
'Index and analyse logs in real time. Receive alerts if anything stops working. Share your data with your employees.',
@@ -721,12 +599,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Storage and Backup',
- 'Cold Archive',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Storage and Backup', 'Cold Archive'],
category: 'Storage and Backup',
description:
'Get our most cost-effective storage type for long-term data archiving on a tape storage infrastructure.',
@@ -740,12 +613,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'Storage and Backup',
- 'Volume Backup',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'Storage and Backup', 'Volume Backup'],
category: 'Storage and Backup',
description:
'Back up your Block Storage volumes. The backed-up data is stored on our Object Storage service.',
@@ -759,12 +627,7 @@ export const rawCatalogData = [
url: 'https://mockup.url.com',
},
{
- categories: [
- 'Catalogs',
- 'Public Cloud',
- 'AI & machine learning',
- 'AI Deploy',
- ],
+ categories: ['Catalogs', 'Public Cloud', 'AI & machine learning', 'AI Deploy'],
category: 'AI & machine learning',
description:
'Easily deploy machine learning models and applications to production, create your API access points effortlessly, and make effective predictions.',
@@ -778,12 +641,7 @@ export const rawCatalogData = [
url: 'https://www.ovhcloud.com/en-gb/public-cloud/ai-deploy/',
},
{
- categories: [
- 'Catalogs',
- 'Hosted Private Cloud',
- 'Platform',
- 'SAP HANA on Private Cloud',
- ],
+ categories: ['Catalogs', 'Hosted Private Cloud', 'Platform', 'SAP HANA on Private Cloud'],
category: 'Platform',
description:
'This new platform combines SAP HANA-certified HCI servers with our VMware on OVHcloud infrastructure. It enables secure hosting and effortless deployment of your most critical SAP environments in a sovereign cloud.',
@@ -806,8 +664,7 @@ export const rawCatalogData = [
'Kubernetes Load Balancer',
],
category: 'Containers and orchestration',
- description:
- 'Automatic distribution of traffic on the Managed Kubernetes Service',
+ description: 'Automatic distribution of traffic on the Managed Kubernetes Service',
featureAvailability: 'kubernetes',
id: 21763,
lang: 'en_GB',
diff --git a/packages/manager/apps/hub/src/__mocks__/products.ts b/packages/manager/apps/hub/src/__mocks__/products.ts
index 9f85e3aae862..155e42167b22 100644
--- a/packages/manager/apps/hub/src/__mocks__/products.ts
+++ b/packages/manager/apps/hub/src/__mocks__/products.ts
@@ -1,4 +1,4 @@
-import { ProductList, HubProduct } from '@/types/services.type';
+import { HubProduct, ProductList } from '@/types/services.type';
export const aFewProductsMocked: ProductList = {
count: 1,
@@ -27,8 +27,7 @@ export const aFewProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/displayName1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/displayName1',
},
],
},
@@ -62,8 +61,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_1',
},
{
propertyId: 'service',
@@ -86,8 +84,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_2',
},
{
propertyId: 'service',
@@ -110,8 +107,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_3',
},
],
},
@@ -139,8 +135,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/fakeName1',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/fakeName1',
},
{
propertyId: 'project_id',
@@ -163,8 +158,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-2',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-2',
},
{
propertyId: 'project_id',
@@ -187,8 +181,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-3',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-3',
},
{
propertyId: 'project_id',
@@ -211,8 +204,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-4',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-4',
},
{
propertyId: 'project_id',
@@ -235,8 +227,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-5',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-5',
},
{
propertyId: 'project_id',
@@ -259,8 +250,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-6',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-6',
},
{
propertyId: 'project_id',
@@ -283,8 +273,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-7',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-7',
},
{
propertyId: 'project_id',
@@ -307,8 +296,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-8',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-8',
},
],
},
@@ -457,8 +445,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-1',
},
{
propertyId: 'serviceName',
@@ -482,8 +469,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-2',
},
{
propertyId: 'serviceName',
@@ -507,8 +493,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-3',
},
{
propertyId: 'serviceName',
@@ -532,8 +517,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-4',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-4',
},
{
propertyId: 'serviceName',
@@ -557,8 +541,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-5',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-5',
},
{
propertyId: 'serviceName',
@@ -582,8 +565,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-6',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-6',
},
{
propertyId: 'serviceName',
@@ -607,8 +589,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-7',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-7',
},
{
propertyId: 'serviceName',
@@ -632,8 +613,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-8',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-8',
},
{
propertyId: 'serviceName',
@@ -657,8 +637,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-9',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-9',
},
],
},
@@ -682,8 +661,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/housing/dedicated_housing_1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/housing/dedicated_housing_1',
},
],
},
@@ -711,8 +689,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_1/partitions',
+ url: 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_1/partitions',
},
{
propertyId: 'serviceName',
@@ -735,8 +712,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_2/partitions',
+ url: 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_2/partitions',
},
],
},
@@ -764,8 +740,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_1',
},
{
propertyId: 'name',
@@ -788,8 +763,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_2',
},
{
propertyId: 'name',
@@ -812,8 +786,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_3',
},
{
propertyId: 'name',
@@ -836,8 +809,7 @@ export const lotsOfProductsMocked: ProductList = {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_4',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_4',
},
],
},
@@ -870,8 +842,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-1',
},
{
propertyId: 'serviceName',
@@ -895,8 +866,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-2',
},
{
propertyId: 'serviceName',
@@ -920,8 +890,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-3',
},
{
propertyId: 'serviceName',
@@ -945,8 +914,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-4',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-4',
},
],
type: 'DEDICATED_CLOUD',
@@ -977,8 +945,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/fakeName1',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/fakeName1',
},
{
propertyId: 'project_id',
@@ -1001,8 +968,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-2',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-2',
},
{
propertyId: 'project_id',
@@ -1025,8 +991,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-3',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-3',
},
{
propertyId: 'project_id',
@@ -1049,8 +1014,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-4',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-4',
},
],
type: 'CLOUD_PROJECT',
@@ -1181,8 +1145,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_1',
},
{
propertyId: 'name',
@@ -1205,8 +1168,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_2',
},
{
propertyId: 'name',
@@ -1229,8 +1191,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_3',
},
{
propertyId: 'name',
@@ -1253,8 +1214,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_4',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_4',
},
],
type: 'DEDICATED_SERVER',
@@ -1285,8 +1245,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_1',
},
{
propertyId: 'service',
@@ -1309,8 +1268,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_2',
},
{
propertyId: 'service',
@@ -1333,8 +1291,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_3',
},
],
type: 'CDN_DEDICATED',
@@ -1365,8 +1322,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_1/partitions',
+ url: 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_1/partitions',
},
{
propertyId: 'serviceName',
@@ -1389,8 +1345,7 @@ export const lotsOfProductsParsedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_2/partitions',
+ url: 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_2/partitions',
},
],
type: 'DEDICATED_NASHA',
@@ -1425,8 +1380,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-1',
},
{
propertyId: 'serviceName',
@@ -1450,8 +1404,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-2',
},
{
propertyId: 'serviceName',
@@ -1475,8 +1428,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-3',
},
{
propertyId: 'serviceName',
@@ -1500,8 +1452,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-4',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/dedicated_cloud/pcc-4',
},
],
type: 'DEDICATED_CLOUD',
@@ -1532,8 +1483,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/fakeName1',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/fakeName1',
},
{
propertyId: 'project_id',
@@ -1556,8 +1506,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-2',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-2',
},
{
propertyId: 'project_id',
@@ -1580,8 +1529,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-3',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-3',
},
{
propertyId: 'project_id',
@@ -1604,8 +1552,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'public-cloud',
US: 'public-cloud',
},
- url:
- 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-4',
+ url: 'https://www.ovh.com/manager/#/public-cloud/pci/projects/pci-project-4',
},
],
type: 'CLOUD_PROJECT',
@@ -1736,8 +1683,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_1',
},
{
propertyId: 'name',
@@ -1760,8 +1706,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_2',
},
{
propertyId: 'name',
@@ -1784,8 +1729,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_3',
},
{
propertyId: 'name',
@@ -1808,8 +1752,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_4',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/server/dedicated_server_4',
},
],
type: 'DEDICATED_SERVER',
@@ -1840,8 +1783,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_1',
},
{
propertyId: 'service',
@@ -1864,8 +1806,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_2',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_2',
},
{
propertyId: 'service',
@@ -1888,8 +1829,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_3',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/cdn/cdn_dedicated_3',
},
],
type: 'CDN_DEDICATED',
@@ -1920,8 +1860,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_1/partitions',
+ url: 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_1/partitions',
},
{
propertyId: 'serviceName',
@@ -1944,8 +1883,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_2/partitions',
+ url: 'https://www.ovh.com/manager/#/dedicated/paas/nasha/nasha_2/partitions',
},
],
type: 'DEDICATED_NASHA',
@@ -1972,8 +1910,7 @@ export const lotsOfProductsParsedExpandedMocked: HubProduct[] = [
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/housing/dedicated_housing_1',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/housing/dedicated_housing_1',
},
],
type: 'DEDICATED_HOUSING',
diff --git a/packages/manager/apps/hub/src/billing/components/billing-status/BillingStatus.component.tsx b/packages/manager/apps/hub/src/billing/components/billing-status/BillingStatus.component.tsx
index 065449484fa9..5e62b1c132e8 100644
--- a/packages/manager/apps/hub/src/billing/components/billing-status/BillingStatus.component.tsx
+++ b/packages/manager/apps/hub/src/billing/components/billing-status/BillingStatus.component.tsx
@@ -1,11 +1,13 @@
import { useTranslation } from 'react-i18next';
-import { ODS_CHIP_SIZE } from '@ovhcloud/ods-components';
-import { OsdsChip, OsdsText } from '@ovhcloud/ods-components/react';
+
import {
ODS_THEME_COLOR_INTENT,
ODS_THEME_TYPOGRAPHY_LEVEL,
ODS_THEME_TYPOGRAPHY_SIZE,
} from '@ovhcloud/ods-common-theming';
+import { ODS_CHIP_SIZE } from '@ovhcloud/ods-components';
+import { OsdsChip, OsdsText } from '@ovhcloud/ods-components/react';
+
import { BADGE_INTENT_BY_STATUS } from '@/billing/components/billing-status/BillingStatus.constants';
import { BillingService } from '@/billing/types/billingServices.type';
@@ -15,16 +17,11 @@ type BillingStatusProps = {
export default function BillingStatus({ service }: BillingStatusProps) {
const { t } = useTranslation('billing/status');
- const shouldHideAutoRenewStatus =
- service.isOneShot() || ['SMS'].includes(service.serviceType);
+ const shouldHideAutoRenewStatus = service.isOneShot() || ['SMS'].includes(service.serviceType);
return (
{service.hasDebt() && (
-
+
-}
{shouldHideAutoRenewStatus && service.isResiliated() && (
-
+
= {
+export const BADGE_INTENT_BY_STATUS: Record = {
auto: 'success',
automatic: 'success',
billing_suspended: 'info',
diff --git a/packages/manager/apps/hub/src/billing/components/services-actions/ServicesActions.component.tsx b/packages/manager/apps/hub/src/billing/components/services-actions/ServicesActions.component.tsx
index 619abe1181dc..ee011dd7e011 100644
--- a/packages/manager/apps/hub/src/billing/components/services-actions/ServicesActions.component.tsx
+++ b/packages/manager/apps/hub/src/billing/components/services-actions/ServicesActions.component.tsx
@@ -1,4 +1,6 @@
import React, { Suspense, useState } from 'react';
+
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
ODS_BUTTON_SIZE,
ODS_BUTTON_TYPE,
@@ -16,15 +18,12 @@ import {
OsdsPopoverContent,
OsdsSkeleton,
} from '@ovhcloud/ods-components/react';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
-import {
- ServiceAction,
- useServiceActions,
-} from '@/billing/hooks/useServiceActions';
-import { BillingService } from '@/billing/types/billingServices.type';
+
+import { SERVICE_TYPES_WITH_COMMITMENT } from '@/billing.constants';
+import { ServiceAction, useServiceActions } from '@/billing/hooks/useServiceActions';
import { useServiceLinks } from '@/billing/hooks/useServiceLinks';
+import { BillingService } from '@/billing/types/billingServices.type';
import { getPendingEngagement } from '@/data/api/billingServices';
-import { SERVICE_TYPES_WITH_COMMITMENT } from '@/billing.constants';
type ServicesActionsProps = {
service: BillingService;
@@ -40,15 +39,9 @@ export default function ServicesActions({
const [service, setService] = useState(initialService);
const links = useServiceLinks(service, autoRenewLink);
- const items: ServiceAction[] = useServiceActions(
- service,
- links,
- trackingPrefix,
- );
+ const items: ServiceAction[] = useServiceActions(service, links, trackingPrefix);
const shouldBeDisplayed =
- Boolean(autoRenewLink) ||
- service.canBeEngaged ||
- service.hasPendingEngagement;
+ Boolean(autoRenewLink) || service.canBeEngaged || service.hasPendingEngagement;
const onOpenPopOver = async () => {
if (
@@ -98,10 +91,7 @@ export default function ServicesActions({
{items.map((item, index) => {
const { disabled, external, ...link } = item;
return (
-
+
{index > 0 &&
}
{
trackAction('go-to-resiliate');
diff --git a/packages/manager/apps/hub/src/billing/hooks/useServiceLinks.tsx b/packages/manager/apps/hub/src/billing/hooks/useServiceLinks.tsx
index cad2a5c69a8f..6182ddfdf49b 100644
--- a/packages/manager/apps/hub/src/billing/hooks/useServiceLinks.tsx
+++ b/packages/manager/apps/hub/src/billing/hooks/useServiceLinks.tsx
@@ -1,13 +1,12 @@
import { useContext, useEffect, useState } from 'react';
+
import { ShellContext } from '@ovh-ux/manager-react-shell-client';
+
+import { RENEW_URL, SERVICE_TYPE } from '@/billing.constants';
import { BillingService } from '@/billing/types/billingServices.type';
import { ServiceLinks } from '@/billing/types/service-links.type';
-import { RENEW_URL, SERVICE_TYPE } from '@/billing.constants';
-export const useServiceLinks = (
- service: BillingService,
- autoRenewLink?: string,
-) => {
+export const useServiceLinks = (service: BillingService, autoRenewLink?: string) => {
const {
shell: { navigation },
environment: { user },
@@ -17,12 +16,8 @@ export const useServiceLinks = (
useEffect(() => {
const determineLinks = async () => {
const availableLinks: ServiceLinks = {};
- const serviceTypeParam = service.serviceType
- ? `&serviceType=${service.serviceType}`
- : '';
- const renewUrl = `${RENEW_URL[user.ovhSubsidiary] || RENEW_URL.default}${
- service.serviceId
- }`;
+ const serviceTypeParam = service.serviceType ? `&serviceType=${service.serviceType}` : '';
+ const renewUrl = `${RENEW_URL[user.ovhSubsidiary] || RENEW_URL.default}${service.serviceId}`;
const [organization, exchangeName] = service.serviceId.split('/service/');
// When we will fully migrate billing in React, we should add a possibility to give
// the cancelResiliation link (with an additional parameter in useServiceLinks)
@@ -50,11 +45,9 @@ export const useServiceLinks = (
)) as string;
break;
case SERVICE_TYPE.PACK_XDSL:
- resiliateLink = (await navigation.getURL(
- 'telecom',
- '#/pack/:serviceName',
- { serviceName: service.serviceId },
- )) as string;
+ resiliateLink = (await navigation.getURL('telecom', '#/pack/:serviceName', {
+ serviceName: service.serviceId,
+ })) as string;
break;
case SERVICE_TYPE.ALL_DOM:
resiliateLink = service.canResiliateByEndRule()
@@ -77,11 +70,7 @@ export const useServiceLinks = (
availableLinks.cancelCommitment = `${autoRenewLink}/${service.id}/cancel-commitment`;
}
- if (
- autoRenewLink &&
- service.hasDebt() &&
- !service.hasBillingRights(user.nichandle)
- ) {
+ if (autoRenewLink && service.hasDebt() && !service.hasBillingRights(user.nichandle)) {
availableLinks.warnBillingNic = `${autoRenewLink}/warn-nic?nic=${service.contactBilling}`;
}
if (service.hasDebt() && service.hasBillingRights(user.nichandle)) {
@@ -106,11 +95,7 @@ export const useServiceLinks = (
) {
availableLinks.configureRenewal = `${autoRenewLink}/update?serviceId=${service.serviceId}${serviceTypeParam}`;
}
- if (
- !service.hasManualRenew() &&
- !service.canBeEngaged &&
- !service.hasPendingEngagement
- ) {
+ if (!service.hasManualRenew() && !service.canBeEngaged && !service.hasPendingEngagement) {
availableLinks.anticipatePayment = renewUrl;
}
}
@@ -128,8 +113,9 @@ export const useServiceLinks = (
availableLinks.manageCommitment = `${autoRenewLink}/${service.id}/commitment`;
}
if (service.serviceType === SERVICE_TYPE.EXCHANGE) {
- const exchangeBillingLink = `${autoRenewLink}/exchange?organization=${organization}&exchangeName=${exchangeName ||
- service.serviceId}`;
+ const exchangeBillingLink = `${autoRenewLink}/exchange?organization=${organization}&exchangeName=${
+ exchangeName || service.serviceId
+ }`;
if (service.menuItems?.manageEmailAccountsInBilling) {
availableLinks.modifyExchangeBilling = exchangeBillingLink;
} else if (service.menuItems?.manageEmailAccountsInExchange) {
@@ -153,8 +139,7 @@ export const useServiceLinks = (
) {
if (
resiliateLink &&
- (service.hasAdminRights(user.auth.account) ||
- service.hasAdminRights(user.nichandle))
+ (service.hasAdminRights(user.auth.account) || service.hasAdminRights(user.nichandle))
) {
availableLinks.resiliate = resiliateLink;
}
@@ -180,8 +165,7 @@ export const useServiceLinks = (
}
if (
cancelResiliationLink &&
- (service.canBeUnresiliated(user.nichandle) ||
- service.canCancelResiliationByEndRule())
+ (service.canBeUnresiliated(user.nichandle) || service.canCancelResiliationByEndRule())
) {
availableLinks.cancelResiliation = cancelResiliationLink;
}
diff --git a/packages/manager/apps/hub/src/billing/types/billingServices.type.ts b/packages/manager/apps/hub/src/billing/types/billingServices.type.ts
index 4b8899ffa6ce..abb37039a27b 100644
--- a/packages/manager/apps/hub/src/billing/types/billingServices.type.ts
+++ b/packages/manager/apps/hub/src/billing/types/billingServices.type.ts
@@ -199,9 +199,7 @@ export class BillingService implements BillingServiceData {
}
isResiliated(): boolean {
- return (
- this.isExpired() || ['TERMINATED'].includes(this.status.toUpperCase())
- );
+ return this.isExpired() || ['TERMINATED'].includes(this.status.toUpperCase());
}
isExpired(): boolean {
@@ -231,9 +229,7 @@ export class BillingService implements BillingServiceData {
}
hasForcedRenew(): boolean {
- return (
- this.renew.forced && !this.shouldDeleteAtExpiration() && !this.isExpired()
- );
+ return this.renew.forced && !this.shouldDeleteAtExpiration() && !this.isExpired();
}
hasDebt(): boolean {
@@ -245,11 +241,7 @@ export class BillingService implements BillingServiceData {
}
hasPendingResiliation(): boolean {
- return (
- this.shouldDeleteAtExpiration() &&
- !this.hasManualRenew() &&
- !this.isResiliated()
- );
+ return this.shouldDeleteAtExpiration() && !this.hasManualRenew() && !this.isResiliated();
}
hasResiliationRights(nichandle: string) {
@@ -292,13 +284,9 @@ export class BillingService implements BillingServiceData {
}
hasParticularRenew() {
- return [
- 'EXCHANGE',
- 'EMAIL_EXCHANGE',
- 'SMS',
- 'EMAIL_DOMAIN',
- 'VEEAM_ENTERPRISE',
- ].includes(this.serviceType);
+ return ['EXCHANGE', 'EMAIL_EXCHANGE', 'SMS', 'EMAIL_DOMAIN', 'VEEAM_ENTERPRISE'].includes(
+ this.serviceType,
+ );
}
hasEngagement() {
@@ -314,9 +302,7 @@ export class BillingService implements BillingServiceData {
}
canCancelResiliationByEndRule() {
- return this.engagementDetails?.endRule?.possibleStrategies.includes(
- 'REACTIVATE_ENGAGEMENT',
- );
+ return this.engagementDetails?.endRule?.possibleStrategies.includes('REACTIVATE_ENGAGEMENT');
}
canResiliateByEndRule() {
diff --git a/packages/manager/apps/hub/src/changelog.constants.ts b/packages/manager/apps/hub/src/changelog.constants.ts
index bf541601bfbd..a96465c86e59 100644
--- a/packages/manager/apps/hub/src/changelog.constants.ts
+++ b/packages/manager/apps/hub/src/changelog.constants.ts
@@ -1,8 +1,4 @@
-import {
- ButtonType,
- PageLocation,
- TrackingClickParams,
-} from '@ovh-ux/manager-react-shell-client';
+import { ButtonType, PageLocation, TrackingClickParams } from '@ovh-ux/manager-react-shell-client';
interface ChangelogLinks {
url: string;
@@ -109,15 +105,12 @@ export const EXTERNAL_LINKS: Record = {
},
},
SECURITY_ROADMAP: {
- url:
- 'https://github.com/ovh/management-security-operations-roadmap/issues/new',
+ url: 'https://github.com/ovh/management-security-operations-roadmap/issues/new',
label_key: 'changelog_roadmap_security_label',
tracking: {
location: PageLocation.page,
buttonType: ButtonType.externalLink,
- actions: [
- `go-to-request-new-feature-security-identity-operations-solutions`,
- ],
+ actions: [`go-to-request-new-feature-security-identity-operations-solutions`],
actionType: 'action',
},
},
diff --git a/packages/manager/apps/hub/src/components/Loading/Loading.tsx b/packages/manager/apps/hub/src/components/Loading/Loading.tsx
index 8b7906bbf480..ee56927f658c 100644
--- a/packages/manager/apps/hub/src/components/Loading/Loading.tsx
+++ b/packages/manager/apps/hub/src/components/Loading/Loading.tsx
@@ -1,5 +1,5 @@
-import { OsdsSpinner } from '@ovhcloud/ods-components/react';
import { ODS_SPINNER_SIZE } from '@ovhcloud/ods-components';
+import { OsdsSpinner } from '@ovhcloud/ods-components/react';
export default function Loading() {
return (
diff --git a/packages/manager/apps/hub/src/components/banner/Banner.component.tsx b/packages/manager/apps/hub/src/components/banner/Banner.component.tsx
index 8f4d9f478fb1..4f98c01abcf7 100644
--- a/packages/manager/apps/hub/src/components/banner/Banner.component.tsx
+++ b/packages/manager/apps/hub/src/components/banner/Banner.component.tsx
@@ -1,13 +1,10 @@
import { useContext } from 'react';
-import {
- ShellContext,
- useOvhTracking,
-} from '@ovh-ux/manager-react-shell-client';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
import { OsdsLink } from '@ovhcloud/ods-components/react';
-import {
- OdsHTMLAnchorElementTarget,
- OdsHTMLAnchorElementRel,
-} from '@ovhcloud/ods-common-core';
+
+import { ShellContext, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import { useFetchHubBanner } from '@/data/hooks/banner/useBanner';
import { useHubContext } from '@/pages/dashboard/context';
@@ -29,9 +26,7 @@ export default function Banner() {
onClick={() => {
trackClick({
actionType: 'action',
- actions: banner.tracker
- ? banner.tracker.split('::')
- : DEFAULT_TRACKING,
+ actions: banner.tracker ? banner.tracker.split('::') : DEFAULT_TRACKING,
});
}}
href={banner.link}
diff --git a/packages/manager/apps/hub/src/components/banner/Banner.spec.tsx b/packages/manager/apps/hub/src/components/banner/Banner.spec.tsx
index 1168fdd8afa0..6cca9e11f572 100644
--- a/packages/manager/apps/hub/src/components/banner/Banner.spec.tsx
+++ b/packages/manager/apps/hub/src/components/banner/Banner.spec.tsx
@@ -1,12 +1,14 @@
-import { describe, expect, it, vi } from 'vitest';
-import { act, fireEvent } from '@testing-library/react';
import '@testing-library/jest-dom';
+import { act, fireEvent } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import { ShellContextType } from '@ovh-ux/manager-react-shell-client';
import * as reactShellClientModule from '@ovh-ux/manager-react-shell-client';
-import { useFetchHubBanner } from '@/data/hooks/banner/useBanner';
+
+import { renderWithShellContext } from '@/__mocks__/ShellContextWrapper';
import Banner from '@/components/banner/Banner.component';
+import { useFetchHubBanner } from '@/data/hooks/banner/useBanner';
import { Banner as TBanner } from '@/types/banner.type';
-import { renderWithShellContext } from '@/__mocks__/ShellContextWrapper';
let loading = true;
let banner: TBanner | null = null;
@@ -20,8 +22,7 @@ const shellContext = {
},
};
-const renderComponent = () =>
- renderWithShellContext(, shellContext as ShellContextType);
+const renderComponent = () => renderWithShellContext(, shellContext as ShellContextType);
vi.mock('@/data/hooks/banner/useBanner', () => ({
useFetchHubBanner: vi.fn(() => ({
diff --git a/packages/manager/apps/hub/src/components/hub-order-tracking/HubOrderTracking.component.tsx b/packages/manager/apps/hub/src/components/hub-order-tracking/HubOrderTracking.component.tsx
index d342e7c58724..145c2a257884 100644
--- a/packages/manager/apps/hub/src/components/hub-order-tracking/HubOrderTracking.component.tsx
+++ b/packages/manager/apps/hub/src/components/hub-order-tracking/HubOrderTracking.component.tsx
@@ -1,4 +1,20 @@
-import { lazy, Suspense, useContext, useMemo } from 'react';
+import { Suspense, lazy, useContext, useMemo } from 'react';
+
+import { Await } from 'react-router-dom';
+
+import { useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT, ODS_THEME_TYPOGRAPHY_LEVEL } from '@ovhcloud/ods-common-theming';
+import {
+ ODS_CHIP_SIZE,
+ ODS_ICON_NAME,
+ ODS_ICON_SIZE,
+ ODS_SKELETON_SIZE,
+ ODS_TEXT_COLOR_HUE,
+ ODS_TEXT_SIZE,
+ ODS_TILE_VARIANT,
+} from '@ovhcloud/ods-components';
import {
OsdsChip,
OsdsIcon,
@@ -7,43 +23,16 @@ import {
OsdsText,
OsdsTile,
} from '@ovhcloud/ods-components/react';
-import {
- ODS_TILE_VARIANT,
- ODS_CHIP_SIZE,
- ODS_ICON_NAME,
- ODS_TEXT_SIZE,
- ODS_ICON_SIZE,
- ODS_TEXT_COLOR_HUE,
- ODS_SKELETON_SIZE,
-} from '@ovhcloud/ods-components';
-import {
- ODS_THEME_COLOR_INTENT,
- ODS_THEME_TYPOGRAPHY_LEVEL,
-} from '@ovhcloud/ods-common-theming';
-import { useTranslation } from 'react-i18next';
-import {
- OdsHTMLAnchorElementRel,
- OdsHTMLAnchorElementTarget,
-} from '@ovhcloud/ods-common-core';
-import {
- ButtonType,
- ShellContext,
- useOvhTracking,
-} from '@ovh-ux/manager-react-shell-client';
-import { Await } from 'react-router-dom';
+
+import { ButtonType, ShellContext, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
+import { ERROR_STATUS, NOT_PAID, WAITING_PAYMENT_LABEL } from '@/data/api/order/order.constants';
import { useLastOrderTracking } from '@/data/hooks/lastOrderTracking/useLastOrderTracking';
-import {
- ERROR_STATUS,
- WAITING_PAYMENT_LABEL,
- NOT_PAID,
-} from '@/data/api/order/order.constants';
import useDateFormat from '@/hooks/dateFormat/useDateFormat';
-import { LastOrderTrackingResponse, OrderHistory } from '@/types/order.type';
import { useHubContext } from '@/pages/dashboard/context';
+import { LastOrderTrackingResponse, OrderHistory } from '@/types/order.type';
-const TileError = lazy(() =>
- import('@/components/tile-error/TileError.component'),
-);
+const TileError = lazy(() => import('@/components/tile-error/TileError.component'));
export default function HubOrderTracking() {
const { t } = useTranslation('hub/order');
@@ -59,12 +48,7 @@ export default function HubOrderTracking() {
const { trackClick } = useOvhTracking();
const orderTrackingLinkAsync = useMemo(
- () =>
- navigation.getURL(
- 'dedicated',
- `#/billing/order/${orderDataResponse?.orderId}`,
- {},
- ),
+ () => navigation.getURL('dedicated', `#/billing/order/${orderDataResponse?.orderId}`, {}),
[orderDataResponse?.orderId],
);
@@ -77,33 +61,25 @@ export default function HubOrderTracking() {
if (!orderData?.date || !orderData?.status) return undefined;
return {
date: orderData.date,
- label:
- orderData.status === 'delivered'
- ? 'INVOICE_IN_PROGRESS'
- : 'custom_creation',
+ label: orderData.status === 'delivered' ? 'INVOICE_IN_PROGRESS' : 'custom_creation',
};
};
const getLatestStatus = (history: OrderHistory[]) => {
return history.reduce((latest, item) => {
- return new Date(item.date).getTime() > new Date(latest.date).getTime()
- ? item
- : latest;
+ return new Date(item.date).getTime() > new Date(latest.date).getTime() ? item : latest;
});
};
const currentStatus = useMemo(() => {
if (!orderDataResponse || isLastOrderLoading) return undefined;
- if (!orderDataResponse.history?.length)
- return getInitialStatus(orderDataResponse);
+ if (!orderDataResponse.history?.length) return getInitialStatus(orderDataResponse);
return getLatestStatus(orderDataResponse.history);
}, [orderDataResponse, isLastOrderLoading]);
const displayedLabel = useMemo(() => {
if (!currentStatus) return undefined;
- return orderDataResponse?.status === NOT_PAID
- ? WAITING_PAYMENT_LABEL
- : currentStatus.label;
+ return orderDataResponse?.status === NOT_PAID ? WAITING_PAYMENT_LABEL : currentStatus.label;
}, [currentStatus, orderDataResponse?.status]);
const isWaitingPayment = displayedLabel === WAITING_PAYMENT_LABEL;
@@ -155,11 +131,7 @@ export default function HubOrderTracking() {
className="mb-6"
data-testid="order_info_skeleton"
>
-
+
>
) : (
<>
@@ -176,14 +148,8 @@ export default function HubOrderTracking() {
color={ODS_THEME_COLOR_INTENT.primary}
className="font-bold flex flex-col items-center justify-center mb-6 h-[40px]"
>
-
-
+
+
{t('hub_order_tracking_order_id', {
orderId: orderDataResponse.orderId,
})}
@@ -208,8 +174,7 @@ export default function HubOrderTracking() {
size={ODS_ICON_SIZE.xxs}
color={ODS_THEME_COLOR_INTENT.text}
name={
- !ERROR_STATUS.includes(displayedLabel) &&
- !isWaitingPayment
+ !ERROR_STATUS.includes(displayedLabel) && !isWaitingPayment
? ODS_ICON_NAME.OK
: ODS_ICON_NAME.CLOSE
}
@@ -241,9 +206,7 @@ export default function HubOrderTracking() {
>
)}
- {(error ||
- !orderDataResponse?.date ||
- !orderDataResponse?.status) && (
+ {(error || !orderDataResponse?.date || !orderDataResponse?.status) && (
({
}));
const renderComponent = (component: React.ReactNode) => {
- return render(
- {component},
- );
+ return render({component});
};
const trackClickMock = vi.fn();
@@ -148,17 +142,13 @@ describe('HubOrderTracking Component', async () => {
orderId: 231474541,
date: new Date().toISOString(),
status: 'notPaid',
- history: [
- { date: new Date().toISOString(), label: 'PAYMENT_INITIATED' },
- ],
+ history: [{ date: new Date().toISOString(), label: 'PAYMENT_INITIATED' }],
};
renderComponent();
await waitFor(() => {
- expect(
- screen.getByText('order_tracking_history_custom_payment_waiting'),
- ).toBeInTheDocument();
+ expect(screen.getByText('order_tracking_history_custom_payment_waiting')).toBeInTheDocument();
});
});
});
diff --git a/packages/manager/apps/hub/src/components/hub-support/HubSupport.component.tsx b/packages/manager/apps/hub/src/components/hub-support/HubSupport.component.tsx
index 6867c5b0f0c0..a185006f7a67 100644
--- a/packages/manager/apps/hub/src/components/hub-support/HubSupport.component.tsx
+++ b/packages/manager/apps/hub/src/components/hub-support/HubSupport.component.tsx
@@ -1,33 +1,26 @@
import React, { useContext, useEffect, useState } from 'react';
-import {
- OsdsChip,
- OsdsIcon,
- OsdsLink,
- OsdsText,
- OsdsTile,
-} from '@ovhcloud/ods-components/react';
-import {
- ODS_THEME_COLOR_INTENT,
- ODS_THEME_TYPOGRAPHY_LEVEL,
-} from '@ovhcloud/ods-common-theming';
+
+import { useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT, ODS_THEME_TYPOGRAPHY_LEVEL } from '@ovhcloud/ods-common-theming';
import {
ODS_CHIP_SIZE,
ODS_ICON_NAME,
ODS_ICON_SIZE,
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
-import { useTranslation } from 'react-i18next';
+import { OsdsChip, OsdsIcon, OsdsLink, OsdsText, OsdsTile } from '@ovhcloud/ods-components/react';
+
import { ShellContext } from '@ovh-ux/manager-react-shell-client';
-import {
- OdsHTMLAnchorElementRel,
- OdsHTMLAnchorElementTarget,
-} from '@ovhcloud/ods-common-core';
+
+import { Skeletons } from '@/components/skeletons/Skeletons.component';
import { useFetchHubSupport } from '@/data/hooks/apiHubSupport/useHubSupport';
+
+import TileError from '../tile-error/TileError.component';
import { SUPPORT_URLS } from './HubSupport.constants';
import { HubSupportHelp } from './hub-support-help/HubSupportHelp.component';
import { HubSupportTable } from './hub-support-table/HubSupportTable.component';
-import TileError from '../tile-error/TileError.component';
-import { Skeletons } from '@/components/skeletons/Skeletons.component';
export default function HubSupport() {
const { t } = useTranslation('hub/support');
@@ -58,11 +51,7 @@ export default function HubSupport() {
) : (
{error && (
-
+
)}
{!error && !data.count &&
}
{!error && !!data.count && (
@@ -76,10 +65,7 @@ export default function HubSupport() {
>
{t('hub_support_title')}
-
+
{data.count}
@@ -99,9 +85,7 @@ export default function HubSupport() {
? OdsHTMLAnchorElementTarget._blank
: OdsHTMLAnchorElementTarget._self
}
- rel={
- isEUOrCA ? OdsHTMLAnchorElementRel.noreferrer : undefined
- }
+ rel={isEUOrCA ? OdsHTMLAnchorElementRel.noreferrer : undefined}
color={ODS_THEME_COLOR_INTENT.primary}
className="font-bold text-right"
>
diff --git a/packages/manager/apps/hub/src/components/hub-support/HubSupport.spec.tsx b/packages/manager/apps/hub/src/components/hub-support/HubSupport.spec.tsx
index f17d55a170aa..78dd9a16d1db 100644
--- a/packages/manager/apps/hub/src/components/hub-support/HubSupport.spec.tsx
+++ b/packages/manager/apps/hub/src/components/hub-support/HubSupport.spec.tsx
@@ -1,14 +1,10 @@
import React from 'react';
-import {
- render,
- screen,
- fireEvent,
- act,
- waitFor,
-} from '@testing-library/react';
-import { describe, it, expect, vi } from 'vitest';
-import HubSupport from '@/components/hub-support/HubSupport.component';
+
import '@testing-library/jest-dom';
+import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
+import HubSupport from '@/components/hub-support/HubSupport.component';
import { Ticket } from '@/types/support.type';
const { refetch } = vi.hoisted(() => {
diff --git a/packages/manager/apps/hub/src/components/hub-support/hub-support-help/HubSupportHelp.component.tsx b/packages/manager/apps/hub/src/components/hub-support/hub-support-help/HubSupportHelp.component.tsx
index d21821514fab..e5e827d89a44 100644
--- a/packages/manager/apps/hub/src/components/hub-support/hub-support-help/HubSupportHelp.component.tsx
+++ b/packages/manager/apps/hub/src/components/hub-support/hub-support-help/HubSupportHelp.component.tsx
@@ -1,14 +1,16 @@
import React, { FunctionComponent } from 'react';
-import { OsdsLink, OsdsText } from '@ovhcloud/ods-components/react';
-import {
- ODS_THEME_COLOR_INTENT,
- ODS_THEME_TYPOGRAPHY_LEVEL,
-} from '@ovhcloud/ods-common-theming';
-import { ODS_TEXT_SIZE } from '@ovhcloud/ods-components';
+
import { useTranslation } from 'react-i18next';
+
import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT, ODS_THEME_TYPOGRAPHY_LEVEL } from '@ovhcloud/ods-common-theming';
+import { ODS_TEXT_SIZE } from '@ovhcloud/ods-components';
+import { OsdsLink, OsdsText } from '@ovhcloud/ods-components/react';
+
import { ButtonType, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import useGuideUtils from '@/hooks/guideUtils/useGuideUtils';
+
import assistance from '../assets/assistance.png';
export const HubSupportHelp: FunctionComponent = () => {
diff --git a/packages/manager/apps/hub/src/components/hub-support/hub-support-help/HubSupportHelp.spec.tsx b/packages/manager/apps/hub/src/components/hub-support/hub-support-help/HubSupportHelp.spec.tsx
index adf929491465..72b3df4f95e9 100644
--- a/packages/manager/apps/hub/src/components/hub-support/hub-support-help/HubSupportHelp.spec.tsx
+++ b/packages/manager/apps/hub/src/components/hub-support/hub-support-help/HubSupportHelp.spec.tsx
@@ -1,7 +1,9 @@
import React from 'react';
-import { render, screen, fireEvent, act } from '@testing-library/react';
-import { describe, it, expect, vi } from 'vitest';
+
import '@testing-library/jest-dom';
+import { act, fireEvent, render, screen } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import { HubSupportHelp } from './HubSupportHelp.component';
vi.mock('@/hooks/guideUtils/useGuideUtils', () => ({
@@ -30,9 +32,7 @@ describe('HubSupportHelp Component', () => {
it('renders the correct help URL', () => {
render(
);
- const linkElement = screen
- .getByText('hub_support_help')
- .closest('osds-link');
+ const linkElement = screen.getByText('hub_support_help').closest('osds-link');
expect(linkElement).toHaveAttribute('href', 'https://docs.ovh.com/fr/');
expect(linkElement).toHaveAttribute('target', '_blank');
});
diff --git a/packages/manager/apps/hub/src/components/hub-support/hub-support-table/HubSupportTable.component.tsx b/packages/manager/apps/hub/src/components/hub-support/hub-support-table/HubSupportTable.component.tsx
index b5bb488b3d78..e2ea2cc4d20b 100644
--- a/packages/manager/apps/hub/src/components/hub-support/hub-support-table/HubSupportTable.component.tsx
+++ b/packages/manager/apps/hub/src/components/hub-support/hub-support-table/HubSupportTable.component.tsx
@@ -1,6 +1,9 @@
-import { OsdsTable } from '@ovhcloud/ods-components/react';
import React, { FunctionComponent } from 'react';
+
+import { OsdsTable } from '@ovhcloud/ods-components/react';
+
import { Ticket } from '@/types/support.type';
+
import { MAX_TICKETS_TO_DISPLAY } from '../HubSupport.constants';
import { HubSupportTableItem } from './hub-support-table-item/HubSupportTableItem.component';
@@ -16,10 +19,7 @@ export const HubSupportTable: FunctionComponent
= ({ tickets }) => {
{limitedTickets.map((ticketItem) => (
-
+
))}
diff --git a/packages/manager/apps/hub/src/components/hub-support/hub-support-table/HubSupportTable.spec.tsx b/packages/manager/apps/hub/src/components/hub-support/hub-support-table/HubSupportTable.spec.tsx
index 63f196d8c213..59e659100c28 100644
--- a/packages/manager/apps/hub/src/components/hub-support/hub-support-table/HubSupportTable.spec.tsx
+++ b/packages/manager/apps/hub/src/components/hub-support/hub-support-table/HubSupportTable.spec.tsx
@@ -1,8 +1,11 @@
import React from 'react';
-import { render, screen } from '@testing-library/react';
-import { describe, it, expect, vi } from 'vitest';
+
import '@testing-library/jest-dom';
+import { render, screen } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import { Ticket } from '@/types/support.type';
+
import { HubSupportTable } from './HubSupportTable.component';
vi.mock('./hub-support-table-item/HubSupportTableItem.component', () => ({
diff --git a/packages/manager/apps/hub/src/components/hub-support/hub-support-table/hub-support-table-item/HubSupportTableItem.component.tsx b/packages/manager/apps/hub/src/components/hub-support/hub-support-table/hub-support-table-item/HubSupportTableItem.component.tsx
index fc3c6be2b228..9ad84b9de38e 100644
--- a/packages/manager/apps/hub/src/components/hub-support/hub-support-table/hub-support-table-item/HubSupportTableItem.component.tsx
+++ b/packages/manager/apps/hub/src/components/hub-support/hub-support-table/hub-support-table-item/HubSupportTableItem.component.tsx
@@ -1,25 +1,21 @@
-import { OsdsChip, OsdsLink } from '@ovhcloud/ods-components/react';
-import React, {
- FunctionComponent,
- useContext,
- useEffect,
- useMemo,
- useState,
-} from 'react';
+import React, { FunctionComponent, useContext, useEffect, useMemo, useState } from 'react';
+
+import { useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import { ODS_CHIP_SIZE } from '@ovhcloud/ods-components';
-import { useTranslation } from 'react-i18next';
+import { OsdsChip, OsdsLink } from '@ovhcloud/ods-components/react';
+
import {
ButtonType,
PageLocation,
ShellContext,
useOvhTracking,
} from '@ovh-ux/manager-react-shell-client';
-import {
- OdsHTMLAnchorElementRel,
- OdsHTMLAnchorElementTarget,
-} from '@ovhcloud/ods-common-core';
+
import { Ticket } from '@/types/support.type';
+
import { SUPPORT_URLS } from '../../HubSupport.constants';
type Props = {
@@ -60,8 +56,7 @@ export const HubSupportTableItem: FunctionComponent = ({ ticket }) => {
useEffect(() => {
(async () => {
const linkResult: string = isEUOrCA
- ? SUPPORT_URLS.viewTicket.replace('{ticketId}', ticket.ticketId) +
- ovhSubsidiary
+ ? SUPPORT_URLS.viewTicket.replace('{ticketId}', ticket.ticketId) + ovhSubsidiary
: ((await navigation.getURL(
'dedicated',
`#/support/tickets/${ticket.ticketId}`,
@@ -96,11 +91,7 @@ export const HubSupportTableItem: FunctionComponent = ({ ticket }) => {
{
expect(screen.getByText(mockTicket.subject)).toBeInTheDocument();
expect(screen.getByText('hub_support_state_open')).toBeInTheDocument();
await screen.findByText('hub_support_read');
- const osdsLinkElement = screen
- .getByText('hub_support_read')
- .closest('osds-link');
+ const osdsLinkElement = screen.getByText('hub_support_read').closest('osds-link');
expect(osdsLinkElement).toHaveAttribute(
'href',
'https://help.ovhcloud.com/csm?id=csm_ticket&table=sn_customerservice_case&number=CS123&view=csp&ovhSubsidiary=FR',
@@ -75,9 +71,7 @@ describe('HubSupportTableItem Component', () => {
await screen.findByText('hub_support_read');
await waitFor(() => {
- const osdsLinkElement = screen
- .getByText('hub_support_read')
- .closest('osds-link');
+ const osdsLinkElement = screen.getByText('hub_support_read').closest('osds-link');
expect(osdsLinkElement).toHaveAttribute('href', 'mocked-url');
expect(osdsLinkElement).toHaveAttribute('target', '_self');
expect(osdsLinkElement).not.toHaveAttribute('rel');
diff --git a/packages/manager/apps/hub/src/components/products/Products.component.tsx b/packages/manager/apps/hub/src/components/products/Products.component.tsx
index afb24b408730..b2e1ae447dda 100644
--- a/packages/manager/apps/hub/src/components/products/Products.component.tsx
+++ b/packages/manager/apps/hub/src/components/products/Products.component.tsx
@@ -1,15 +1,12 @@
import React, { Suspense, useState } from 'react';
-import { useOvhTracking } from '@ovh-ux/manager-react-shell-client';
-import {
- OsdsButton,
- OsdsChip,
- OsdsIcon,
- OsdsLink,
- OsdsSkeleton,
- OsdsText,
- OsdsTile,
-} from '@ovhcloud/ods-components/react';
+
import { Await, useSearchParams } from 'react-router-dom';
+
+import punycode from 'punycode/punycode';
+import { useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
ODS_BUTTON_TYPE,
ODS_BUTTON_VARIANT,
@@ -21,13 +18,22 @@ import {
ODS_TEXT_LEVEL,
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
-import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
-import { useTranslation } from 'react-i18next';
-import punycode from 'punycode/punycode';
+import {
+ OsdsButton,
+ OsdsChip,
+ OsdsIcon,
+ OsdsLink,
+ OsdsSkeleton,
+ OsdsText,
+ OsdsTile,
+} from '@ovhcloud/ods-components/react';
+
+import { useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
+import { useProducts } from '@/hooks/products/useProducts';
import { ApiEnvelope } from '@/types/apiEnvelope.type';
import { HubProduct, ProductList } from '@/types/services.type';
-import { useProducts } from '@/hooks/products/useProducts';
+
import './Products.style.scss';
type ProductsProps = {
@@ -105,11 +111,7 @@ export default function Products({ services }: ProductsProps) {
{product.count}
-
- }
- >
+ }>
@@ -145,10 +147,7 @@ export default function Products({ services }: ProductsProps) {
-
+
{product.data.map((service) => (
-
{punycode.toUnicode(
- service.resource.displayName ||
- service.resource.name,
+ service.resource.displayName || service.resource.name,
)}
@@ -193,17 +191,11 @@ export default function Products({ services }: ProductsProps) {
size={ODS_TEXT_SIZE._400}
color={ODS_THEME_COLOR_INTENT.primary}
>
- {t(
- expand
- ? 'manager_hub_products_see_less'
- : 'manager_hub_products_see_more',
- )}
+ {t(expand ? 'manager_hub_products_see_less' : 'manager_hub_products_see_more')}
diff --git a/packages/manager/apps/hub/src/components/products/Products.constants.ts b/packages/manager/apps/hub/src/components/products/Products.constants.ts
index 36523211d4d4..b2c2a679967e 100644
--- a/packages/manager/apps/hub/src/components/products/Products.constants.ts
+++ b/packages/manager/apps/hub/src/components/products/Products.constants.ts
@@ -1,7 +1,4 @@
-export const productListingPages: Record<
- string,
- { application: string; hash: string }
-> = {
+export const productListingPages: Record = {
CDN_DEDICATED: {
application: 'dedicated',
hash: '#/configuration/cdn',
diff --git a/packages/manager/apps/hub/src/components/products/Products.spec.tsx b/packages/manager/apps/hub/src/components/products/Products.spec.tsx
index 51e1c3e0b449..a87a3ede2641 100644
--- a/packages/manager/apps/hub/src/components/products/Products.spec.tsx
+++ b/packages/manager/apps/hub/src/components/products/Products.spec.tsx
@@ -1,14 +1,14 @@
import React from 'react';
-import { describe, expect, it, vi } from 'vitest';
-import { act, fireEvent, render } from '@testing-library/react';
+
import '@testing-library/jest-dom';
-import {
- ShellContext,
- ShellContextType,
-} from '@ovh-ux/manager-react-shell-client';
+import { act, fireEvent, render } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
+import { ShellContext, ShellContextType } from '@ovh-ux/manager-react-shell-client';
+
+import { aFewProductsMocked, lotsOfProductsMocked } from '@/__mocks__/products';
import Products from '@/components/products/Products.component';
import { ProductList } from '@/types/services.type';
-import { aFewProductsMocked, lotsOfProductsMocked } from '@/__mocks__/products';
const trackClickMock = vi.fn();
const url = 'https://fake-link.com';
@@ -65,9 +65,7 @@ const shellContext = {
const renderComponent = (services: ProductList) => {
return render(
-
+
,
);
@@ -92,12 +90,8 @@ describe('Products.component', () => {
it('should display correctly a signle product with a single service', async () => {
const [productName] = Object.keys(aFewProductsMocked.data);
- const {
- getByText,
- getByTestId,
- findByTestId,
- queryByTestId,
- } = renderComponent(aFewProductsMocked);
+ const { getByText, getByTestId, findByTestId, queryByTestId } =
+ renderComponent(aFewProductsMocked);
const productAnchor = await findByTestId('product_link');
const servicesList = getByTestId('product_services_list');
@@ -115,11 +109,7 @@ describe('Products.component', () => {
expect(trackClickMock).toHaveBeenCalledWith({
actionType: 'action',
- actions: [
- 'product',
- productName.toLowerCase().replace(/_/g, '-'),
- 'show-all',
- ],
+ actions: ['product', productName.toLowerCase().replace(/_/g, '-'), 'show-all'],
});
const serviceAnchor = await findByTestId('service_link');
@@ -128,18 +118,12 @@ describe('Products.component', () => {
expect(trackClickMock).toHaveBeenCalledWith({
actionType: 'action',
- actions: [
- 'product',
- productName.toLowerCase().replace(/_/g, '-'),
- 'go-to-service',
- ],
+ actions: ['product', productName.toLowerCase().replace(/_/g, '-'), 'go-to-service'],
});
});
it('should call onClick when link is clicked', async () => {
- const { getByTestId, getByText, findByTestId } = renderComponent(
- lotsOfProductsMocked,
- );
+ const { getByTestId, getByText, findByTestId } = renderComponent(lotsOfProductsMocked);
const expandLink = await findByTestId('expand_link');
const productsList = getByTestId('products-list-container');
@@ -155,8 +139,6 @@ describe('Products.component', () => {
actions: ['product', 'show_more'],
});
- expect(productsList.children.length).toBe(
- Object.keys(lotsOfProductsMocked.data).length,
- );
+ expect(productsList.children.length).toBe(Object.keys(lotsOfProductsMocked.data).length);
});
});
diff --git a/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids.spec.tsx b/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids.spec.tsx
index c37533afb3f3..881277d2052c 100644
--- a/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids.spec.tsx
+++ b/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids.spec.tsx
@@ -1,10 +1,13 @@
-import { vi, describe, it, expect } from 'vitest';
-import { fireEvent, screen } from '@testing-library/react';
import '@testing-library/jest-dom';
+import { fireEvent, screen } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import * as reactShellClientModule from '@ovh-ux/manager-react-shell-client';
-import RoadmapChangelogDatagrids from './RoadmapChangelogDatagrids';
+
import { renderWithShellContext } from '@/__mocks__/ShellContextWrapper';
+import RoadmapChangelogDatagrids from './RoadmapChangelogDatagrids';
+
const trackClickMock = vi.fn();
vi.mock('@/data/hooks/roadmapChangelog/useRoadmapChangelog', () => ({
@@ -62,8 +65,7 @@ vi.mock('react-i18next', () => ({
}),
}));
-const renderComponent = () =>
- renderWithShellContext();
+const renderComponent = () => renderWithShellContext();
describe('Roadmap Changelog Datagrids', () => {
it('should render', () => {
diff --git a/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids.tsx b/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids.tsx
index 524704f9f7cc..98c757265abf 100644
--- a/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids.tsx
+++ b/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids.tsx
@@ -1,53 +1,40 @@
import { useContext } from 'react';
-import { Datagrid } from '@ovh-ux/manager-react-components';
+
+import { useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
+import { ODS_ICON_NAME, ODS_ICON_SIZE, ODS_TABS_SIZE } from '@ovhcloud/ods-components';
import {
+ OsdsIcon,
+ OsdsLink,
+ OsdsTabBar,
OsdsTabBarItem,
OsdsTabPanel,
OsdsTabs,
- OsdsLink,
- OsdsIcon,
- OsdsTabBar,
} from '@ovhcloud/ods-components/react';
-import {
- ODS_TABS_SIZE,
- ODS_ICON_NAME,
- ODS_ICON_SIZE,
-} from '@ovhcloud/ods-components';
-import {
- OdsHTMLAnchorElementRel,
- OdsHTMLAnchorElementTarget,
-} from '@ovhcloud/ods-common-core';
-import {
- useOvhTracking,
- ShellContext,
-} from '@ovh-ux/manager-react-shell-client';
-import { useTranslation } from 'react-i18next';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
+
+import { Datagrid } from '@ovh-ux/manager-react-components';
+import { ShellContext, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import { EXTERNAL_LINKS, ROADMAP_CHANGELOG_PAGES } from '@/changelog.constants';
import { useRoadmapChangelog } from '@/data/hooks/roadmapChangelog/useRoadmapChangelog';
-import styles from './style.module.scss';
import useRoadmapChangelogData from '@/hooks/roadmapChangelog/useRoadmapChangelogData';
+import styles from './style.module.scss';
+
const RoadmapChangelogDatagrids = () => {
- const {
- data: roadmapChangelogItems,
- isLoading: isLoadingItems,
- } = useRoadmapChangelog();
+ const { data: roadmapChangelogItems, isLoading: isLoadingItems } = useRoadmapChangelog();
const { trackClick } = useOvhTracking();
const { t } = useTranslation('changelog');
const { environment } = useContext(ShellContext);
const isRegionUS = environment.getRegion() === 'US';
- const { emptyRoadmapChangelogItems, columns } = useRoadmapChangelogData(
- isLoadingItems,
- );
+ const { emptyRoadmapChangelogItems, columns } = useRoadmapChangelogData(isLoadingItems);
return (
-
+
{t('datagrid_tab_title_cloud')}
@@ -60,11 +47,7 @@ const RoadmapChangelogDatagrids = () => {
{
+export const RoadmapChangelogItemDescriptionCell = ({ item }: { item: RoadmapChangelogItem }) => {
return (
{
+export const RoadmapChangelogItemProductCell = ({ item }: { item: RoadmapChangelogItem }) => {
return (
{item.product && (
diff --git a/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/cells/RoadmapChangelogItemReleaseDateCell.tsx b/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/cells/RoadmapChangelogItemReleaseDateCell.tsx
index 27f8505fab95..850b48f264c3 100644
--- a/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/cells/RoadmapChangelogItemReleaseDateCell.tsx
+++ b/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/cells/RoadmapChangelogItemReleaseDateCell.tsx
@@ -1,12 +1,10 @@
-import { DataGridTextCell } from '@ovh-ux/manager-react-components';
import { useTranslation } from 'react-i18next';
+
+import { DataGridTextCell } from '@ovh-ux/manager-react-components';
+
import { RoadmapChangelogItem } from '@/types/roadmapchangelog.type';
-export const RoadmapChangelogItemReleaseDateCell = ({
- item,
-}: {
- item: RoadmapChangelogItem;
-}) => {
+export const RoadmapChangelogItemReleaseDateCell = ({ item }: { item: RoadmapChangelogItem }) => {
const { i18n } = useTranslation('changelog');
const locale = i18n?.language?.replace('_', '-');
return (
diff --git a/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/cells/RoadmapChangelogItemStatusCell.tsx b/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/cells/RoadmapChangelogItemStatusCell.tsx
index 27bda2b05bea..7ebbddcfffaf 100644
--- a/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/cells/RoadmapChangelogItemStatusCell.tsx
+++ b/packages/manager/apps/hub/src/components/roadmap-changelog-datagrid/cells/RoadmapChangelogItemStatusCell.tsx
@@ -1,16 +1,18 @@
import { FunctionComponent } from 'react';
-import { DataGridTextCell } from '@ovh-ux/manager-react-components';
+
import { ODS_CHIP_SIZE } from '@ovhcloud/ods-components';
import { OsdsChip } from '@ovhcloud/ods-components/react';
-import { ROADMAP_STATUS_COLORS } from './roadmapChangelogItemStatusCell.constants';
+
+import { DataGridTextCell } from '@ovh-ux/manager-react-components';
+
import { RoadmapChangelogItem } from '@/types/roadmapchangelog.type';
+import { ROADMAP_STATUS_COLORS } from './roadmapChangelogItemStatusCell.constants';
+
type Props = {
item: RoadmapChangelogItem;
};
-export const RoadmapChangelogItemStatusCell: FunctionComponent = ({
- item,
-}) => {
+export const RoadmapChangelogItemStatusCell: FunctionComponent = ({ item }) => {
return (
{
+export const RoadmapChangelogItemTitleCell = ({ item }: { item: RoadmapChangelogItem }) => {
return (
-
- {item.changelog}
-
+ {item.changelog}
);
};
diff --git a/packages/manager/apps/hub/src/components/skeletons/Skeletons.component.tsx b/packages/manager/apps/hub/src/components/skeletons/Skeletons.component.tsx
index b797f9b1f3dd..e7245c937385 100644
--- a/packages/manager/apps/hub/src/components/skeletons/Skeletons.component.tsx
+++ b/packages/manager/apps/hub/src/components/skeletons/Skeletons.component.tsx
@@ -1,4 +1,5 @@
import React, { FunctionComponent } from 'react';
+
import { OsdsSkeleton } from '@ovhcloud/ods-components/react';
export const Skeletons: FunctionComponent = () => (
diff --git a/packages/manager/apps/hub/src/components/skeletons/Skeletons.spec.tsx b/packages/manager/apps/hub/src/components/skeletons/Skeletons.spec.tsx
index 68e76f1d3453..a9acbcecc231 100644
--- a/packages/manager/apps/hub/src/components/skeletons/Skeletons.spec.tsx
+++ b/packages/manager/apps/hub/src/components/skeletons/Skeletons.spec.tsx
@@ -1,22 +1,14 @@
import React from 'react';
-import { render, screen } from '@testing-library/react';
-import { describe, it, expect, vi } from 'vitest';
+
import '@testing-library/jest-dom';
+import { render, screen } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import { Skeletons } from './Skeletons.component';
vi.mock('@ovhcloud/ods-components/react', () => ({
- OsdsSkeleton: ({
- inline,
- randomized,
- }: {
- inline: boolean;
- randomized: boolean;
- }) => (
-
+ OsdsSkeleton: ({ inline, randomized }: { inline: boolean; randomized: boolean }) => (
+
),
}));
diff --git a/packages/manager/apps/hub/src/components/tile-error/TileError.component.spec.tsx b/packages/manager/apps/hub/src/components/tile-error/TileError.component.spec.tsx
index 940e37febe22..8cd421634334 100644
--- a/packages/manager/apps/hub/src/components/tile-error/TileError.component.spec.tsx
+++ b/packages/manager/apps/hub/src/components/tile-error/TileError.component.spec.tsx
@@ -1,12 +1,8 @@
import React from 'react';
-import {
- render,
- screen,
- fireEvent,
- act,
- waitFor,
-} from '@testing-library/react';
-import { describe, it, expect, vi } from 'vitest';
+
+import { act, fireEvent, render, screen, waitFor } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import TileError from './TileError.component';
describe('TileError Component', () => {
@@ -17,9 +13,7 @@ describe('TileError Component', () => {
expect(screen.getByText('manager_hub_error_tile_oops')).toBeInTheDocument();
expect(screen.getByText('Error message details')).toBeInTheDocument();
- expect(
- screen.getByText('manager_hub_error_tile_retry'),
- ).toBeInTheDocument();
+ expect(screen.getByText('manager_hub_error_tile_retry')).toBeInTheDocument();
});
it('calls refetch function when the button is clicked', async () => {
diff --git a/packages/manager/apps/hub/src/components/tile-error/TileError.component.tsx b/packages/manager/apps/hub/src/components/tile-error/TileError.component.tsx
index f46a100f8d4b..4e81c845eaff 100644
--- a/packages/manager/apps/hub/src/components/tile-error/TileError.component.tsx
+++ b/packages/manager/apps/hub/src/components/tile-error/TileError.component.tsx
@@ -1,9 +1,8 @@
import React from 'react';
-import { OsdsButton, OsdsIcon, OsdsText } from '@ovhcloud/ods-components/react';
-import {
- ODS_THEME_COLOR_INTENT,
- ODS_THEME_TYPOGRAPHY_LEVEL,
-} from '@ovhcloud/ods-common-theming';
+
+import { useTranslation } from 'react-i18next';
+
+import { ODS_THEME_COLOR_INTENT, ODS_THEME_TYPOGRAPHY_LEVEL } from '@ovhcloud/ods-common-theming';
import {
ODS_BUTTON_SIZE,
ODS_BUTTON_VARIANT,
@@ -11,7 +10,7 @@ import {
ODS_ICON_SIZE,
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
-import { useTranslation } from 'react-i18next';
+import { OsdsButton, OsdsIcon, OsdsText } from '@ovhcloud/ods-components/react';
type Props = {
message: string;
@@ -20,19 +19,12 @@ type Props = {
contrasted?: boolean;
};
-export default function TileError({
- message,
- refetch,
- className,
- contrasted,
-}: Props) {
+export default function TileError({ message, refetch, className, contrasted }: Props) {
const { t } = useTranslation('hub/error');
return (
@@ -64,9 +52,7 @@ export default function TileError({
hoverable
name={ODS_ICON_NAME.REFRESH}
size={ODS_ICON_SIZE.xs}
- {...(contrasted
- ? { contrasted }
- : { color: ODS_THEME_COLOR_INTENT.primary })}
+ {...(contrasted ? { contrasted } : { color: ODS_THEME_COLOR_INTENT.primary })}
/>
diff --git a/packages/manager/apps/hub/src/components/tile-grid-skeleton/TileGridSkeleton.component.tsx b/packages/manager/apps/hub/src/components/tile-grid-skeleton/TileGridSkeleton.component.tsx
index cdd6bad0ba22..3c2e309b3e4f 100644
--- a/packages/manager/apps/hub/src/components/tile-grid-skeleton/TileGridSkeleton.component.tsx
+++ b/packages/manager/apps/hub/src/components/tile-grid-skeleton/TileGridSkeleton.component.tsx
@@ -1,6 +1,8 @@
import React from 'react';
-import { OsdsSkeleton } from '@ovhcloud/ods-components/react';
+
import { ODS_SKELETON_SIZE } from '@ovhcloud/ods-components';
+import { OsdsSkeleton } from '@ovhcloud/ods-components/react';
+
import TileSkeleton from '@/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.component';
export default function TileGridSkeleton() {
diff --git a/packages/manager/apps/hub/src/components/tile-grid-skeleton/TileGridSkeleton.spec.tsx b/packages/manager/apps/hub/src/components/tile-grid-skeleton/TileGridSkeleton.spec.tsx
index 11f780c361d6..f1baccc19923 100644
--- a/packages/manager/apps/hub/src/components/tile-grid-skeleton/TileGridSkeleton.spec.tsx
+++ b/packages/manager/apps/hub/src/components/tile-grid-skeleton/TileGridSkeleton.spec.tsx
@@ -1,6 +1,8 @@
import React from 'react';
-import { describe, expect, it } from 'vitest';
+
import { render } from '@testing-library/react';
+import { describe, expect, it } from 'vitest';
+
import TileGridSkeleton from '@/components/tile-grid-skeleton/TileGridSkeleton.component';
describe('TileGridSkeleton', () => {
diff --git a/packages/manager/apps/hub/src/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.component.tsx b/packages/manager/apps/hub/src/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.component.tsx
index 061deea4c96a..0d1b25533e82 100644
--- a/packages/manager/apps/hub/src/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.component.tsx
+++ b/packages/manager/apps/hub/src/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.component.tsx
@@ -1,6 +1,7 @@
import React from 'react';
-import { OsdsSkeleton, OsdsTile } from '@ovhcloud/ods-components/react';
+
import { ODS_SKELETON_SIZE } from '@ovhcloud/ods-components';
+import { OsdsSkeleton, OsdsTile } from '@ovhcloud/ods-components/react';
export default function TileSkeleton() {
return (
@@ -11,11 +12,7 @@ export default function TileSkeleton() {
data-testid="tile_skeleton_header"
>
-
+
diff --git a/packages/manager/apps/hub/src/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.spec.tsx b/packages/manager/apps/hub/src/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.spec.tsx
index 986d42e446b0..c49bb0c8f4de 100644
--- a/packages/manager/apps/hub/src/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.spec.tsx
+++ b/packages/manager/apps/hub/src/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.spec.tsx
@@ -1,6 +1,8 @@
import React from 'react';
-import { describe, expect, it } from 'vitest';
+
import { render } from '@testing-library/react';
+import { describe, expect, it } from 'vitest';
+
import TileSkeleton from '@/components/tile-grid-skeleton/tile-skeleton/TileSkeleton.component';
describe('TileSkeleton', () => {
diff --git a/packages/manager/apps/hub/src/components/welcome/Welcome.component.tsx b/packages/manager/apps/hub/src/components/welcome/Welcome.component.tsx
index 062e471d988f..ba875b77a0e8 100644
--- a/packages/manager/apps/hub/src/components/welcome/Welcome.component.tsx
+++ b/packages/manager/apps/hub/src/components/welcome/Welcome.component.tsx
@@ -1,5 +1,8 @@
import React, { useContext } from 'react';
-import { ShellContext } from '@ovh-ux/manager-react-shell-client';
+
+import { useTranslation } from 'react-i18next';
+
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
ODS_CHIP_SIZE,
ODS_ICON_NAME,
@@ -8,9 +11,9 @@ import {
ODS_TEXT_LEVEL,
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import { OsdsChip, OsdsIcon, OsdsText } from '@ovhcloud/ods-components/react';
-import { useTranslation } from 'react-i18next';
+
+import { ShellContext } from '@ovh-ux/manager-react-shell-client';
export default function Welcome() {
const { t } = useTranslation('hub');
diff --git a/packages/manager/apps/hub/src/components/welcome/Welcome.spec.tsx b/packages/manager/apps/hub/src/components/welcome/Welcome.spec.tsx
index babb576e4dbf..6499c418095c 100644
--- a/packages/manager/apps/hub/src/components/welcome/Welcome.spec.tsx
+++ b/packages/manager/apps/hub/src/components/welcome/Welcome.spec.tsx
@@ -1,11 +1,11 @@
import React from 'react';
-import { describe, expect, it, vi } from 'vitest';
-import { render } from '@testing-library/react';
+
import '@testing-library/jest-dom';
-import {
- ShellContext,
- ShellContextType,
-} from '@ovh-ux/manager-react-shell-client';
+import { render } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
+import { ShellContext, ShellContextType } from '@ovh-ux/manager-react-shell-client';
+
import Welcome from '@/components/welcome/Welcome.component';
const user = {
@@ -21,9 +21,7 @@ const shellContext = {
const renderComponent = () => {
return render(
-
+
,
);
@@ -31,8 +29,7 @@ const renderComponent = () => {
vi.mock('react-i18next', () => ({
useTranslation: () => ({
- t: (translationKey: string, params: any) =>
- `${translationKey} ${params?.name}`,
+ t: (translationKey: string, params: any) => `${translationKey} ${params?.name}`,
}),
}));
@@ -40,9 +37,7 @@ describe('Welcome.component', () => {
it('should display customer first name', async () => {
const { getByText } = renderComponent();
- expect(
- getByText(`manager_hub_dashboard_welcome ${user.firstname}`),
- ).not.toBeNull();
+ expect(getByText(`manager_hub_dashboard_welcome ${user.firstname}`)).not.toBeNull();
});
it('should not display SNC badge for non trusted customer', async () => {
diff --git a/packages/manager/apps/hub/src/data/api/apiHubSupport.ts b/packages/manager/apps/hub/src/data/api/apiHubSupport.ts
index 7f1f7ee469be..06e6d96a7e24 100644
--- a/packages/manager/apps/hub/src/data/api/apiHubSupport.ts
+++ b/packages/manager/apps/hub/src/data/api/apiHubSupport.ts
@@ -1,10 +1,11 @@
import { aapi } from '@ovh-ux/manager-core-api';
-import { SupportResponse } from '@/types/support.type';
+
import { ApiEnvelope } from '@/types/apiEnvelope.type';
+import { SupportResponse } from '@/types/support.type';
-export const getHubSupport: (
+export const getHubSupport: (cached: boolean) => Promise> = async (
cached: boolean,
-) => Promise> = async (cached: boolean) => {
+) => {
const { data } = await aapi.get>(
'/hub/support',
!cached && {
diff --git a/packages/manager/apps/hub/src/data/api/banner.ts b/packages/manager/apps/hub/src/data/api/banner.ts
index cabf89bd1b51..0f047c766d10 100644
--- a/packages/manager/apps/hub/src/data/api/banner.ts
+++ b/packages/manager/apps/hub/src/data/api/banner.ts
@@ -1,9 +1,8 @@
import { aapi } from '@ovh-ux/manager-core-api';
+
import { Banner } from '@/types/banner.type';
-export const getBanner: (locale: string) => Promise = async (
- locale: string,
-) => {
+export const getBanner: (locale: string) => Promise = async (locale: string) => {
const { data } = await aapi.get(`/banner?locale=${locale}`);
return data;
};
diff --git a/packages/manager/apps/hub/src/data/api/billingServices.ts b/packages/manager/apps/hub/src/data/api/billingServices.ts
index ad85a46f358d..91ca101c7715 100644
--- a/packages/manager/apps/hub/src/data/api/billingServices.ts
+++ b/packages/manager/apps/hub/src/data/api/billingServices.ts
@@ -1,17 +1,15 @@
-import { aapi, v6 } from '@ovh-ux/manager-core-api';
import { AxiosResponse } from 'axios';
+
+import { aapi, v6 } from '@ovh-ux/manager-core-api';
+
import {
BillingService,
BillingServicesData,
HubBillingServices,
} from '@/billing/types/billingServices.type';
-export const getBillingServices: () => Promise<
- HubBillingServices
-> = async () => {
- const { data } = await aapi.get>(
- `/hub/billingServices`,
- );
+export const getBillingServices: () => Promise = async () => {
+ const { data } = await aapi.get>(`/hub/billingServices`);
const services = data.data?.billingServices;
// The returned value when status is 'ERROR' has changed in order to keep a standard return type
// for this hook, also this give the same result as previous code without the confusing part
@@ -22,15 +20,11 @@ export const getBillingServices: () => Promise<
}
: {
count: services?.data?.count,
- services:
- services?.data?.data?.map((service) => new BillingService(service)) ||
- [],
+ services: services?.data?.data?.map((service) => new BillingService(service)) || [],
};
};
-export const getPendingEngagement = (
- serviceId: string | number,
-): Promise =>
+export const getPendingEngagement = (serviceId: string | number): Promise =>
v6
.get(`/services/${serviceId}/billing/engagement/request`)
.then(() => true)
diff --git a/packages/manager/apps/hub/src/data/api/bills.ts b/packages/manager/apps/hub/src/data/api/bills.ts
index d1065c977066..51e746ab720f 100644
--- a/packages/manager/apps/hub/src/data/api/bills.ts
+++ b/packages/manager/apps/hub/src/data/api/bills.ts
@@ -1,17 +1,14 @@
-import { aapi } from '@ovh-ux/manager-core-api';
import { AxiosResponse } from 'axios';
+
+import { aapi } from '@ovh-ux/manager-core-api';
+
import { Bills, BillsCapsule } from '@/types/bills.type';
-export const getBills: (period: number) => Promise = async (
- period: number,
-) => {
- const { data }: AxiosResponse = await aapi.get(
- `/hub/bills`,
- {
- params: {
- billingPeriod: period,
- },
+export const getBills: (period: number) => Promise = async (period: number) => {
+ const { data }: AxiosResponse = await aapi.get(`/hub/bills`, {
+ params: {
+ billingPeriod: period,
},
- );
+ });
return data.data?.bills?.data;
};
diff --git a/packages/manager/apps/hub/src/data/api/catalog.ts b/packages/manager/apps/hub/src/data/api/catalog.ts
index 43935ee6fc5d..da64b6e91b31 100644
--- a/packages/manager/apps/hub/src/data/api/catalog.ts
+++ b/packages/manager/apps/hub/src/data/api/catalog.ts
@@ -1,12 +1,12 @@
-import { aapi } from '@ovh-ux/manager-core-api';
-import i18next from 'i18next';
import { AxiosResponse } from 'axios';
+import i18next from 'i18next';
+
+import { aapi } from '@ovh-ux/manager-core-api';
+
import { ApiEnvelope } from '@/types/apiEnvelope.type';
import { CatalogData, CatalogItem } from '@/types/catalog';
-export const getCatalog: () => Promise<
- Record
-> = async () => {
+export const getCatalog: () => Promise> = async () => {
const { data }: AxiosResponse> = await aapi.get<
ApiEnvelope
>('/hub/catalog', {
@@ -16,17 +16,11 @@ export const getCatalog: () => Promise<
});
// Grouping items by universe while filtering non highlighted elements (as we don't want to display them)
return (data?.data?.catalog.data || []).reduce(
- (
- groupedCatalogItems: Record,
- item: CatalogItem,
- ) => ({
+ (groupedCatalogItems: Record, item: CatalogItem) => ({
...groupedCatalogItems,
...(item.highlight
? {
- [item.universe]: [
- ...(groupedCatalogItems[item.universe] || []),
- item,
- ],
+ [item.universe]: [...(groupedCatalogItems[item.universe] || []), item],
}
: {}),
}),
diff --git a/packages/manager/apps/hub/src/data/api/debt.ts b/packages/manager/apps/hub/src/data/api/debt.ts
index 725aa0b72b92..2e45ee1aa48a 100644
--- a/packages/manager/apps/hub/src/data/api/debt.ts
+++ b/packages/manager/apps/hub/src/data/api/debt.ts
@@ -1,5 +1,7 @@
+import { AxiosResponse } from 'axios';
+
import { v6 } from '@ovh-ux/manager-core-api';
-import { AxiosResponse } from 'axios/index';
+
import { Debt } from '@/types/debt.type';
export const getDebt: () => Promise = async () => {
diff --git a/packages/manager/apps/hub/src/data/api/kyc.ts b/packages/manager/apps/hub/src/data/api/kyc.ts
index d74bea5f56d7..162353a19c7f 100644
--- a/packages/manager/apps/hub/src/data/api/kyc.ts
+++ b/packages/manager/apps/hub/src/data/api/kyc.ts
@@ -1,9 +1,10 @@
import { v6 } from '@ovh-ux/manager-core-api';
+
import { KycProcedures, KycStatus } from '@/types/kyc.type';
-export const getKycStatus: (
+export const getKycStatus: (procedure: KycProcedures) => Promise = async (
procedure: KycProcedures,
-) => Promise = async (procedure: KycProcedures) => {
+) => {
const { data } = await v6.get(`/me/procedure/${procedure}`);
return data;
};
diff --git a/packages/manager/apps/hub/src/data/api/notifications.ts b/packages/manager/apps/hub/src/data/api/notifications.ts
index 80e13829078a..956342a5ce6a 100644
--- a/packages/manager/apps/hub/src/data/api/notifications.ts
+++ b/packages/manager/apps/hub/src/data/api/notifications.ts
@@ -1,22 +1,19 @@
-import { aapi } from '@ovh-ux/manager-core-api';
import i18next from 'i18next';
+
+import { aapi } from '@ovh-ux/manager-core-api';
+
import { ApiEnvelope } from '@/types/apiEnvelope.type';
import { Notification, NotificationsList } from '@/types/notifications.type';
const hubNotificationStatuses = ['warning', 'error'];
export const getNotifications: () => Promise = async () => {
- const { data } = await aapi.get>(
- `/hub/notifications`,
- {
- headers: {
- 'Content-Language': i18next.language.replace('-', '_'),
- },
+ const { data } = await aapi.get>(`/hub/notifications`, {
+ headers: {
+ 'Content-Language': i18next.language.replace('-', '_'),
},
- );
- return (
- data.data?.notifications.data || []
- ).filter((notification: Notification) =>
+ });
+ return (data.data?.notifications.data || []).filter((notification: Notification) =>
hubNotificationStatuses.includes(notification.level),
);
};
diff --git a/packages/manager/apps/hub/src/data/api/order/order.constants.ts b/packages/manager/apps/hub/src/data/api/order/order.constants.ts
index cbef180fa4f3..5630ebfa0378 100644
--- a/packages/manager/apps/hub/src/data/api/order/order.constants.ts
+++ b/packages/manager/apps/hub/src/data/api/order/order.constants.ts
@@ -3,11 +3,6 @@ const FRAUD_MANUAL_REVIEW = 'fraudManualReview';
const FRAUD_REFUSED = 'fraudRefused';
export const NOT_PAID = 'notPaid';
-export const ERROR_STATUS = [
- FRAUD_DOCS_REQUESTED,
- FRAUD_MANUAL_REVIEW,
- FRAUD_REFUSED,
- NOT_PAID,
-];
+export const ERROR_STATUS = [FRAUD_DOCS_REQUESTED, FRAUD_MANUAL_REVIEW, FRAUD_REFUSED, NOT_PAID];
export const WAITING_PAYMENT_LABEL = 'custom_payment_waiting';
diff --git a/packages/manager/apps/hub/src/data/api/order/order.ts b/packages/manager/apps/hub/src/data/api/order/order.ts
index c3facb28c5ac..2d27f543536b 100644
--- a/packages/manager/apps/hub/src/data/api/order/order.ts
+++ b/packages/manager/apps/hub/src/data/api/order/order.ts
@@ -1,23 +1,23 @@
import { aapi, v6 } from '@ovh-ux/manager-core-api';
+
+import { ApiEnvelope } from '@/types/apiEnvelope.type';
import {
- OrderFollowUpResponse,
- OrderDetailsResponse,
- OrderStatus,
- OrderHistory,
LastOrderResponse,
Order,
+ OrderDetailsResponse,
+ OrderFollowUpResponse,
+ OrderHistory,
+ OrderStatus,
} from '@/types/order.type';
+
import { NOT_PAID, WAITING_PAYMENT_LABEL } from './order.constants';
-import { ApiEnvelope } from '@/types/apiEnvelope.type';
export const getLastOrder = async (): Promise> => {
const { data } = await aapi.get('/hub/lastOrder');
return data.data.lastOrder;
};
-export const getOrderDetails = async (
- orderId: number,
-): Promise => {
+export const getOrderDetails = async (orderId: number): Promise => {
const { data } = await v6.get(`/me/order/${orderId}/details`);
return data as OrderDetailsResponse;
};
@@ -27,9 +27,7 @@ export const getOrderStatus = async (orderId: number): Promise => {
return data as OrderStatus;
};
-export const getOrderFollowUp = async (
- orderId: number,
-): Promise => {
+export const getOrderFollowUp = async (orderId: number): Promise => {
const { data } = await v6.get(`/me/order/${orderId}/followUp`);
return data as OrderFollowUpResponse;
};
diff --git a/packages/manager/apps/hub/src/data/api/roadmapChangelog.ts b/packages/manager/apps/hub/src/data/api/roadmapChangelog.ts
index 209bbabf536a..6cafd876a55c 100644
--- a/packages/manager/apps/hub/src/data/api/roadmapChangelog.ts
+++ b/packages/manager/apps/hub/src/data/api/roadmapChangelog.ts
@@ -1,11 +1,8 @@
import { aapi } from '@ovh-ux/manager-core-api';
+
import { RoadmapChangelogResponse } from '@/types/roadmapchangelog.type';
-export const getRoadmapChangelog: () => Promise<
- RoadmapChangelogResponse
-> = async () => {
- const { data } = await aapi.get(
- '/roadmap-changelog',
- );
+export const getRoadmapChangelog: () => Promise = async () => {
+ const { data } = await aapi.get('/roadmap-changelog');
return data;
};
diff --git a/packages/manager/apps/hub/src/data/api/services.ts b/packages/manager/apps/hub/src/data/api/services.ts
index 06869cc31755..dd7b58253f40 100644
--- a/packages/manager/apps/hub/src/data/api/services.ts
+++ b/packages/manager/apps/hub/src/data/api/services.ts
@@ -1,10 +1,9 @@
import { aapi } from '@ovh-ux/manager-core-api';
-import { ServicesEnvelope, ProductList } from '@/types/services.type';
+
import { ApiEnvelope } from '@/types/apiEnvelope.type';
+import { ProductList, ServicesEnvelope } from '@/types/services.type';
-export const getServices: () => Promise<
- ApiEnvelope
-> = async () => {
+export const getServices: () => Promise> = async () => {
const { data } = await aapi.get(`/hub/services`);
return data.data?.services;
};
diff --git a/packages/manager/apps/hub/src/data/hooks/apiHubSupport/useHubSupport.spec.tsx b/packages/manager/apps/hub/src/data/hooks/apiHubSupport/useHubSupport.spec.tsx
index c44438878d76..75c30b2b1125 100644
--- a/packages/manager/apps/hub/src/data/hooks/apiHubSupport/useHubSupport.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/apiHubSupport/useHubSupport.spec.tsx
@@ -1,12 +1,13 @@
+import { PropsWithChildren } from 'react';
+
import { QueryClientProvider } from '@tanstack/react-query';
import { act, renderHook, waitFor } from '@testing-library/react';
-import { PropsWithChildren } from 'react';
import { describe, it, vi } from 'vitest';
-import { useFetchHubSupport } from '@/data/hooks/apiHubSupport/useHubSupport';
-import { SupportResponse } from '@/types/support.type';
-import * as hubSupportApi from '@/data/api/apiHubSupport';
+import * as hubSupportApi from '@/data/api/apiHubSupport';
+import { useFetchHubSupport } from '@/data/hooks/apiHubSupport/useHubSupport';
import queryClient from '@/queryClient';
+import { SupportResponse } from '@/types/support.type';
const supportDataResponse: SupportResponse = {
support: {
@@ -24,14 +25,12 @@ const wrapper = ({ children }: PropsWithChildren) => (
describe('useFetchHubSupport', () => {
it('should return expected result', async () => {
- const getHubSupport = vi
- .spyOn(hubSupportApi, 'getHubSupport')
- .mockReturnValue(
- Promise.resolve({
- data: supportDataResponse,
- status: 'OK',
- }),
- );
+ const getHubSupport = vi.spyOn(hubSupportApi, 'getHubSupport').mockReturnValue(
+ Promise.resolve({
+ data: supportDataResponse,
+ status: 'OK',
+ }),
+ );
const { result } = renderHook(() => useFetchHubSupport(), {
wrapper,
@@ -39,23 +38,17 @@ describe('useFetchHubSupport', () => {
await waitFor(() => {
expect(getHubSupport).toHaveBeenCalled();
- expect(result.current.data.count).toEqual(
- supportDataResponse.support.data.count,
- );
- expect(result.current.data.data).toEqual(
- supportDataResponse.support.data.data,
- );
+ expect(result.current.data.count).toEqual(supportDataResponse.support.data.count);
+ expect(result.current.data.data).toEqual(supportDataResponse.support.data.data);
});
});
it('should call API without cache when refetching', async () => {
- const getHubSupport = vi
- .spyOn(hubSupportApi, 'getHubSupport')
- .mockReturnValue(
- Promise.resolve({
- data: supportDataResponse,
- status: 'OK',
- }),
- );
+ const getHubSupport = vi.spyOn(hubSupportApi, 'getHubSupport').mockReturnValue(
+ Promise.resolve({
+ data: supportDataResponse,
+ status: 'OK',
+ }),
+ );
const { result } = renderHook(() => useFetchHubSupport(), {
wrapper,
diff --git a/packages/manager/apps/hub/src/data/hooks/apiHubSupport/useHubSupport.tsx b/packages/manager/apps/hub/src/data/hooks/apiHubSupport/useHubSupport.tsx
index e24f2ca7f37c..a21d2a90e089 100644
--- a/packages/manager/apps/hub/src/data/hooks/apiHubSupport/useHubSupport.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/apiHubSupport/useHubSupport.tsx
@@ -1,8 +1,9 @@
import { DefinedInitialDataOptions, useQuery } from '@tanstack/react-query';
-import { SupportDataResponse, SupportResponse } from '@/types/support.type';
+
import { getHubSupport } from '@/data/api/apiHubSupport';
import queryClient from '@/queryClient';
import { ApiEnvelope } from '@/types/apiEnvelope.type';
+import { SupportDataResponse, SupportResponse } from '@/types/support.type';
const queryKey = ['get-hub-support'];
@@ -13,11 +14,7 @@ const DEFAULT_RESULT: SupportDataResponse = {
export const useFetchHubSupport = (
options?: Partial<
- DefinedInitialDataOptions<
- ApiEnvelope,
- any,
- SupportDataResponse
- >
+ DefinedInitialDataOptions, any, SupportDataResponse>
>,
) =>
useQuery({
@@ -26,7 +23,6 @@ export const useFetchHubSupport = (
const hasBeenFetched = Boolean(queryClient.getQueryData(queryKey));
return getHubSupport(!hasBeenFetched);
},
- select: ({ data }: ApiEnvelope) =>
- data?.support?.data ?? DEFAULT_RESULT,
+ select: ({ data }: ApiEnvelope) => data?.support?.data ?? DEFAULT_RESULT,
...(options ?? {}),
});
diff --git a/packages/manager/apps/hub/src/data/hooks/banner/useBanner.spec.tsx b/packages/manager/apps/hub/src/data/hooks/banner/useBanner.spec.tsx
index 95ca09ad4648..abfe60d6bd7f 100644
--- a/packages/manager/apps/hub/src/data/hooks/banner/useBanner.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/banner/useBanner.spec.tsx
@@ -1,9 +1,11 @@
import React, { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
-import { useFetchHubBanner } from '@/data/hooks/banner/useBanner';
+
import * as BannerApi from '@/data/api/banner';
+import { useFetchHubBanner } from '@/data/hooks/banner/useBanner';
import { Banner } from '@/types/banner.type';
const queryClient = new QueryClient();
@@ -47,9 +49,7 @@ describe('useFetchHubBanner', () => {
link: 'https://link-to-summit.com',
tracker: 'summit::tracking',
};
- vi.spyOn(BannerApi, 'getBanner').mockReturnValue(
- new Promise((resolve) => resolve(banner)),
- );
+ vi.spyOn(BannerApi, 'getBanner').mockReturnValue(new Promise((resolve) => resolve(banner)));
const { result } = renderHook(() => useFetchHubBanner('fr_FR'), {
wrapper,
diff --git a/packages/manager/apps/hub/src/data/hooks/banner/useBanner.tsx b/packages/manager/apps/hub/src/data/hooks/banner/useBanner.tsx
index e8cfe7ea6349..590bf33489cd 100644
--- a/packages/manager/apps/hub/src/data/hooks/banner/useBanner.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/banner/useBanner.tsx
@@ -1,5 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getBanner } from '@/data/api/banner';
import { Banner } from '@/types/banner.type';
diff --git a/packages/manager/apps/hub/src/data/hooks/billingServices/useBillingServices.spec.tsx b/packages/manager/apps/hub/src/data/hooks/billingServices/useBillingServices.spec.tsx
index 81820f2d639b..94777e732993 100644
--- a/packages/manager/apps/hub/src/data/hooks/billingServices/useBillingServices.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/billingServices/useBillingServices.spec.tsx
@@ -1,10 +1,12 @@
import React, { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
-import { useFetchHubBillingServices } from '@/data/hooks/billingServices/useBillingServices';
-import * as BillingServicesApi from '@/data/api/billingServices';
+
import { HubBillingServices } from '@/billing/types/billingServices.type';
+import * as BillingServicesApi from '@/data/api/billingServices';
+import { useFetchHubBillingServices } from '@/data/hooks/billingServices/useBillingServices';
const queryClient = new QueryClient();
diff --git a/packages/manager/apps/hub/src/data/hooks/billingServices/useBillingServices.tsx b/packages/manager/apps/hub/src/data/hooks/billingServices/useBillingServices.tsx
index 72ad36b721b9..330c941729d9 100644
--- a/packages/manager/apps/hub/src/data/hooks/billingServices/useBillingServices.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/billingServices/useBillingServices.tsx
@@ -1,7 +1,8 @@
import { DefinedInitialDataOptions, useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
-import { getBillingServices } from '@/data/api/billingServices';
+
import { HubBillingServices } from '@/billing/types/billingServices.type';
+import { getBillingServices } from '@/data/api/billingServices';
export const useFetchHubBillingServices = (
options?: Partial>,
diff --git a/packages/manager/apps/hub/src/data/hooks/bills/useBills.spec.tsx b/packages/manager/apps/hub/src/data/hooks/bills/useBills.spec.tsx
index 3ac24ba16781..cf908a9b5a59 100644
--- a/packages/manager/apps/hub/src/data/hooks/bills/useBills.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/bills/useBills.spec.tsx
@@ -1,9 +1,11 @@
import React, { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
-import { useFetchHubBills } from '@/data/hooks/bills/useBills';
+
import * as BillsApi from '@/data/api/bills';
+import { useFetchHubBills } from '@/data/hooks/bills/useBills';
import { Bills } from '@/types/bills.type';
const queryClient = new QueryClient();
@@ -15,9 +17,7 @@ const wrapper = ({ children }: PropsWithChildren) => (
describe('useFetchHubBills', () => {
it('returns no bills summary if api returned none', async () => {
const bills: Bills | null = null;
- const getBills = vi
- .spyOn(BillsApi, 'getBills')
- .mockReturnValue(Promise.resolve(bills));
+ const getBills = vi.spyOn(BillsApi, 'getBills').mockReturnValue(Promise.resolve(bills));
const { result } = renderHook(() => useFetchHubBills(1), {
wrapper,
diff --git a/packages/manager/apps/hub/src/data/hooks/bills/useBills.tsx b/packages/manager/apps/hub/src/data/hooks/bills/useBills.tsx
index f93b55d6b104..dfe652a5a524 100644
--- a/packages/manager/apps/hub/src/data/hooks/bills/useBills.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/bills/useBills.tsx
@@ -1,5 +1,6 @@
import { DefinedInitialDataOptions, useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getBills } from '@/data/api/bills';
import { Bills } from '@/types/bills.type';
diff --git a/packages/manager/apps/hub/src/data/hooks/catalog/useCatalog.spec.tsx b/packages/manager/apps/hub/src/data/hooks/catalog/useCatalog.spec.tsx
index 6e53bd86497f..921334007f90 100644
--- a/packages/manager/apps/hub/src/data/hooks/catalog/useCatalog.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/catalog/useCatalog.spec.tsx
@@ -1,12 +1,15 @@
import { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
+
import { aapi as Api } from '@ovh-ux/manager-core-api';
+
+import { catalogData, rawCatalogData } from '@/__mocks__/catalog';
import { useFetchHubCatalog } from '@/data/hooks/catalog/useCatalog';
import { ApiEnvelope } from '@/types/apiEnvelope.type';
import { CatalogData, CatalogItem } from '@/types/catalog';
-import { catalogData, rawCatalogData } from '@/__mocks__/catalog';
const queryClient = new QueryClient();
@@ -30,9 +33,7 @@ describe('useFetchHubCatalog', () => {
},
status: 'OK',
};
- const getCatalog = vi
- .spyOn(Api, 'get')
- .mockReturnValue(Promise.resolve({ data: catalog }));
+ const getCatalog = vi.spyOn(Api, 'get').mockReturnValue(Promise.resolve({ data: catalog }));
const { result } = renderHook(() => useFetchHubCatalog(), {
wrapper,
diff --git a/packages/manager/apps/hub/src/data/hooks/catalog/useCatalog.tsx b/packages/manager/apps/hub/src/data/hooks/catalog/useCatalog.tsx
index a6c7ced18229..d0ce00ca5892 100644
--- a/packages/manager/apps/hub/src/data/hooks/catalog/useCatalog.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/catalog/useCatalog.tsx
@@ -1,5 +1,6 @@
-import { AxiosError } from 'axios';
import { useQuery } from '@tanstack/react-query';
+import { AxiosError } from 'axios';
+
import { getCatalog } from '@/data/api/catalog';
import { CatalogItem } from '@/types/catalog';
diff --git a/packages/manager/apps/hub/src/data/hooks/debt/useDebt.spec.tsx b/packages/manager/apps/hub/src/data/hooks/debt/useDebt.spec.tsx
index c84de87cf6ec..5b7204ea2c1a 100644
--- a/packages/manager/apps/hub/src/data/hooks/debt/useDebt.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/debt/useDebt.spec.tsx
@@ -1,9 +1,11 @@
import React, { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
-import { useFetchHubDebt } from '@/data/hooks/debt/useDebt';
+
import * as DebtApi from '@/data/api/debt';
+import { useFetchHubDebt } from '@/data/hooks/debt/useDebt';
import { Debt } from '@/types/debt.type';
const queryClient = new QueryClient();
@@ -15,9 +17,7 @@ const wrapper = ({ children }: PropsWithChildren) => (
describe('useFetchHubDebt', () => {
it('returns no debt if api returned none', async () => {
const debt: Debt | null = null;
- const getDebt = vi
- .spyOn(DebtApi, 'getDebt')
- .mockReturnValue(Promise.resolve(debt));
+ const getDebt = vi.spyOn(DebtApi, 'getDebt').mockReturnValue(Promise.resolve(debt));
const { result } = renderHook(() => useFetchHubDebt(), {
wrapper,
diff --git a/packages/manager/apps/hub/src/data/hooks/debt/useDebt.tsx b/packages/manager/apps/hub/src/data/hooks/debt/useDebt.tsx
index db392061330e..330788352fba 100644
--- a/packages/manager/apps/hub/src/data/hooks/debt/useDebt.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/debt/useDebt.tsx
@@ -1,11 +1,10 @@
import { DefinedInitialDataOptions, useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getDebt } from '@/data/api/debt';
import { Debt } from '@/types/debt.type';
-export const useFetchHubDebt = (
- options?: Partial>,
-) =>
+export const useFetchHubDebt = (options?: Partial>) =>
useQuery({
...options,
queryKey: ['getHubDebt'],
diff --git a/packages/manager/apps/hub/src/data/hooks/kyc/useKyc.spec.tsx b/packages/manager/apps/hub/src/data/hooks/kyc/useKyc.spec.tsx
index 896f126cf97e..dc67c3235647 100644
--- a/packages/manager/apps/hub/src/data/hooks/kyc/useKyc.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/kyc/useKyc.spec.tsx
@@ -1,8 +1,11 @@
import React, { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
+
import { v6 as Api } from '@ovh-ux/manager-core-api';
+
import { useKyc } from '@/data/hooks/kyc/useKyc';
import { KycProcedures } from '@/types/kyc.type';
@@ -24,9 +27,7 @@ describe('useKyc', () => {
});
it('should make a call to the correct API given a kyc procedure name', async () => {
- const apiGet = vi
- .spyOn(Api, 'get')
- .mockReturnValue(Promise.resolve({ status: 'required' }));
+ const apiGet = vi.spyOn(Api, 'get').mockReturnValue(Promise.resolve({ status: 'required' }));
renderHook(() => useKyc(KycProcedures.INDIA).useKycStatus(), {
wrapper,
diff --git a/packages/manager/apps/hub/src/data/hooks/kyc/useKyc.tsx b/packages/manager/apps/hub/src/data/hooks/kyc/useKyc.tsx
index 7a1607797478..4529a3078d66 100644
--- a/packages/manager/apps/hub/src/data/hooks/kyc/useKyc.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/kyc/useKyc.tsx
@@ -1,12 +1,11 @@
-import { useQuery, DefinedInitialDataOptions } from '@tanstack/react-query';
+import { DefinedInitialDataOptions, useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
-import { KycProcedures, KycStatus } from '@/types/kyc.type';
+
import { getKycStatus } from '@/data/api/kyc';
+import { KycProcedures, KycStatus } from '@/types/kyc.type';
export const useKyc = (procedure: KycProcedures) => {
- const useKycStatus = (
- options?: Partial>,
- ) =>
+ const useKycStatus = (options?: Partial>) =>
useQuery({
...options,
queryKey: ['getKycStatus', procedure],
diff --git a/packages/manager/apps/hub/src/data/hooks/lastOrder/useLastOrder.spec.tsx b/packages/manager/apps/hub/src/data/hooks/lastOrder/useLastOrder.spec.tsx
index 179364f92e7b..a8a01cdbc770 100644
--- a/packages/manager/apps/hub/src/data/hooks/lastOrder/useLastOrder.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/lastOrder/useLastOrder.spec.tsx
@@ -1,9 +1,11 @@
import React, { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
-import { useLastOrder } from '@/data/hooks/lastOrder/useLastOrder';
+
import * as LastOrderApi from '@/data/api/order/order';
+import { useLastOrder } from '@/data/hooks/lastOrder/useLastOrder';
import { LastOrder } from '@/types/order.type';
const queryClient = new QueryClient();
@@ -40,8 +42,7 @@ describe('useLastOrder', () => {
expirationDate: '2024-09-05T23:29:59+02:00',
orderId: 99999999999,
password: 'fakepassword',
- pdfUrl:
- 'https://www.fake-order-url.com?orderId=fakeId&orderPassword=fakePassword',
+ pdfUrl: 'https://www.fake-order-url.com?orderId=fakeId&orderPassword=fakePassword',
priceWithTax: {
currencyCode: 'points',
text: '0 PTS',
@@ -58,8 +59,7 @@ describe('useLastOrder', () => {
text: '0 PTS',
value: 0,
},
- url:
- 'https://www.fake-order-url.com?orderId=fakeId&orderPassword=fakePassword',
+ url: 'https://www.fake-order-url.com?orderId=fakeId&orderPassword=fakePassword',
},
};
vi.spyOn(LastOrderApi, 'getLastOrder').mockReturnValue(
diff --git a/packages/manager/apps/hub/src/data/hooks/lastOrder/useLastOrder.tsx b/packages/manager/apps/hub/src/data/hooks/lastOrder/useLastOrder.tsx
index 26c929e308d2..887d383455af 100644
--- a/packages/manager/apps/hub/src/data/hooks/lastOrder/useLastOrder.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/lastOrder/useLastOrder.tsx
@@ -1,5 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getLastOrder } from '@/data/api/order/order';
import { LastOrder } from '@/types/order.type';
diff --git a/packages/manager/apps/hub/src/data/hooks/lastOrderTracking/useLastOrderTracking.spec.tsx b/packages/manager/apps/hub/src/data/hooks/lastOrderTracking/useLastOrderTracking.spec.tsx
index bd3ddf260af9..da27c9fc5fe3 100644
--- a/packages/manager/apps/hub/src/data/hooks/lastOrderTracking/useLastOrderTracking.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/lastOrderTracking/useLastOrderTracking.spec.tsx
@@ -1,10 +1,12 @@
+import React, { PropsWithChildren } from 'react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { renderHook, waitFor } from '@testing-library/react';
-import React, { PropsWithChildren } from 'react';
import { describe, it, vi } from 'vitest';
+
+import * as orderApi from '@/data/api/order/order';
import { useLastOrderTracking } from '@/data/hooks/lastOrderTracking/useLastOrderTracking';
import { LastOrderTrackingResponse } from '@/types/order.type';
-import * as orderApi from '@/data/api/order/order';
const queryClient = new QueryClient();
@@ -75,12 +77,8 @@ describe('useLastOrderTracking', () => {
expect(getOrderStatus).toHaveBeenCalled();
expect(getOrderDetails).toHaveBeenCalled();
expect(getCompleteHistory).toHaveBeenCalled();
- expect(result.current.data.expirationDate).toEqual(
- lastOrderTrackingResponse.expirationDate,
- );
- expect(result.current.data.status).toEqual(
- lastOrderTrackingResponse.status,
- );
+ expect(result.current.data.expirationDate).toEqual(lastOrderTrackingResponse.expirationDate);
+ expect(result.current.data.status).toEqual(lastOrderTrackingResponse.status);
});
});
});
diff --git a/packages/manager/apps/hub/src/data/hooks/lastOrderTracking/useLastOrderTracking.tsx b/packages/manager/apps/hub/src/data/hooks/lastOrderTracking/useLastOrderTracking.tsx
index e194e257eded..35c52a9b8321 100644
--- a/packages/manager/apps/hub/src/data/hooks/lastOrderTracking/useLastOrderTracking.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/lastOrderTracking/useLastOrderTracking.tsx
@@ -1,7 +1,7 @@
-import { useOrderStatus } from '../orderStatus/useOrderStatus';
-import { useOrderDetails } from '../orderDetails/useOrderDetails';
-import { useOrderCompleteHistory } from '../orderCompleteHistory/useOrderCompleteHistory';
import { useLastOrder } from '../lastOrder/useLastOrder';
+import { useOrderCompleteHistory } from '../orderCompleteHistory/useOrderCompleteHistory';
+import { useOrderDetails } from '../orderDetails/useOrderDetails';
+import { useOrderStatus } from '../orderStatus/useOrderStatus';
export const useLastOrderTracking = () => {
const {
@@ -41,12 +41,8 @@ export const useLastOrderTracking = () => {
...lastOrder?.data,
},
isLoading:
- isLastOrderLoading ||
- isOrderStatusLoading ||
- isOrderDetailsLoading ||
- isHistoriesLoading,
- error:
- lastOrderError || orderStatusError || orderDetailsError || historiesError,
+ isLastOrderLoading || isOrderStatusLoading || isOrderDetailsLoading || isHistoriesLoading,
+ error: lastOrderError || orderStatusError || orderDetailsError || historiesError,
refetch: async () => {
await refetchLastOrder();
if (orderId) await refetchOrderStatus();
diff --git a/packages/manager/apps/hub/src/data/hooks/notifications/useNotifications.spec.tsx b/packages/manager/apps/hub/src/data/hooks/notifications/useNotifications.spec.tsx
index 3f399c431635..47ee6491c97e 100644
--- a/packages/manager/apps/hub/src/data/hooks/notifications/useNotifications.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/notifications/useNotifications.spec.tsx
@@ -1,8 +1,11 @@
import { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
+
import { aapi as Api } from '@ovh-ux/manager-core-api';
+
import { useFetchHubNotifications } from '@/data/hooks/notifications/useNotifications';
import { ApiEnvelope } from '@/types/apiEnvelope.type';
import { NotificationsList } from '@/types/notifications.type';
@@ -29,9 +32,7 @@ describe('useFetchHubNotifications', () => {
},
status: 'OK',
};
- const getNotifications = vi
- .spyOn(Api, 'get')
- .mockReturnValue(Promise.resolve(notifications));
+ const getNotifications = vi.spyOn(Api, 'get').mockReturnValue(Promise.resolve(notifications));
const { result } = renderHook(() => useFetchHubNotifications(), {
wrapper,
@@ -39,9 +40,7 @@ describe('useFetchHubNotifications', () => {
await waitFor(() => {
expect(getNotifications).toHaveBeenCalled();
- expect(result.current.data).toEqual(
- notifications.data.notifications.data,
- );
+ expect(result.current.data).toEqual(notifications.data.notifications.data);
});
});
});
diff --git a/packages/manager/apps/hub/src/data/hooks/notifications/useNotifications.tsx b/packages/manager/apps/hub/src/data/hooks/notifications/useNotifications.tsx
index 677a69eb9492..d93f08f80366 100644
--- a/packages/manager/apps/hub/src/data/hooks/notifications/useNotifications.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/notifications/useNotifications.tsx
@@ -1,7 +1,8 @@
import { DefinedInitialDataOptions, useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
-import { Notification } from '@/types/notifications.type';
+
import { getNotifications } from '@/data/api/notifications';
+import { Notification } from '@/types/notifications.type';
export const useFetchHubNotifications = (
options?: Partial>,
diff --git a/packages/manager/apps/hub/src/data/hooks/orderCompleteHistory/useOrderCompleteHistory.spec.tsx b/packages/manager/apps/hub/src/data/hooks/orderCompleteHistory/useOrderCompleteHistory.spec.tsx
index 238b49a7d085..45d6e2f0bf36 100644
--- a/packages/manager/apps/hub/src/data/hooks/orderCompleteHistory/useOrderCompleteHistory.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/orderCompleteHistory/useOrderCompleteHistory.spec.tsx
@@ -1,11 +1,14 @@
-import { renderHook, waitFor } from '@testing-library/react';
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
-import { vi, describe, it, expect } from 'vitest';
import { PropsWithChildren } from 'react';
-import { useOrderCompleteHistory } from './useOrderCompleteHistory';
+
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import { getCompleteHistory } from '@/data/api/order/order';
import { OrderHistory } from '@/types/order.type';
+import { useOrderCompleteHistory } from './useOrderCompleteHistory';
+
vi.mock('@/data/api/order/order', () => ({
getCompleteHistory: vi.fn(),
}));
@@ -29,12 +32,9 @@ describe('useOrderCompleteHistory', () => {
];
vi.mocked(getCompleteHistory).mockResolvedValue(mockedHistory);
- const { result } = renderHook(
- () => useOrderCompleteHistory(1, 'processed', '2025-10-22'),
- {
- wrapper,
- },
- );
+ const { result } = renderHook(() => useOrderCompleteHistory(1, 'processed', '2025-10-22'), {
+ wrapper,
+ });
await waitFor(() => !result.current.isLoading);
@@ -47,9 +47,9 @@ describe('useOrderCompleteHistory', () => {
const { result } = renderHook(
() =>
useOrderCompleteHistory(
- (undefined as unknown) as number,
- (undefined as unknown) as string,
- (undefined as unknown) as string,
+ undefined as unknown as number,
+ undefined as unknown as string,
+ undefined as unknown as string,
),
{
wrapper,
diff --git a/packages/manager/apps/hub/src/data/hooks/orderCompleteHistory/useOrderCompleteHistory.tsx b/packages/manager/apps/hub/src/data/hooks/orderCompleteHistory/useOrderCompleteHistory.tsx
index 7001de6e484a..a4fc265999ef 100644
--- a/packages/manager/apps/hub/src/data/hooks/orderCompleteHistory/useOrderCompleteHistory.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/orderCompleteHistory/useOrderCompleteHistory.tsx
@@ -1,5 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getCompleteHistory } from '@/data/api/order/order';
import { NOT_PAID } from '@/data/api/order/order.constants';
import { OrderHistory } from '@/types/order.type';
diff --git a/packages/manager/apps/hub/src/data/hooks/orderDetails/useOrderDetails.spec.tsx b/packages/manager/apps/hub/src/data/hooks/orderDetails/useOrderDetails.spec.tsx
index 114851048fda..852c99452942 100644
--- a/packages/manager/apps/hub/src/data/hooks/orderDetails/useOrderDetails.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/orderDetails/useOrderDetails.spec.tsx
@@ -1,10 +1,12 @@
-import { renderHook, waitFor } from '@testing-library/react';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
-import { vi, describe, it, expect } from 'vitest';
-import { useOrderDetails } from './useOrderDetails';
+import { renderHook, waitFor } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import { getOrderDetails } from '@/data/api/order/order';
import { OrderDetail } from '@/types/order.type';
+import { useOrderDetails } from './useOrderDetails';
+
vi.mock('@/data/api/order/order', () => ({
getOrderDetails: vi.fn(),
}));
@@ -60,9 +62,7 @@ describe('useOrderDetails', () => {
const { result } = renderHook(() => useOrderDetails(1), {
wrapper: ({ children }) => (
-
- {children}
-
+ {children}
),
});
@@ -74,16 +74,11 @@ describe('useOrderDetails', () => {
});
it('should not run the query when orderId is undefined', async () => {
- const { result } = renderHook(
- () => useOrderDetails((undefined as unknown) as number),
- {
- wrapper: ({ children }) => (
-
- {children}
-
- ),
- },
- );
+ const { result } = renderHook(() => useOrderDetails(undefined as unknown as number), {
+ wrapper: ({ children }) => (
+ {children}
+ ),
+ });
expect(result.current.data).toBeUndefined();
expect(result.current.isLoading).toBe(false);
diff --git a/packages/manager/apps/hub/src/data/hooks/orderDetails/useOrderDetails.tsx b/packages/manager/apps/hub/src/data/hooks/orderDetails/useOrderDetails.tsx
index 5c0e52a58ce5..4ba6be24375a 100644
--- a/packages/manager/apps/hub/src/data/hooks/orderDetails/useOrderDetails.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/orderDetails/useOrderDetails.tsx
@@ -1,5 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getOrderDetails } from '@/data/api/order/order';
import { OrderDetail } from '@/types/order.type';
diff --git a/packages/manager/apps/hub/src/data/hooks/orderStatus/useOrderStatus.spec.tsx b/packages/manager/apps/hub/src/data/hooks/orderStatus/useOrderStatus.spec.tsx
index 647ccdffc10f..9d6ebdbebbd1 100644
--- a/packages/manager/apps/hub/src/data/hooks/orderStatus/useOrderStatus.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/orderStatus/useOrderStatus.spec.tsx
@@ -1,10 +1,13 @@
-import { renderHook, waitFor } from '@testing-library/react';
-import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
-import { vi, describe, it, expect } from 'vitest';
import { PropsWithChildren } from 'react';
-import { useOrderStatus } from './useOrderStatus';
+
+import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import { getOrderStatus } from '@/data/api/order/order';
+import { useOrderStatus } from './useOrderStatus';
+
vi.mock('@/data/api/order/order', () => ({
getOrderStatus: vi.fn(),
}));
@@ -37,12 +40,9 @@ describe('useOrderStatus', () => {
});
it('should not run the query when orderId is undefined', async () => {
- const { result } = renderHook(
- () => useOrderStatus((undefined as unknown) as number),
- {
- wrapper,
- },
- );
+ const { result } = renderHook(() => useOrderStatus(undefined as unknown as number), {
+ wrapper,
+ });
expect(result.current.data).toBeUndefined();
expect(result.current.isLoading).toBe(false);
diff --git a/packages/manager/apps/hub/src/data/hooks/orderStatus/useOrderStatus.tsx b/packages/manager/apps/hub/src/data/hooks/orderStatus/useOrderStatus.tsx
index 40c496bb779e..df4ce2b1eac2 100644
--- a/packages/manager/apps/hub/src/data/hooks/orderStatus/useOrderStatus.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/orderStatus/useOrderStatus.tsx
@@ -1,5 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getOrderStatus } from '@/data/api/order/order';
import { OrderStatus } from '@/types/order.type';
diff --git a/packages/manager/apps/hub/src/data/hooks/roadmapChangelog/useRoadmapChangelog.spec.tsx b/packages/manager/apps/hub/src/data/hooks/roadmapChangelog/useRoadmapChangelog.spec.tsx
index 3ec604ef0b60..527e4fbab529 100644
--- a/packages/manager/apps/hub/src/data/hooks/roadmapChangelog/useRoadmapChangelog.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/roadmapChangelog/useRoadmapChangelog.spec.tsx
@@ -1,11 +1,14 @@
import { PropsWithChildren } from 'react';
+
import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
+
import { aapi as Api } from '@ovh-ux/manager-core-api';
+
+import { ReactQueryWrapper } from '@/__mocks__/ReactQueryWrapper';
import { useRoadmapChangelog } from '@/data/hooks/roadmapChangelog/useRoadmapChangelog';
import { ApiEnvelope } from '@/types/apiEnvelope.type';
import { RoadmapChangelogResponse } from '@/types/roadmapchangelog.type';
-import { ReactQueryWrapper } from '@/__mocks__/ReactQueryWrapper';
const wrapper = ({ children }: PropsWithChildren) => (
{children}
diff --git a/packages/manager/apps/hub/src/data/hooks/roadmapChangelog/useRoadmapChangelog.ts b/packages/manager/apps/hub/src/data/hooks/roadmapChangelog/useRoadmapChangelog.ts
index f51862798daa..9c71da3f7fbb 100644
--- a/packages/manager/apps/hub/src/data/hooks/roadmapChangelog/useRoadmapChangelog.ts
+++ b/packages/manager/apps/hub/src/data/hooks/roadmapChangelog/useRoadmapChangelog.ts
@@ -1,5 +1,6 @@
import { useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getRoadmapChangelog } from '@/data/api/roadmapChangelog';
import { RoadmapChangelogResponse } from '@/types/roadmapchangelog.type';
diff --git a/packages/manager/apps/hub/src/data/hooks/services/useServices.spec.tsx b/packages/manager/apps/hub/src/data/hooks/services/useServices.spec.tsx
index 57129beed8d8..8b391254781b 100644
--- a/packages/manager/apps/hub/src/data/hooks/services/useServices.spec.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/services/useServices.spec.tsx
@@ -1,9 +1,11 @@
import React, { PropsWithChildren } from 'react';
-import { renderHook, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
-import { useFetchHubServices } from '@/data/hooks/services/useServices';
+
import * as ServicesApi from '@/data/api/services';
+import { useFetchHubServices } from '@/data/hooks/services/useServices';
import { ApiEnvelope } from '@/types/apiEnvelope.type';
import { ProductList } from '@/types/services.type';
diff --git a/packages/manager/apps/hub/src/data/hooks/services/useServices.tsx b/packages/manager/apps/hub/src/data/hooks/services/useServices.tsx
index ff421d70b650..50e1eface4d4 100644
--- a/packages/manager/apps/hub/src/data/hooks/services/useServices.tsx
+++ b/packages/manager/apps/hub/src/data/hooks/services/useServices.tsx
@@ -1,8 +1,9 @@
import { useQuery } from '@tanstack/react-query';
import { AxiosError } from 'axios';
+
import { getServices } from '@/data/api/services';
-import { ProductList } from '@/types/services.type';
import { ApiEnvelope } from '@/types/apiEnvelope.type';
+import { ProductList } from '@/types/services.type';
export const useFetchHubServices = () =>
useQuery, AxiosError>({
diff --git a/packages/manager/apps/hub/src/hooks/dateFormat/useDateFormat.spec.tsx b/packages/manager/apps/hub/src/hooks/dateFormat/useDateFormat.spec.tsx
index ee85ad042cca..1675b1b2aeee 100644
--- a/packages/manager/apps/hub/src/hooks/dateFormat/useDateFormat.spec.tsx
+++ b/packages/manager/apps/hub/src/hooks/dateFormat/useDateFormat.spec.tsx
@@ -1,6 +1,8 @@
-import { renderHook } from '@testing-library/react';
import React from 'react';
+
+import { renderHook } from '@testing-library/react';
import { vi } from 'vitest';
+
import useDateFormat from './useDateFormat';
const mocks = vi.hoisted(() => ({
diff --git a/packages/manager/apps/hub/src/hooks/dateFormat/useDateFormat.tsx b/packages/manager/apps/hub/src/hooks/dateFormat/useDateFormat.tsx
index c27bfbc558db..7abc14cef561 100644
--- a/packages/manager/apps/hub/src/hooks/dateFormat/useDateFormat.tsx
+++ b/packages/manager/apps/hub/src/hooks/dateFormat/useDateFormat.tsx
@@ -1,6 +1,7 @@
-import { ShellContext } from '@ovh-ux/manager-react-shell-client';
import React, { useContext } from 'react';
+import { ShellContext } from '@ovh-ux/manager-react-shell-client';
+
type Props = {
options?: Intl.DateTimeFormatOptions;
};
diff --git a/packages/manager/apps/hub/src/hooks/guideUtils/useGuideUtils.spec.tsx b/packages/manager/apps/hub/src/hooks/guideUtils/useGuideUtils.spec.tsx
index 848fbfe02fb2..3331304a80ad 100644
--- a/packages/manager/apps/hub/src/hooks/guideUtils/useGuideUtils.spec.tsx
+++ b/packages/manager/apps/hub/src/hooks/guideUtils/useGuideUtils.spec.tsx
@@ -1,6 +1,8 @@
-import { renderHook, waitFor } from '@testing-library/react';
import React from 'react';
+
+import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
+
import useGuideUtils from './useGuideUtils';
import { GUIDE_LIST } from './useGuideUtils.constants';
diff --git a/packages/manager/apps/hub/src/hooks/guideUtils/useGuideUtils.tsx b/packages/manager/apps/hub/src/hooks/guideUtils/useGuideUtils.tsx
index ea8132a4c147..5a08a2705801 100644
--- a/packages/manager/apps/hub/src/hooks/guideUtils/useGuideUtils.tsx
+++ b/packages/manager/apps/hub/src/hooks/guideUtils/useGuideUtils.tsx
@@ -1,6 +1,8 @@
-import { ShellContext } from '@ovh-ux/manager-react-shell-client';
import { useContext, useEffect, useState } from 'react';
+
import { CountryCode } from '@ovh-ux/manager-config';
+import { ShellContext } from '@ovh-ux/manager-react-shell-client';
+
import { GUIDE_LIST } from './useGuideUtils.constants';
type GetGuideLinkProps = {
diff --git a/packages/manager/apps/hub/src/hooks/guides/useGuideUtils.tsx b/packages/manager/apps/hub/src/hooks/guides/useGuideUtils.tsx
index e81852be2f65..c4bffbe5dcf8 100644
--- a/packages/manager/apps/hub/src/hooks/guides/useGuideUtils.tsx
+++ b/packages/manager/apps/hub/src/hooks/guides/useGuideUtils.tsx
@@ -1,4 +1,5 @@
import { useContext, useEffect, useState } from 'react';
+
import { CountryCode } from '@ovh-ux/manager-config';
import { ShellContext } from '@ovh-ux/manager-react-shell-client';
@@ -7,9 +8,7 @@ type GetGuideLinkProps = {
subsidiary: CountryCode | string;
};
-function useGuideUtils(
- guides: Record>>,
-) {
+function useGuideUtils(guides: Record>>) {
const { shell } = useContext(ShellContext);
const { environment } = shell;
const [list, setList] = useState({});
@@ -19,8 +18,7 @@ function useGuideUtils(
return keys.reduce>(
(links, key: string) => ({
...links,
- [key]:
- guides[key][subsidiary as CountryCode] ?? guides[key][CountryCode.GB],
+ [key]: guides[key][subsidiary as CountryCode] ?? guides[key][CountryCode.GB],
}),
{} as Record,
);
diff --git a/packages/manager/apps/hub/src/hooks/priceFormat/usePriceFormat.tsx b/packages/manager/apps/hub/src/hooks/priceFormat/usePriceFormat.tsx
index 331c9bd7fbba..968b40a6fe1d 100644
--- a/packages/manager/apps/hub/src/hooks/priceFormat/usePriceFormat.tsx
+++ b/packages/manager/apps/hub/src/hooks/priceFormat/usePriceFormat.tsx
@@ -1,4 +1,5 @@
import { useContext } from 'react';
+
import { ShellContext } from '@ovh-ux/manager-react-shell-client';
export const usePriceFormat = (price: number, currency: string) => {
diff --git a/packages/manager/apps/hub/src/hooks/products/useProducts.spec.tsx b/packages/manager/apps/hub/src/hooks/products/useProducts.spec.tsx
index 27ed4b91244f..af6586a57460 100644
--- a/packages/manager/apps/hub/src/hooks/products/useProducts.spec.tsx
+++ b/packages/manager/apps/hub/src/hooks/products/useProducts.spec.tsx
@@ -1,17 +1,20 @@
import React, { PropsWithChildren } from 'react';
+
import { renderHook, waitFor } from '@testing-library/react';
import { describe, it, vi } from 'vitest';
+
import {
ShellContext,
ShellContextType,
useRouteSynchro,
} from '@ovh-ux/manager-react-shell-client';
-import { useProducts } from '@/hooks/products/useProducts';
+
import {
lotsOfProductsMocked,
lotsOfProductsParsedExpandedMocked,
lotsOfProductsParsedMocked,
} from '@/__mocks__/products';
+import { useProducts } from '@/hooks/products/useProducts';
const shellContext = {
environment: {
@@ -25,19 +28,16 @@ const shellContext = {
};
const wrapper = ({ children }: PropsWithChildren) => (
-
+
{children}
);
describe('useProducts', () => {
it('returns non expanded products list', async () => {
- const { result } = renderHook(
- () => useProducts(lotsOfProductsMocked, false),
- {
- wrapper,
- },
- );
+ const { result } = renderHook(() => useProducts(lotsOfProductsMocked, false), {
+ wrapper,
+ });
await waitFor(() => {
expect(result.current.products).toEqual(lotsOfProductsParsedMocked);
@@ -45,17 +45,12 @@ describe('useProducts', () => {
});
it('returns expanded products list', async () => {
- const { result } = renderHook(
- () => useProducts(lotsOfProductsMocked, true),
- {
- wrapper,
- },
- );
+ const { result } = renderHook(() => useProducts(lotsOfProductsMocked, true), {
+ wrapper,
+ });
await waitFor(() => {
- expect(result.current.products).toEqual(
- lotsOfProductsParsedExpandedMocked,
- );
+ expect(result.current.products).toEqual(lotsOfProductsParsedExpandedMocked);
});
});
@@ -86,8 +81,7 @@ describe('useProducts', () => {
EU: 'dedicated',
US: 'dedicated',
},
- url:
- 'https://www.ovh.com/manager/#/dedicated/configuration/fake_product/fake_service',
+ url: 'https://www.ovh.com/manager/#/dedicated/configuration/fake_product/fake_service',
},
],
},
diff --git a/packages/manager/apps/hub/src/hooks/products/useProducts.ts b/packages/manager/apps/hub/src/hooks/products/useProducts.ts
index f8f6f3274eb8..f6acb6915ab6 100644
--- a/packages/manager/apps/hub/src/hooks/products/useProducts.ts
+++ b/packages/manager/apps/hub/src/hooks/products/useProducts.ts
@@ -1,11 +1,13 @@
import { useContext } from 'react';
+
import { ShellContext } from '@ovh-ux/manager-react-shell-client';
-import { HubProduct, ProductList } from '@/types/services.type';
+
import {
DEFAULT_DISPLAYED_PRODUCTS,
DEFAULT_DISPLAYED_SERVICES,
productListingPages,
} from '@/components/products/Products.constants';
+import { HubProduct, ProductList } from '@/types/services.type';
export const useProducts = (services: ProductList, expand = false) => {
const { shell } = useContext(ShellContext);
@@ -18,19 +20,14 @@ export const useProducts = (services: ProductList, expand = false) => {
hash: null,
};
return {
- data: servicesByProducts[name].data.slice(
- 0,
- DEFAULT_DISPLAYED_SERVICES,
- ),
+ data: servicesByProducts[name].data.slice(0, DEFAULT_DISPLAYED_SERVICES),
count: servicesByProducts[name].count,
type: name,
formattedType: name.toLowerCase().replace(/_/g, '-'),
// Link to product page should be done on the BFF side
link:
application && hash
- ? (shell.navigation.getURL(application, hash, {}) as Promise<
- string
- >)
+ ? (shell.navigation.getURL(application, hash, {}) as Promise)
: null,
};
})
diff --git a/packages/manager/apps/hub/src/hooks/roadmapChangelog/useRoadmapChangelogData.tsx b/packages/manager/apps/hub/src/hooks/roadmapChangelog/useRoadmapChangelogData.tsx
index 4eec44eee1a6..f82fb11aee5a 100644
--- a/packages/manager/apps/hub/src/hooks/roadmapChangelog/useRoadmapChangelogData.tsx
+++ b/packages/manager/apps/hub/src/hooks/roadmapChangelog/useRoadmapChangelogData.tsx
@@ -1,14 +1,17 @@
import { useTranslation } from 'react-i18next';
+
import { OsdsSkeleton } from '@ovhcloud/ods-components/react';
+
import { DatagridColumn } from '@ovh-ux/manager-react-components';
-import { RoadmapChangelogItem } from '@/types/roadmapchangelog.type';
+
import {
- RoadmapChangelogItemProductCell,
- RoadmapChangelogItemTitleCell,
RoadmapChangelogItemDescriptionCell,
+ RoadmapChangelogItemProductCell,
RoadmapChangelogItemReleaseDateCell,
RoadmapChangelogItemStatusCell,
+ RoadmapChangelogItemTitleCell,
} from '@/components/roadmap-changelog-datagrid/cells';
+import { RoadmapChangelogItem } from '@/types/roadmapchangelog.type';
export const useRoadmapChangelogData = (isLoadingItems: boolean) => {
const { t } = useTranslation('changelog');
@@ -33,51 +36,31 @@ export const useRoadmapChangelogData = (isLoadingItems: boolean) => {
id: 'product',
label: t('datagrid_table_head_product'),
cell: (item: RoadmapChangelogItem) =>
- isLoadingItems ? (
-
- ) : (
-
- ),
+ isLoadingItems ? : ,
},
{
id: 'changelog',
label: t('datagrid_table_head_changelog'),
cell: (item: RoadmapChangelogItem) =>
- isLoadingItems ? (
-
- ) : (
-
- ),
+ isLoadingItems ? : ,
},
{
id: 'description',
label: t('datagrid_table_head_link'),
cell: (item: RoadmapChangelogItem) =>
- isLoadingItems ? (
-
- ) : (
-
- ),
+ isLoadingItems ? : ,
},
{
id: 'realease_date',
label: t('datagrid_table_head_release_date'),
cell: (item: RoadmapChangelogItem) =>
- isLoadingItems ? (
-
- ) : (
-
- ),
+ isLoadingItems ? : ,
},
{
id: 'status',
label: t('datagrid_table_head_status'),
cell: (item: RoadmapChangelogItem) =>
- isLoadingItems ? (
-
- ) : (
-
- ),
+ isLoadingItems ? : ,
},
];
diff --git a/packages/manager/apps/hub/src/hooks/useHubNavigation/useHubNavigation.ts b/packages/manager/apps/hub/src/hooks/useHubNavigation/useHubNavigation.ts
index 4963a6f81944..5861ceb9991b 100644
--- a/packages/manager/apps/hub/src/hooks/useHubNavigation/useHubNavigation.ts
+++ b/packages/manager/apps/hub/src/hooks/useHubNavigation/useHubNavigation.ts
@@ -1,16 +1,13 @@
import { useResolvedPath } from 'react-router-dom';
-import { useNavigationGetUrl } from '@ovh-ux/manager-react-shell-client';
+
import { UseQueryResult } from '@tanstack/react-query';
+
+import { useNavigationGetUrl } from '@ovh-ux/manager-react-shell-client';
+
import config from '@/hub.config';
-export const useHubNavigation = (
- path: string,
-): UseQueryResult => {
+export const useHubNavigation = (path: string): UseQueryResult => {
const resolvedPath = useResolvedPath(path).pathname;
- return useNavigationGetUrl([
- config.rootLabel,
- resolvedPath,
- {},
- ]) as UseQueryResult;
+ return useNavigationGetUrl([config.rootLabel, resolvedPath, {}]) as UseQueryResult;
};
diff --git a/packages/manager/apps/hub/src/index.tsx b/packages/manager/apps/hub/src/index.tsx
index 720321f26570..4e8b06342cb3 100644
--- a/packages/manager/apps/hub/src/index.tsx
+++ b/packages/manager/apps/hub/src/index.tsx
@@ -1,18 +1,17 @@
import React from 'react';
+
import ReactDOM from 'react-dom/client';
-import {
- ShellContext,
- initShellContext,
- initI18n,
-} from '@ovh-ux/manager-react-shell-client';
+
+import '@ovhcloud/ods-theme-blue-jeans/dist/index.css';
+
import { isTopLevelApplication } from '@ovh-ux/manager-config';
+import { ShellContext, initI18n, initShellContext } from '@ovh-ux/manager-react-shell-client';
+
import App from './App';
-import '@ovhcloud/ods-theme-blue-jeans/dist/index.css';
import './index.scss';
+import { APP_NAME, LEVEL2, SUB_UNIVERSE, UNIVERSE } from './tracking.constant';
import './vite-hmr';
-import { UNIVERSE, SUB_UNIVERSE, APP_NAME, LEVEL2 } from './tracking.constant';
-
const trackingContext = {
chapter1: UNIVERSE,
chapter2: SUB_UNIVERSE,
diff --git a/packages/manager/apps/hub/src/pages/404.tsx b/packages/manager/apps/hub/src/pages/404.tsx
index 46ab24c17b1d..520f7310cb5d 100644
--- a/packages/manager/apps/hub/src/pages/404.tsx
+++ b/packages/manager/apps/hub/src/pages/404.tsx
@@ -1,6 +1,9 @@
import React, { useContext } from 'react';
+
import { Navigate } from 'react-router-dom';
+
import { ShellContext } from '@ovh-ux/manager-react-shell-client';
+
import { BILLING_REDIRECTIONS, CATALOG_URL_REGEX } from '@/hub.constants';
export default function NotFound() {
@@ -10,11 +13,9 @@ export default function NotFound() {
for (let index = 0; index < BILLING_REDIRECTIONS.length; index += 1) {
const redirectionRegex = BILLING_REDIRECTIONS[index];
if (redirectionRegex.test(hash)) {
- shell.navigation
- .getURL('dedicated', window.location.hash, {})
- .then((url: string) => {
- window.top.location.href = url;
- });
+ shell.navigation.getURL('dedicated', window.location.hash, {}).then((url: string) => {
+ window.top.location.href = url;
+ });
}
}
if (CATALOG_URL_REGEX.test(hash)) {
diff --git a/packages/manager/apps/hub/src/pages/changelog/Changelog.tsx b/packages/manager/apps/hub/src/pages/changelog/Changelog.tsx
index fbfa1a589657..503f231f4559 100644
--- a/packages/manager/apps/hub/src/pages/changelog/Changelog.tsx
+++ b/packages/manager/apps/hub/src/pages/changelog/Changelog.tsx
@@ -1,35 +1,33 @@
-import { useContext, useState, useEffect } from 'react';
-import { BaseLayout, HeadersProps } from '@ovh-ux/manager-react-components';
-import { useTranslation, Trans } from 'react-i18next';
-import {
- OsdsText,
- OsdsLink,
- OsdsIcon,
- OsdsBreadcrumb,
- OsdsTabBarItem,
- OsdsTabPanel,
- OsdsTabs,
- OsdsTabBar,
- OsdsTile,
-} from '@ovhcloud/ods-components/react';
+import { useContext, useEffect, useState } from 'react';
+
+import { Trans, useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
ODS_ICON_NAME,
ODS_ICON_SIZE,
+ ODS_TABS_SIZE,
ODS_TEXT_COLOR_HUE,
ODS_TEXT_LEVEL,
ODS_TEXT_SIZE,
- ODS_TABS_SIZE,
OdsBreadcrumbAttributeItem,
} from '@ovhcloud/ods-components';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
-import {
- OdsHTMLAnchorElementRel,
- OdsHTMLAnchorElementTarget,
-} from '@ovhcloud/ods-common-core';
import {
- ShellContext,
- useOvhTracking,
-} from '@ovh-ux/manager-react-shell-client';
+ OsdsBreadcrumb,
+ OsdsIcon,
+ OsdsLink,
+ OsdsTabBar,
+ OsdsTabBarItem,
+ OsdsTabPanel,
+ OsdsTabs,
+ OsdsText,
+ OsdsTile,
+} from '@ovhcloud/ods-components/react';
+
+import { BaseLayout, HeadersProps } from '@ovh-ux/manager-react-components';
+import { ShellContext, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import { EXTERNAL_LINKS } from '@/changelog.constants';
import RoadmapChangelogDatagrids from '@/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids';
import { useHubNavigation } from '@/hooks/useHubNavigation/useHubNavigation';
@@ -70,14 +68,9 @@ export default function Changelog() {
data-testid="roadmap-changelog-page"
>
-
}
- >
+
}>
-
+
{t('changelog_roadmap_cloud_tab')}
@@ -201,9 +191,7 @@ export default function Changelog() {
color={ODS_THEME_COLOR_INTENT.primary}
href={EXTERNAL_LINKS.PUBLIC_CLOUD_ROADMAP.url}
onClick={() => {
- trackClick(
- EXTERNAL_LINKS.PUBLIC_CLOUD_ROADMAP.tracking,
- );
+ trackClick(EXTERNAL_LINKS.PUBLIC_CLOUD_ROADMAP.tracking);
}}
data-testid="changelog-public-cloud-link"
>
@@ -260,11 +248,7 @@ export default function Changelog() {
hue={ODS_TEXT_COLOR_HUE._400}
className="color-[var(--ods-color-default-500)]"
>
- {t(
- `changelog_infra_product_list${
- isRegionUS ? '_us' : ''
- }`,
- )}
+ {t(`changelog_infra_product_list${isRegionUS ? '_us' : ''}`)}
@@ -288,9 +272,7 @@ export default function Changelog() {
color={ODS_THEME_COLOR_INTENT.primary}
href={EXTERNAL_LINKS.PRIVATE_CLOUD_ROADMAP.url}
onClick={() => {
- trackClick(
- EXTERNAL_LINKS.PRIVATE_CLOUD_ROADMAP.tracking,
- );
+ trackClick(EXTERNAL_LINKS.PRIVATE_CLOUD_ROADMAP.tracking);
}}
>
{t(EXTERNAL_LINKS.PRIVATE_CLOUD_ROADMAP.label_key)}
@@ -311,11 +293,7 @@ export default function Changelog() {
hue={ODS_TEXT_COLOR_HUE._400}
className="color-[var(--ods-color-default-500)]"
>
- {t(
- `changelog_private_cloud_product_list${
- isRegionUS ? '_us' : ''
- }`,
- )}
+ {t(`changelog_private_cloud_product_list${isRegionUS ? '_us' : ''}`)}
@@ -339,9 +317,7 @@ export default function Changelog() {
color={ODS_THEME_COLOR_INTENT.primary}
href={EXTERNAL_LINKS.SECURITY_ROADMAP.url}
onClick={() => {
- trackClick(
- EXTERNAL_LINKS.SECURITY_ROADMAP.tracking,
- );
+ trackClick(EXTERNAL_LINKS.SECURITY_ROADMAP.tracking);
}}
>
{t(EXTERNAL_LINKS.SECURITY_ROADMAP.label_key)}
@@ -416,9 +392,7 @@ export default function Changelog() {
color={ODS_THEME_COLOR_INTENT.primary}
href={EXTERNAL_LINKS.DOMAIN_ROADMAP.url}
onClick={() => {
- trackClick(
- EXTERNAL_LINKS.DOMAIN_ROADMAP.tracking,
- );
+ trackClick(EXTERNAL_LINKS.DOMAIN_ROADMAP.tracking);
}}
>
{t(EXTERNAL_LINKS.DOMAIN_ROADMAP.label_key)}
@@ -453,9 +427,7 @@ export default function Changelog() {
color={ODS_THEME_COLOR_INTENT.primary}
href={EXTERNAL_LINKS.COLLAB_ROADMAP.url}
onClick={() => {
- trackClick(
- EXTERNAL_LINKS.COLLAB_ROADMAP.tracking,
- );
+ trackClick(EXTERNAL_LINKS.COLLAB_ROADMAP.tracking);
}}
>
{t(EXTERNAL_LINKS.COLLAB_ROADMAP.label_key)}
diff --git a/packages/manager/apps/hub/src/pages/changelog/changelog.spec.tsx b/packages/manager/apps/hub/src/pages/changelog/changelog.spec.tsx
index 37345e36a25d..2c84aea8e84f 100644
--- a/packages/manager/apps/hub/src/pages/changelog/changelog.spec.tsx
+++ b/packages/manager/apps/hub/src/pages/changelog/changelog.spec.tsx
@@ -1,21 +1,17 @@
-import { describe, expect, it, vi } from 'vitest';
import { act, fireEvent, render } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
import * as reactShellClientModule from '@ovh-ux/manager-react-shell-client';
-import {
- ShellContext,
- ShellContextType,
-} from '@ovh-ux/manager-react-shell-client';
+import { ShellContext, ShellContextType } from '@ovh-ux/manager-react-shell-client';
+
import Changelog from './Changelog';
const trackClickMock = vi.fn();
const trackPageMock = vi.fn();
-vi.mock(
- '@/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids',
- () => ({
- default: () => datagrid,
- }),
-);
+vi.mock('@/components/roadmap-changelog-datagrid/RoadmapChangelogDatagrids', () => ({
+ default: () => datagrid,
+}));
vi.mock('@/hooks/useHubNavigation/useHubNavigation', () => ({
useHubNavigation: vi.fn(() => ({
@@ -60,9 +56,7 @@ vi.mock('@ovh-ux/manager-react-shell-client', async (importOriginal) => {
const renderComponent = () =>
render(
-
+
,
);
diff --git a/packages/manager/apps/hub/src/pages/dashboard/BillingSummary.component.tsx b/packages/manager/apps/hub/src/pages/dashboard/BillingSummary.component.tsx
index dfc3f14291f4..8cfc64b901aa 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/BillingSummary.component.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/BillingSummary.component.tsx
@@ -1,17 +1,11 @@
-import React, { lazy, Suspense, useContext, useMemo, useState } from 'react';
-import {
- OsdsIcon,
- OsdsLink,
- OsdsSelect,
- OsdsSelectOption,
- OsdsSkeleton,
- OsdsText,
-} from '@ovhcloud/ods-components/react';
-import {
- ShellContext,
- useOvhTracking,
-} from '@ovh-ux/manager-react-shell-client';
+import React, { Suspense, lazy, useContext, useMemo, useState } from 'react';
+
+import { Await } from 'react-router-dom';
+
import { useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
ODS_ICON_NAME,
ODS_ICON_SIZE,
@@ -19,23 +13,26 @@ import {
ODS_TEXT_LEVEL,
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
- OdsHTMLAnchorElementRel,
- OdsHTMLAnchorElementTarget,
-} from '@ovhcloud/ods-common-core';
-import { Await } from 'react-router-dom';
+ OsdsIcon,
+ OsdsLink,
+ OsdsSelect,
+ OsdsSelectOption,
+ OsdsSkeleton,
+ OsdsText,
+} from '@ovhcloud/ods-components/react';
+
+import { ShellContext, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import { useFetchHubBills } from '@/data/hooks/bills/useBills';
import { useFetchHubDebt } from '@/data/hooks/debt/useDebt';
-import '@/pages/dashboard/BillingSummary.style.scss';
-import { BILLING_SUMMARY_PERIODS_IN_MONTHS } from '@/pages/dashboard/dashboard.constants';
import { usePeriodFilter } from '@/hooks/periodFilter/usePeriodFilter';
import { usePriceFormat } from '@/hooks/priceFormat/usePriceFormat';
+import '@/pages/dashboard/BillingSummary.style.scss';
import { useHubContext } from '@/pages/dashboard/context';
+import { BILLING_SUMMARY_PERIODS_IN_MONTHS } from '@/pages/dashboard/dashboard.constants';
-const TileError = lazy(() =>
- import('@/components/tile-error/TileError.component'),
-);
+const TileError = lazy(() => import('@/components/tile-error/TileError.component'));
export default function BillingSummary() {
const { t } = useTranslation('hub/billing');
@@ -59,10 +56,7 @@ export default function BillingSummary() {
const isDataLoading = isLoading || areBillsLoading || isDebtLoading;
const formattedPrice = usePriceFormat(bills?.total, bills?.currency?.code);
- const formattedDebtPrice = usePriceFormat(
- debt?.dueAmount?.value,
- debt?.dueAmount?.currencyCode,
- );
+ const formattedDebtPrice = usePriceFormat(debt?.dueAmount?.value, debt?.dueAmount?.currencyCode);
const payDebtLink = useMemo(
() => navigation.getURL('dedicated', '#/billing/history/debt/all/pay', {}),
@@ -73,9 +67,7 @@ export default function BillingSummary() {
() =>
navigation.getURL('dedicated', '#/billing/history', {
// From BFF's code, it seems that period cannot be null or undefined, so this code could probably be simplified
- filter: bills?.period
- ? JSON.stringify(usePeriodFilter(bills.period))
- : '',
+ filter: bills?.period ? JSON.stringify(usePeriodFilter(bills.period)) : '',
}),
[bills?.period],
);
@@ -89,10 +81,7 @@ export default function BillingSummary() {
return (
(isDataLoading || !isFreshCustomer) && (
-
+
{!isDataLoading && billsError && (
- }
- >
+ }>
- setMonths(Number(event.detail.value as string))
- }
+ onOdsValueChange={(event) => setMonths(Number(event.detail.value as string))}
>
{BILLING_SUMMARY_PERIODS_IN_MONTHS.map((month) => (
-
- {t('hub_billing_summary_debt_null')}
-
+ {t('hub_billing_summary_debt_null')}
)}
{debt?.dueAmount?.value > 0 && (
@@ -177,11 +160,7 @@ export default function BillingSummary() {
debt: formattedDebtPrice,
})}
-
- }
- >
+
}>
(
@@ -202,9 +181,7 @@ export default function BillingSummary() {
)}
{bills?.total === 0 && t('hub_billing_summary_debt_no_bills')}
- }
- >
+ }>
(
diff --git a/packages/manager/apps/hub/src/pages/dashboard/Catalog.component.tsx b/packages/manager/apps/hub/src/pages/dashboard/Catalog.component.tsx
index 1e72edd6e152..86c4051291be 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/Catalog.component.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/Catalog.component.tsx
@@ -1,18 +1,18 @@
+import React from 'react';
+
import { useTranslation } from 'react-i18next';
-import { Card } from '@ovh-ux/manager-react-components';
-import { useOvhTracking } from '@ovh-ux/manager-react-shell-client';
-import { OsdsText } from '@ovhcloud/ods-components/react';
+
import {
ODS_THEME_COLOR_HUE,
ODS_THEME_COLOR_INTENT,
ODS_THEME_TYPOGRAPHY_LEVEL,
} from '@ovhcloud/ods-common-theming';
-import {
- ODS_TEXT_COLOR_HUE,
- ODS_TEXT_LEVEL,
- ODS_TEXT_SIZE,
-} from '@ovhcloud/ods-components';
-import React from 'react';
+import { ODS_TEXT_COLOR_HUE, ODS_TEXT_LEVEL, ODS_TEXT_SIZE } from '@ovhcloud/ods-components';
+import { OsdsText } from '@ovhcloud/ods-components/react';
+
+import { Card } from '@ovh-ux/manager-react-components';
+import { useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import TileGridSkeleton from '@/components/tile-grid-skeleton/TileGridSkeleton.component';
import { useFetchHubCatalog } from '@/data/hooks/catalog/useCatalog';
import { CatalogItem } from '@/types/catalog';
@@ -61,10 +61,7 @@ export default function Catalog() {
{Object.keys(catalog).map((category) => {
const items = catalog[category];
return (
-
+
- trackProductOrder(category, item.productName)
- }
+ onClick={() => trackProductOrder(category, item.productName)}
/>
))}
diff --git a/packages/manager/apps/hub/src/pages/dashboard/EnterpriseBillingSummary.component.tsx b/packages/manager/apps/hub/src/pages/dashboard/EnterpriseBillingSummary.component.tsx
index 920770d4ca26..45ec7ef3875d 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/EnterpriseBillingSummary.component.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/EnterpriseBillingSummary.component.tsx
@@ -1,20 +1,21 @@
import React from 'react';
-import { OsdsIcon, OsdsLink, OsdsText } from '@ovhcloud/ods-components/react';
-import { useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import { useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
ODS_ICON_NAME,
ODS_ICON_SIZE,
ODS_TEXT_LEVEL,
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
-import {
- OdsHTMLAnchorElementRel,
- OdsHTMLAnchorElementTarget,
-} from '@ovhcloud/ods-common-core';
-import { LINK } from '@/pages/dashboard/dashboard.constants';
+import { OsdsIcon, OsdsLink, OsdsText } from '@ovhcloud/ods-components/react';
+
+import { useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import '@/pages/dashboard/BillingSummary.style.scss';
+import { LINK } from '@/pages/dashboard/dashboard.constants';
export default function EnterpriseBillingSummary() {
const { t } = useTranslation('hub/billing');
@@ -28,10 +29,7 @@ export default function EnterpriseBillingSummary() {
};
return (
-
+
{t('hub_enterprise_billing_summary_goto')}
-
+
diff --git a/packages/manager/apps/hub/src/pages/dashboard/HubDashboardSubtitle.tsx b/packages/manager/apps/hub/src/pages/dashboard/HubDashboardSubtitle.tsx
index e89678459f78..ca8b068290a1 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/HubDashboardSubtitle.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/HubDashboardSubtitle.tsx
@@ -1,13 +1,16 @@
import React from 'react';
-import { OsdsSkeleton, OsdsText } from '@ovhcloud/ods-components/react';
+
+import { useTranslation } from 'react-i18next';
+
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
+ ODS_SKELETON_SIZE,
ODS_TEXT_COLOR_HUE,
ODS_TEXT_LEVEL,
ODS_TEXT_SIZE,
- ODS_SKELETON_SIZE,
} from '@ovhcloud/ods-components';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
-import { useTranslation } from 'react-i18next';
+import { OsdsSkeleton, OsdsText } from '@ovhcloud/ods-components/react';
+
import { useHubContext } from '@/pages/dashboard/context';
export default function HubDashboardSubtitle() {
@@ -17,11 +20,7 @@ export default function HubDashboardSubtitle() {
return (
{isLoading ? (
-
+
) : (
!isFreshCustomer && (
{t(`kyc_fraud_${data.status}_banner_text`)}
{link && (
-
- }
- >
+ }>
(
diff --git a/packages/manager/apps/hub/src/pages/dashboard/KycIndiaBanner.component.tsx b/packages/manager/apps/hub/src/pages/dashboard/KycIndiaBanner.component.tsx
index 61ce35a29447..8d03b1f86332 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/KycIndiaBanner.component.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/KycIndiaBanner.component.tsx
@@ -1,30 +1,20 @@
import { Suspense, useContext, useEffect, useMemo } from 'react';
+
import { Await } from 'react-router-dom';
+
import { useTranslation } from 'react-i18next';
-import {
- OdsHTMLAnchorElementRel,
- OdsHTMLAnchorElementTarget,
-} from '@ovhcloud/ods-common-core';
-import {
- ODS_THEME_COLOR_INTENT,
- ODS_THEME_TYPOGRAPHY_SIZE,
-} from '@ovhcloud/ods-common-theming';
+
+import { OdsHTMLAnchorElementRel, OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT, ODS_THEME_TYPOGRAPHY_SIZE } from '@ovhcloud/ods-common-theming';
import { ODS_MESSAGE_TYPE } from '@ovhcloud/ods-components';
-import {
- OsdsLink,
- OsdsMessage,
- OsdsSkeleton,
- OsdsText,
-} from '@ovhcloud/ods-components/react';
-import {
- ShellContext,
- useOvhTracking,
- PageType,
-} from '@ovh-ux/manager-react-shell-client';
+import { OsdsLink, OsdsMessage, OsdsSkeleton, OsdsText } from '@ovhcloud/ods-components/react';
+
+import { PageType, ShellContext, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import { useKyc } from '@/data/hooks/kyc/useKyc';
-import { KycProcedures, KycStatuses } from '@/types/kyc.type';
import { useHubContext } from '@/pages/dashboard/context';
import { KYC_INDIA_FEATURE } from '@/pages/dashboard/dashboard.constants';
+import { KycProcedures, KycStatuses } from '@/types/kyc.type';
export default function KycIndiaBanner() {
const { t } = useTranslation('hub/kyc');
@@ -35,17 +25,10 @@ export default function KycIndiaBanner() {
const { trackClick, trackPage } = useOvhTracking();
const { useKycStatus } = useKyc(KycProcedures.INDIA);
const { data } = useKycStatus({
- enabled: !(
- isLoading ||
- isFreshCustomer ||
- availability?.[KYC_INDIA_FEATURE]
- ),
+ enabled: !(isLoading || isFreshCustomer || availability?.[KYC_INDIA_FEATURE]),
});
- const shouldBeDisplayed = useMemo(
- () => data?.status === KycStatuses.REQUIRED,
- [data],
- );
+ const shouldBeDisplayed = useMemo(() => data?.status === KycStatuses.REQUIRED, [data]);
useEffect(() => {
if (shouldBeDisplayed && !data?.ticketId) {
@@ -57,10 +40,7 @@ export default function KycIndiaBanner() {
}, [data]);
const link = useMemo(
- () =>
- data?.ticketId
- ? null
- : navigation.getURL('dedicated', '#/identity-documents', {}),
+ () => (data?.ticketId ? null : navigation.getURL('dedicated', '#/identity-documents', {})),
[data],
);
@@ -84,17 +64,9 @@ export default function KycIndiaBanner() {
color={ODS_THEME_COLOR_INTENT.text}
className="block"
>
- {t(
- `manager_hub_dashboard_kyc_banner_description${
- data.ticketId ? '_waiting' : ''
- }`,
- )}
+ {t(`manager_hub_dashboard_kyc_banner_description${data.ticketId ? '_waiting' : ''}`)}
{link && (
-
- }
- >
+ }>
(
diff --git a/packages/manager/apps/hub/src/pages/dashboard/NotificationsCarousel.component.tsx b/packages/manager/apps/hub/src/pages/dashboard/NotificationsCarousel.component.tsx
index e5c4813b59ad..5e2c44f462e9 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/NotificationsCarousel.component.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/NotificationsCarousel.component.tsx
@@ -1,12 +1,9 @@
import { useState } from 'react';
-import {
- OsdsIcon,
- OsdsLink,
- OsdsMessage,
- OsdsSkeleton,
- OsdsText,
- OsdsTile,
-} from '@ovhcloud/ods-components/react';
+
+import { Trans, useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
ODS_ICON_NAME,
ODS_ICON_SIZE,
@@ -16,15 +13,22 @@ import {
ODS_TEXT_LEVEL,
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
+import {
+ OsdsIcon,
+ OsdsLink,
+ OsdsMessage,
+ OsdsSkeleton,
+ OsdsText,
+ OsdsTile,
+} from '@ovhcloud/ods-components/react';
+
import { useOvhTracking } from '@ovh-ux/manager-react-shell-client';
-import { Trans, useTranslation } from 'react-i18next';
-import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+
import { useFetchHubNotifications } from '@/data/hooks/notifications/useNotifications';
-import { Notification, NotificationType } from '@/types/notifications.type';
import useGuideUtils from '@/hooks/guides/useGuideUtils';
-import { NOTIFICATIONS_LINKS } from '@/pages/dashboard/dashboard.constants';
import { useHubContext } from '@/pages/dashboard/context';
+import { NOTIFICATIONS_LINKS } from '@/pages/dashboard/dashboard.constants';
+import { Notification, NotificationType } from '@/types/notifications.type';
const getMessageColor = (type: NotificationType) => {
switch (type) {
@@ -75,19 +79,14 @@ export default function NotificationsCarousel() {
const { t } = useTranslation('hub/notifications');
const { trackClick } = useOvhTracking();
const { isLoading, isFreshCustomer } = useHubContext();
- const {
- data: notifications,
- isLoading: areNotificationsLoading,
- } = useFetchHubNotifications({
+ const { data: notifications, isLoading: areNotificationsLoading } = useFetchHubNotifications({
enabled: !(isLoading || isFreshCustomer),
});
const [currentIndex, setCurrentIndex] = useState(0);
const notificationsLinks = useGuideUtils(NOTIFICATIONS_LINKS);
const showNextNotification = () => {
- setCurrentIndex(
- (previousIndex) => (previousIndex + 1) % notifications.length,
- );
+ setCurrentIndex((previousIndex) => (previousIndex + 1) % notifications.length);
trackClick({
actionType: 'action',
actions: ['hub', 'dashboard', 'alert', 'action'],
@@ -95,8 +94,7 @@ export default function NotificationsCarousel() {
};
const notificationLink =
- notifications?.[currentIndex] &&
- notificationsLinks[notifications[currentIndex].id];
+ notifications?.[currentIndex] && notificationsLinks[notifications[currentIndex].id];
return isLoading || areNotificationsLoading ? (
@@ -147,21 +145,17 @@ export default function NotificationsCarousel() {
className="absolute block w-full text-center right-0 left-0 bottom-1"
data-testid="notification-navigation"
>
- {notifications.map(
- (notification: Notification, index: number) => (
- 0 ? 'ml-2' : ''
- }`}
- name={ODS_ICON_NAME.SHAPE_DOT}
- size={ODS_ICON_SIZE.xxs}
- color={getTextColor(notification.level)}
- contrasted={currentIndex === index || undefined}
- onClick={() => setCurrentIndex((previousIndex) => index)}
- />
- ),
- )}
+ {notifications.map((notification: Notification, index: number) => (
+ 0 ? 'ml-2' : ''}`}
+ name={ODS_ICON_NAME.SHAPE_DOT}
+ size={ODS_ICON_SIZE.xxs}
+ color={getTextColor(notification.level)}
+ contrasted={currentIndex === index || undefined}
+ onClick={() => setCurrentIndex((previousIndex) => index)}
+ />
+ ))}
>
)}
diff --git a/packages/manager/apps/hub/src/pages/dashboard/NotificationsEmailUnreachable.component.tsx b/packages/manager/apps/hub/src/pages/dashboard/NotificationsEmailUnreachable.component.tsx
index 96b2523ebe70..8433c2a72953 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/NotificationsEmailUnreachable.component.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/NotificationsEmailUnreachable.component.tsx
@@ -1,20 +1,21 @@
import { FunctionComponent, Suspense, useContext, useMemo } from 'react';
-import {
- OsdsLink,
- OsdsMessage,
- OsdsText,
-} from '@ovhcloud/ods-components/react';
+
+import { Await } from 'react-router-dom';
+
+import { Trans, useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import {
ODS_MESSAGE_TYPE,
ODS_TEXT_COLOR_INTENT,
ODS_TEXT_LEVEL,
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
-import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
-import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
-import { Trans, useTranslation } from 'react-i18next';
+import { OsdsLink, OsdsMessage, OsdsText } from '@ovhcloud/ods-components/react';
+
import { ShellContext } from '@ovh-ux/manager-react-shell-client';
-import { Await } from 'react-router-dom';
+
import { USER_CERTIFICATES } from './dashboard.constants';
export const NotificationsEmailUnreachable: FunctionComponent = () => {
diff --git a/packages/manager/apps/hub/src/pages/dashboard/PaymentStatus.component.tsx b/packages/manager/apps/hub/src/pages/dashboard/PaymentStatus.component.tsx
index dfa5523ea44a..ae95f3a8a2d5 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/PaymentStatus.component.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/PaymentStatus.component.tsx
@@ -1,13 +1,11 @@
-import { lazy, Suspense, useContext } from 'react';
-import {
- OsdsChip,
- OsdsIcon,
- OsdsLink,
- OsdsSkeleton,
- OsdsTable,
- OsdsText,
- OsdsTile,
-} from '@ovhcloud/ods-components/react';
+import { Suspense, lazy, useContext } from 'react';
+
+import { Await } from 'react-router-dom';
+
+import { useTranslation } from 'react-i18next';
+
+import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
+import { ODS_THEME_COLOR_INTENT, ODS_THEME_TYPOGRAPHY_LEVEL } from '@ovhcloud/ods-common-theming';
import {
ODS_CHIP_SIZE,
ODS_ICON_NAME,
@@ -18,30 +16,29 @@ import {
ODS_TEXT_SIZE,
} from '@ovhcloud/ods-components';
import {
- ODS_THEME_COLOR_INTENT,
- ODS_THEME_TYPOGRAPHY_LEVEL,
-} from '@ovhcloud/ods-common-theming';
-import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
-import {
- ShellContext,
- useOvhTracking,
-} from '@ovh-ux/manager-react-shell-client';
-import { useTranslation } from 'react-i18next';
-import { Await } from 'react-router-dom';
-import { useFetchHubBillingServices } from '@/data/hooks/billingServices/useBillingServices';
+ OsdsChip,
+ OsdsIcon,
+ OsdsLink,
+ OsdsSkeleton,
+ OsdsTable,
+ OsdsText,
+ OsdsTile,
+} from '@ovhcloud/ods-components/react';
+
+import { ShellContext, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import { BillingService } from '@/billing/types/billingServices.type';
+import { useFetchHubBillingServices } from '@/data/hooks/billingServices/useBillingServices';
import useDateFormat from '@/hooks/dateFormat/useDateFormat';
import { useHubContext } from '@/pages/dashboard/context';
import { BILLING_FEATURE } from '@/pages/dashboard/dashboard.constants';
-const TileError = lazy(() =>
- import('@/components/tile-error/TileError.component'),
-);
-const BillingStatus = lazy(() =>
- import('@/billing/components/billing-status/BillingStatus.component'),
+const TileError = lazy(() => import('@/components/tile-error/TileError.component'));
+const BillingStatus = lazy(
+ () => import('@/billing/components/billing-status/BillingStatus.component'),
);
-const ServicesActions = lazy(() =>
- import('@/billing/components/services-actions/ServicesActions.component'),
+const ServicesActions = lazy(
+ () => import('@/billing/components/services-actions/ServicesActions.component'),
);
export default function PaymentStatus() {
@@ -82,11 +79,7 @@ export default function PaymentStatus() {
return (
(isLoading || !isFreshCustomer) && (
-
+
{isLoading || areBillingServicesLoading ? (
-
+
{[1, 2, 3, 4].map((line: number) => (
@@ -186,10 +176,7 @@ export default function PaymentStatus() {
size={ODS_SKELETON_SIZE.xs}
/>
-
+
{!services ? (
-
- }
- >
+ }>
) : (
-
+
{services.map((service: BillingService) => (
-
+
|
{service.url ? (
- {tProducts(
- `manager_hub_products_${service.serviceType}`,
- )}
+ {tProducts(`manager_hub_products_${service.serviceType}`)}
|
@@ -299,35 +274,22 @@ export default function PaymentStatus() {
{service.isOneShot() &&
!service.isResiliated() &&
!service.hasPendingResiliation() && (
-
- -
-
+ -
)}
{service.hasManualRenew() &&
!service.isResiliated() &&
!service.hasDebt() && (
- {t(
- 'ovh_manager_hub_payment_status_tile_before',
- {
- date: format(
- service.formattedExpiration,
- ),
- },
- )}
+ {t('ovh_manager_hub_payment_status_tile_before', {
+ date: format(service.formattedExpiration),
+ })}
)}
- {(service.isResiliated() ||
- service.hasPendingResiliation()) && (
+ {(service.isResiliated() || service.hasPendingResiliation()) && (
- {t(
- 'ovh_manager_hub_payment_status_tile_renew',
- {
- date: format(
- service.formattedExpiration,
- ),
- },
- )}
+ {t('ovh_manager_hub_payment_status_tile_renew', {
+ date: format(service.formattedExpiration),
+ })}
)}
{service.hasAutomaticRenewal() &&
@@ -341,9 +303,7 @@ export default function PaymentStatus() {
)}
{service.hasDebt() && (
- {t(
- 'ovh_manager_hub_payment_status_tile_now',
- )}
+ {t('ovh_manager_hub_payment_status_tile_now')}
)}
@@ -362,10 +322,7 @@ export default function PaymentStatus() {
)}
/>
diff --git a/packages/manager/apps/hub/src/pages/dashboard/SiretBanner.component.tsx b/packages/manager/apps/hub/src/pages/dashboard/SiretBanner.component.tsx
index 73eb0fb76b89..adbcb6cc543f 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/SiretBanner.component.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/SiretBanner.component.tsx
@@ -1,11 +1,11 @@
import { Suspense, useContext, useEffect, useMemo } from 'react';
+
import { Await } from 'react-router-dom';
+
import { useTranslation } from 'react-i18next';
+
import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
-import {
- ODS_THEME_COLOR_INTENT,
- ODS_THEME_TYPOGRAPHY_SIZE,
-} from '@ovhcloud/ods-common-theming';
+import { ODS_THEME_COLOR_INTENT, ODS_THEME_TYPOGRAPHY_SIZE } from '@ovhcloud/ods-common-theming';
import {
ODS_ICON_NAME,
ODS_ICON_SIZE,
@@ -19,11 +19,9 @@ import {
OsdsSkeleton,
OsdsText,
} from '@ovhcloud/ods-components/react';
-import {
- ShellContext,
- useOvhTracking,
- PageType,
-} from '@ovh-ux/manager-react-shell-client';
+
+import { PageType, ShellContext, useOvhTracking } from '@ovh-ux/manager-react-shell-client';
+
import { useHubContext } from '@/pages/dashboard/context';
import { SIRET_BANNER_FEATURE } from '@/pages/dashboard/dashboard.constants';
diff --git a/packages/manager/apps/hub/src/pages/dashboard/dashboard.constants.ts b/packages/manager/apps/hub/src/pages/dashboard/dashboard.constants.ts
index d477a47436be..79e7d20f8052 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/dashboard.constants.ts
+++ b/packages/manager/apps/hub/src/pages/dashboard/dashboard.constants.ts
@@ -18,42 +18,24 @@ export const LINK = 'https://billing.us.ovhcloud.com/login';
export const NOTIFICATIONS_LINKS = {
GLOBAL_COMMUNICATION_PHISHING: {
- DE:
- 'https://help.ovhcloud.com/csm/de-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0030035',
- ES:
- 'https://help.ovhcloud.com/csm/es-es-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043067',
- IE:
- 'https://help.ovhcloud.com/csm/en-ie-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043341',
- IT:
- 'https://help.ovhcloud.com/csm/it-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043072',
- PL:
- 'https://help.ovhcloud.com/csm/pl-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043071',
- PT:
- 'https://help.ovhcloud.com/csm/pt-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043070',
- FR:
- 'https://help.ovhcloud.com/csm/fr-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043069',
- MA:
- 'https://help.ovhcloud.com/csm/fr-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043069',
- SN:
- 'https://help.ovhcloud.com/csm/fr-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043069',
- TN:
- 'https://help.ovhcloud.com/csm/fr-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043069',
- NL:
- 'https://help.ovhcloud.com/csm/en-nl-documentation-account-and-service-management?id=kb_browse_cat&kb_id=7c798fe1551974502d4c6e78b74219bb',
- GB:
- 'https://help.ovhcloud.com/csm/en-gb-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043064',
- CA:
- 'https://help.ovhcloud.com/csm/en-ca-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043351',
- QC:
- 'https://help.ovhcloud.com/csm/fr-ca-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043068',
- IN:
- 'https://help.ovhcloud.com/csm/asia-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043063',
- SG:
- 'https://help.ovhcloud.com/csm/en-sg-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043062',
- ASIA:
- 'https://help.ovhcloud.com/csm/asia-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043063',
- US:
- 'https://support.us.ovhcloud.com/hc/en-us/articles/28330641929491-VMware-Cloud-Director-How-to-Use-the-vCD-User-Interface',
+ DE: 'https://help.ovhcloud.com/csm/de-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0030035',
+ ES: 'https://help.ovhcloud.com/csm/es-es-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043067',
+ IE: 'https://help.ovhcloud.com/csm/en-ie-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043341',
+ IT: 'https://help.ovhcloud.com/csm/it-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043072',
+ PL: 'https://help.ovhcloud.com/csm/pl-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043071',
+ PT: 'https://help.ovhcloud.com/csm/pt-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043070',
+ FR: 'https://help.ovhcloud.com/csm/fr-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043069',
+ MA: 'https://help.ovhcloud.com/csm/fr-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043069',
+ SN: 'https://help.ovhcloud.com/csm/fr-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043069',
+ TN: 'https://help.ovhcloud.com/csm/fr-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043069',
+ NL: 'https://help.ovhcloud.com/csm/en-nl-documentation-account-and-service-management?id=kb_browse_cat&kb_id=7c798fe1551974502d4c6e78b74219bb',
+ GB: 'https://help.ovhcloud.com/csm/en-gb-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043064',
+ CA: 'https://help.ovhcloud.com/csm/en-ca-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043351',
+ QC: 'https://help.ovhcloud.com/csm/fr-ca-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043068',
+ IN: 'https://help.ovhcloud.com/csm/asia-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043063',
+ SG: 'https://help.ovhcloud.com/csm/en-sg-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043062',
+ ASIA: 'https://help.ovhcloud.com/csm/asia-account-scams-fraud-phishing?id=kb_article_view&sysparm_article=KB0043063',
+ US: 'https://support.us.ovhcloud.com/hc/en-us/articles/28330641929491-VMware-Cloud-Director-How-to-Use-the-vCD-User-Interface',
},
};
diff --git a/packages/manager/apps/hub/src/pages/dashboard/dashboard.spec.tsx b/packages/manager/apps/hub/src/pages/dashboard/dashboard.spec.tsx
index 3a44583224d1..779b89ef9dff 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/dashboard.spec.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/dashboard.spec.tsx
@@ -1,46 +1,37 @@
import { ReactNode } from 'react';
-import { describe, expect, it, vi } from 'vitest';
-import { act, fireEvent, render, waitFor } from '@testing-library/react';
+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
-import * as reactShellClientModule from '@ovh-ux/manager-react-shell-client';
-import * as ReactComponentsModule from '@ovh-ux/manager-react-components';
-import {
- ShellContext,
- ShellContextType,
-} from '@ovh-ux/manager-react-shell-client';
-import {
- OdsSelectValueChangeEventDetail,
- OsdsSelect,
-} from '@ovhcloud/ods-components';
+import { act, fireEvent, render, waitFor } from '@testing-library/react';
+import { describe, expect, it, vi } from 'vitest';
+
+import { OdsSelectValueChangeEventDetail, OsdsSelect } from '@ovhcloud/ods-components';
+
import { User } from '@ovh-ux/manager-config';
+import * as ReactComponentsModule from '@ovh-ux/manager-react-components';
+import * as reactShellClientModule from '@ovh-ux/manager-react-shell-client';
+import { ShellContext, ShellContextType } from '@ovh-ux/manager-react-shell-client';
-import Layout from '@/pages/dashboard/dashboard';
+import { FourServices, NoServices, TwoServices } from '@/__mocks__/billingServices';
+import { catalogData } from '@/__mocks__/catalog';
+import * as UseBillingServicesHook from '@/data/hooks/billingServices/useBillingServices';
+import * as UseBillsHook from '@/data/hooks/bills/useBills';
import BillingSummary from '@/pages/dashboard/BillingSummary.component';
-import EnterpriseBillingSummary from '@/pages/dashboard/EnterpriseBillingSummary.component';
-import PaymentStatus from '@/pages/dashboard/PaymentStatus.component';
import Catalog from '@/pages/dashboard/Catalog.component';
-import SiretBanner from '@/pages/dashboard/SiretBanner.component';
-import KycIndiaBanner from '@/pages/dashboard/KycIndiaBanner.component';
+import EnterpriseBillingSummary from '@/pages/dashboard/EnterpriseBillingSummary.component';
import KycFraudBanner from '@/pages/dashboard/KycFraudBanner.component';
+import KycIndiaBanner from '@/pages/dashboard/KycIndiaBanner.component';
import NotificationsCarousel from '@/pages/dashboard/NotificationsCarousel.component';
-
+import PaymentStatus from '@/pages/dashboard/PaymentStatus.component';
+import SiretBanner from '@/pages/dashboard/SiretBanner.component';
import * as HubContext from '@/pages/dashboard/context';
-import * as UseBillsHook from '@/data/hooks/bills/useBills';
-import * as UseBillingServicesHook from '@/data/hooks/billingServices/useBillingServices';
-
-import { Notification, NotificationType } from '@/types/notifications.type';
-import { CatalogItem } from '@/types/catalog';
+import Layout from '@/pages/dashboard/dashboard';
import { ApiEnvelope } from '@/types/apiEnvelope.type';
+import { CatalogItem } from '@/types/catalog';
import { KycStatus } from '@/types/kyc.type';
+import { Notification, NotificationType } from '@/types/notifications.type';
import { LastOrder } from '@/types/order.type';
import { ProductList } from '@/types/services.type';
-import {
- FourServices,
- NoServices,
- TwoServices,
-} from '@/__mocks__/billingServices';
-import { catalogData } from '@/__mocks__/catalog';
import NotificationsEmailUnreachable from './NotificationsEmailUnreachable.component';
const queryClient = new QueryClient();
@@ -146,10 +137,7 @@ const mocks: any = vi.hoisted(() => ({
},
navigation: {
getURL: vi.fn(
- () =>
- new Promise((resolve) =>
- setTimeout(() => resolve('https://fake-link.com'), 50),
- ),
+ () => new Promise((resolve) => setTimeout(() => resolve('https://fake-link.com'), 50)),
),
},
tracking: {
@@ -166,9 +154,7 @@ const mocks: any = vi.hoisted(() => ({
const renderComponent = (component: ReactNode) => {
return render(
-
+
{component}
,
@@ -207,12 +193,9 @@ vi.mock('@/billing/components/billing-status/BillingStatus.component', () => ({
default: () => Billing Status ,
}));
-vi.mock(
- '@/billing/components/services-actions/ServicesActions.component',
- () => ({
- default: () => Service Actions ,
- }),
-);
+vi.mock('@/billing/components/services-actions/ServicesActions.component', () => ({
+ default: () => Service Actions ,
+}));
vi.mock('@ovh-ux/manager-react-shell-client', async (importOriginal) => {
const original: typeof reactShellClientModule = await importOriginal();
@@ -326,12 +309,8 @@ describe('Layout.page', () => {
it('should render skeletons while loading', async () => {
const { findByTestId } = renderComponent();
- const tileGridTitleSkeleton = await findByTestId(
- 'tile_grid_title_skeleton',
- );
- const tileGridContentSkeleton = await findByTestId(
- 'tile_grid_content_skeletons',
- );
+ const tileGridTitleSkeleton = await findByTestId('tile_grid_title_skeleton');
+ const tileGridContentSkeleton = await findByTestId('tile_grid_content_skeletons');
expect(tileGridTitleSkeleton).not.toBeNull();
expect(tileGridContentSkeleton).not.toBeNull();
});
@@ -339,12 +318,7 @@ describe('Layout.page', () => {
it('should render correct components for "fresh" customers', async () => {
mocks.isLastOrderLoading = false;
mocks.hubContext.isLoading = false;
- const {
- queryByText,
- findByText,
- findByTestId,
- queryByTestId,
- } = renderComponent();
+ const { queryByText, findByText, findByTestId, queryByTestId } = renderComponent();
const welcome = await findByText('Welcome');
@@ -369,8 +343,7 @@ describe('Layout.page', () => {
expirationDate: '2024-09-05T23:29:59+02:00',
orderId: 99999999999,
password: 'fakepassword',
- pdfUrl:
- 'https://www.fake-order-url.com?orderId=fakeId&orderPassword=fakePassword',
+ pdfUrl: 'https://www.fake-order-url.com?orderId=fakeId&orderPassword=fakePassword',
priceWithTax: {
currencyCode: 'points',
text: '0 PTS',
@@ -387,17 +360,12 @@ describe('Layout.page', () => {
text: '0 PTS',
value: 0,
},
- url:
- 'https://www.fake-order-url.com?orderId=fakeId&orderPassword=fakePassword',
+ url: 'https://www.fake-order-url.com?orderId=fakeId&orderPassword=fakePassword',
};
mocks.hubContext.isFreshCustomer = false;
- const {
- getByText,
- getByTestId,
- findByText,
- findByTestId,
- queryByTestId,
- } = renderComponent();
+ const { getByText, getByTestId, findByText, findByTestId, queryByTestId } = renderComponent(
+ ,
+ );
const welcome = await findByText('Welcome');
const products = await findByText('Products');
@@ -445,9 +413,7 @@ describe('Layout.page', () => {
mocks.shellContext.environment.user.enterprise = true;
const { findByTestId } = renderComponent();
- const enterpriseBillingSummary = await findByTestId(
- 'enterprise_billing_summary',
- );
+ const enterpriseBillingSummary = await findByTestId('enterprise_billing_summary');
expect(enterpriseBillingSummary).not.toBeNull();
});
@@ -463,9 +429,7 @@ describe('Layout.page', () => {
it('should display correct wording when customer has no bills', async () => {
mocks.bills.isLoading = false;
- const { findByTestId, getByText, getByTestId } = renderComponent(
- ,
- );
+ const { findByTestId, getByText, getByTestId } = renderComponent();
expect(getByText('hub_billing_summary_debt_no_bills')).not.toBeNull();
expect(getByTestId('bills_link_skeleton')).not.toBeNull();
@@ -476,9 +440,7 @@ describe('Layout.page', () => {
it('should display correct wording when customer has bills but no debt', async () => {
mocks.bills.data.total = 15034.94;
const expectedAmount = '15\u202f034';
- const { getByText, getByTestId, getAllByTestId } = renderComponent(
- ,
- );
+ const { getByText, getByTestId, getAllByTestId } = renderComponent();
const amount = getAllByTestId('bills_amount_container');
expect(amount.length).toBe(1);
@@ -496,9 +458,7 @@ describe('Layout.page', () => {
it('should update bills amount when period is changed', async () => {
const { getByTestId } = renderComponent();
- const periodSelector = (getByTestId(
- 'bills_period_selector',
- ) as unknown) as OsdsSelect;
+ const periodSelector = getByTestId('bills_period_selector') as unknown as OsdsSelect;
const useFetchHubBillsSpy = vi.spyOn(UseBillsHook, 'useFetchHubBills');
await act(() =>
@@ -548,9 +508,7 @@ describe('Layout.page', () => {
expect(getByTestId('enterprise_billing_summary')).not.toBeNull();
expect(getByTestId('enterprise_billing_summary_title')).not.toBeNull();
- expect(
- getByTestId('enterprise_billing_summary_description'),
- ).not.toBeNull();
+ expect(getByTestId('enterprise_billing_summary_description')).not.toBeNull();
const link = getByTestId('enterprise_billing_summary_link');
expect(link).not.toBeNull();
@@ -573,15 +531,11 @@ describe('Layout.page', () => {
it('should render table with skeletons while loading', async () => {
mocks.hubContext.isLoading = true;
mocks.hubContext.availability['billing:management'] = true;
- const { getAllByTestId, getByTestId } = renderComponent(
- ,
- );
+ const { getAllByTestId, getByTestId } = renderComponent();
expect(getByTestId('my_services_link_skeleton')).not.toBeNull();
expect(getByTestId('payment_status_skeleton_table')).not.toBeNull();
- expect(getAllByTestId('payment_status_skeleton_table_row').length).toBe(
- 4,
- );
+ expect(getAllByTestId('payment_status_skeleton_table_row').length).toBe(4);
});
it('should render error if loading is done and no data has been retrieved', async () => {
@@ -597,20 +551,14 @@ describe('Layout.page', () => {
useBillingServicesMockValue.data = NoServices;
const { getByText } = renderComponent();
- expect(
- getByText('ovh_manager_hub_payment_status_tile_no_services'),
- ).not.toBeNull();
+ expect(getByText('ovh_manager_hub_payment_status_tile_no_services')).not.toBeNull();
});
it('should render the correct number of services', async () => {
useBillingServicesMockValue.data = TwoServices;
- const { findAllByText, getAllByTestId, getByTestId } = renderComponent(
- ,
- );
+ const { findAllByText, getAllByTestId, getByTestId } = renderComponent();
- expect(getByTestId('payment_status_badge').innerHTML.includes('2')).toBe(
- true,
- );
+ expect(getByTestId('payment_status_badge').innerHTML.includes('2')).toBe(true);
const servicesLine = getAllByTestId('billing_service');
expect(servicesLine.length).toBe(2);
expect(getAllByTestId('billing_status_skeleton').length).toBe(2);
@@ -655,9 +603,7 @@ describe('Layout.page', () => {
it('should display the correct information for service in manual renew without debt and not resiliated', async () => {
const { getByTestId, getByText } = renderComponent();
- const serviceLink = getByText(
- 'serviceWithManualRenewNotResiliatedWithoutDebt',
- );
+ const serviceLink = getByText('serviceWithManualRenewNotResiliatedWithoutDebt');
expect(serviceLink).not.toBeNull();
expect(serviceLink).toHaveAttribute(
'href',
@@ -685,16 +631,12 @@ describe('Layout.page', () => {
'serviceWithoutUrlAndSuspendedBilling',
);
expect(serviceWithoutUrlAndSuspendedBillingLink).not.toBeNull();
- expect(serviceWithoutUrlAndSuspendedBillingLink).not.toHaveAttribute(
- 'href',
- );
+ expect(serviceWithoutUrlAndSuspendedBillingLink).not.toHaveAttribute('href');
});
it('should track service access', async () => {
const { getByText } = renderComponent();
- const service = getByText(
- 'serviceWithManualRenewNotResiliatedWithoutDebt',
- );
+ const service = getByText('serviceWithManualRenewNotResiliatedWithoutDebt');
expect(service).not.toBeNull();
await act(() => fireEvent.click(service));
@@ -706,9 +648,7 @@ describe('Layout.page', () => {
describe('With billing management', () => {
it('should render "see all" link', async () => {
- const { findAllByText, findByTestId } = renderComponent(
- ,
- );
+ const { findAllByText, findByTestId } = renderComponent();
const myServiceLink = await findByTestId('my_services_link');
expect(myServiceLink).not.toBeNull();
@@ -721,12 +661,8 @@ describe('Layout.page', () => {
describe('Without billing management', () => {
it('should not render "see all" link', async () => {
mocks.hubContext.availability['billing:management'] = false;
- const { queryAllByTestId, queryByTestId } = renderComponent(
- ,
- );
- expect(
- queryByTestId('my_services_link_skeleton'),
- ).not.toBeInTheDocument();
+ const { queryAllByTestId, queryByTestId } = renderComponent();
+ expect(queryByTestId('my_services_link_skeleton')).not.toBeInTheDocument();
expect(queryAllByTestId('services_actions_skeleton').length).toBe(0);
});
});
@@ -826,9 +762,7 @@ describe('Layout.page', () => {
const { findByTestId, getByTestId } = renderComponent();
expect(getByTestId('kyc_fraud_banner')).not.toBeNull();
- expect(
- mocks.shellContext.shell.tracking.trackImpression,
- ).toHaveBeenCalledWith({
+ expect(mocks.shellContext.shell.tracking.trackImpression).toHaveBeenCalledWith({
campaignId: 'kyc-fraud',
creation: 'notification',
format: 'banner',
@@ -840,9 +774,7 @@ describe('Layout.page', () => {
await act(() => fireEvent.click(link));
- expect(
- mocks.shellContext.shell.tracking.trackClickImpression,
- ).toHaveBeenCalledWith({
+ expect(mocks.shellContext.shell.tracking.trackClickImpression).toHaveBeenCalledWith({
click: {
campaignId: 'kyc-fraud',
creation: 'notification',
@@ -860,9 +792,7 @@ describe('Layout.page', () => {
const { getByTestId } = renderComponent();
expect(getByTestId('kyc_fraud_banner')).not.toBeNull();
- expect(
- mocks.shellContext.shell.tracking.trackImpression,
- ).toHaveBeenCalledWith({
+ expect(mocks.shellContext.shell.tracking.trackImpression).toHaveBeenCalledWith({
campaignId: 'kyc-fraud',
creation: 'notification',
format: 'banner',
@@ -880,9 +810,7 @@ describe('Layout.page', () => {
describe('NotificationsCarousel component', () => {
it('should render a single notification without "navigation"', async () => {
- const { getByTestId, queryByTestId } = renderComponent(
- ,
- );
+ const { getByTestId, queryByTestId } = renderComponent();
expect(getByTestId('notification_content')).not.toBeNull();
expect(queryByTestId('next-notification-button')).not.toBeInTheDocument();
@@ -892,13 +820,9 @@ describe('Layout.page', () => {
describe('NotificationsEmailUnreachable component', () => {
it('should render NotificationsEmailUnreachable component', async () => {
- const { findByTestId } = renderComponent(
- ,
- );
+ const { findByTestId } = renderComponent();
- expect(
- await findByTestId('email_unreachable_notifications'),
- ).not.toBeNull();
+ expect(await findByTestId('email_unreachable_notifications')).not.toBeNull();
});
});
@@ -914,12 +838,8 @@ describe('Layout.page', () => {
it('should display skeletons', async () => {
const { findByTestId } = renderComponent();
- const tileGridTitleSkeleton = await findByTestId(
- 'tile_grid_title_skeleton',
- );
- const tileGridContentSkeleton = await findByTestId(
- 'tile_grid_content_skeletons',
- );
+ const tileGridTitleSkeleton = await findByTestId('tile_grid_title_skeleton');
+ const tileGridContentSkeleton = await findByTestId('tile_grid_content_skeletons');
expect(tileGridTitleSkeleton).not.toBeNull();
expect(tileGridContentSkeleton).not.toBeNull();
});
@@ -927,12 +847,8 @@ describe('Layout.page', () => {
it('should display skeletons', async () => {
const { findByTestId } = renderComponent();
- const tileGridTitleSkeleton = await findByTestId(
- 'tile_grid_title_skeleton',
- );
- const tileGridContentSkeleton = await findByTestId(
- 'tile_grid_content_skeletons',
- );
+ const tileGridTitleSkeleton = await findByTestId('tile_grid_title_skeleton');
+ const tileGridContentSkeleton = await findByTestId('tile_grid_content_skeletons');
expect(tileGridTitleSkeleton).not.toBeNull();
expect(tileGridContentSkeleton).not.toBeNull();
});
diff --git a/packages/manager/apps/hub/src/pages/dashboard/dashboard.tsx b/packages/manager/apps/hub/src/pages/dashboard/dashboard.tsx
index 7c32125460a4..441f7930d264 100644
--- a/packages/manager/apps/hub/src/pages/dashboard/dashboard.tsx
+++ b/packages/manager/apps/hub/src/pages/dashboard/dashboard.tsx
@@ -1,63 +1,44 @@
-import {
- useEffect,
- useContext,
- useRef,
- Suspense,
- lazy,
- useState,
- useMemo,
-} from 'react';
+import { Suspense, lazy, useContext, useEffect, useMemo, useRef, useState } from 'react';
+
import { useLocation } from 'react-router-dom';
-import {
- useOvhTracking,
- useRouteSynchro,
- ShellContext,
-} from '@ovh-ux/manager-react-shell-client';
-import { OsdsButton } from '@ovhcloud/ods-components/react';
+
+import { useTranslation } from 'react-i18next';
+
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import { ODS_BUTTON_SIZE, ODS_BUTTON_VARIANT } from '@ovhcloud/ods-components';
+import { OsdsButton } from '@ovhcloud/ods-components/react';
+
import { useFeatureAvailability } from '@ovh-ux/manager-react-components';
-import { useTranslation } from 'react-i18next';
-import { features } from '@/pages/dashboard/dashboard.constants';
-import { useFetchHubServices } from '@/data/hooks/services/useServices';
-import { useLastOrder } from '@/data/hooks/lastOrder/useLastOrder';
+import { ShellContext, useOvhTracking, useRouteSynchro } from '@ovh-ux/manager-react-shell-client';
+
+import Banner from '@/components/banner/Banner.component';
// Components used in Suspense's fallback cannot be lazy loaded (break testing)
import TileGridSkeleton from '@/components/tile-grid-skeleton/TileGridSkeleton.component';
-import { Context } from '@/pages/dashboard/context';
-
import Welcome from '@/components/welcome/Welcome.component';
-import Banner from '@/components/banner/Banner.component';
+import { useLastOrder } from '@/data/hooks/lastOrder/useLastOrder';
+import { useFetchHubServices } from '@/data/hooks/services/useServices';
import HubDashboardSubtitle from '@/pages/dashboard/HubDashboardSubtitle';
+import { Context } from '@/pages/dashboard/context';
+import { features } from '@/pages/dashboard/dashboard.constants';
+
import NotificationsEmailUnreachable from './NotificationsEmailUnreachable.component';
const Products = lazy(() => import('@/components/products/Products.component'));
const Catalog = lazy(() => import('@/pages/dashboard/Catalog.component'));
-const OrderTracking = lazy(() =>
- import('@/components/hub-order-tracking/HubOrderTracking.component'),
+const OrderTracking = lazy(
+ () => import('@/components/hub-order-tracking/HubOrderTracking.component'),
);
-const HubSupport = lazy(() =>
- import('@/components/hub-support/HubSupport.component'),
+const HubSupport = lazy(() => import('@/components/hub-support/HubSupport.component'));
+const BillingSummary = lazy(() => import('@/pages/dashboard/BillingSummary.component'));
+const EnterpriseBillingSummary = lazy(
+ () => import('@/pages/dashboard/EnterpriseBillingSummary.component'),
);
-const BillingSummary = lazy(() =>
- import('@/pages/dashboard/BillingSummary.component'),
-);
-const EnterpriseBillingSummary = lazy(() =>
- import('@/pages/dashboard/EnterpriseBillingSummary.component'),
-);
-const PaymentStatus = lazy(() =>
- import('@/pages/dashboard/PaymentStatus.component'),
-);
-const SiretBanner = lazy(() =>
- import('@/pages/dashboard/SiretBanner.component'),
-);
-const KycIndiaBanner = lazy(() =>
- import('@/pages/dashboard/KycIndiaBanner.component'),
-);
-const KycFraudBanner = lazy(() =>
- import('@/pages/dashboard/KycFraudBanner.component'),
-);
-const NotificationsCarousel = lazy(() =>
- import('@/pages/dashboard/NotificationsCarousel.component'),
+const PaymentStatus = lazy(() => import('@/pages/dashboard/PaymentStatus.component'));
+const SiretBanner = lazy(() => import('@/pages/dashboard/SiretBanner.component'));
+const KycIndiaBanner = lazy(() => import('@/pages/dashboard/KycIndiaBanner.component'));
+const KycFraudBanner = lazy(() => import('@/pages/dashboard/KycFraudBanner.component'));
+const NotificationsCarousel = lazy(
+ () => import('@/pages/dashboard/NotificationsCarousel.component'),
);
export default function Dashboard() {
@@ -85,10 +66,7 @@ export default function Dashboard() {
}, []);
const { data: availability } = useFeatureAvailability(features);
- const {
- data: services,
- isPending: areServicesLoading,
- } = useFetchHubServices();
+ const { data: services, isPending: areServicesLoading } = useFetchHubServices();
const { data: lastOrder, isPending: isLastOrderLoading } = useLastOrder();
const isLoading = areServicesLoading || isLastOrderLoading;
@@ -141,11 +119,7 @@ export default function Dashboard() {
- {user.enterprise ? (
-
- ) : (
-
- )}
+ {user.enterprise ? : }
diff --git a/packages/manager/apps/hub/src/pages/layout.tsx b/packages/manager/apps/hub/src/pages/layout.tsx
index 5e797ac4cbb1..8b7d77b0bee6 100644
--- a/packages/manager/apps/hub/src/pages/layout.tsx
+++ b/packages/manager/apps/hub/src/pages/layout.tsx
@@ -1,13 +1,12 @@
-import React, { useEffect, useContext } from 'react';
-import { defineCurrentPage } from '@ovh-ux/request-tagger';
+import React, { useContext, useEffect } from 'react';
+
import { Outlet, useLocation, useMatches } from 'react-router-dom';
-import {
- ShellContext,
- useOvhTracking,
- useRouteSynchro,
-} from '@ovh-ux/manager-react-shell-client';
+
import '@ovhcloud/ods-theme-blue-jeans';
+import { ShellContext, useOvhTracking, useRouteSynchro } from '@ovh-ux/manager-react-shell-client';
+import { defineCurrentPage } from '@ovh-ux/request-tagger';
+
interface MatchHandle {
tracking?: {
pageName?: string;
diff --git a/packages/manager/apps/hub/src/routes/routes.tsx b/packages/manager/apps/hub/src/routes/routes.tsx
index 75189127f891..71fd22ae4294 100644
--- a/packages/manager/apps/hub/src/routes/routes.tsx
+++ b/packages/manager/apps/hub/src/routes/routes.tsx
@@ -1,14 +1,15 @@
-import { ErrorBoundary } from '@ovh-ux/manager-react-components';
import React from 'react';
+
import { Route } from 'react-router-dom';
+
+import { ErrorBoundary } from '@ovh-ux/manager-react-components';
import { PageType } from '@ovh-ux/manager-react-shell-client';
+
import NotFound from '@/pages/404';
const LayoutPage = React.lazy(() => import('@/pages/layout'));
const DashboardPage = React.lazy(() => import('@/pages/dashboard/dashboard'));
-const RoadmapChangelogPage = React.lazy(() =>
- import('@/pages/changelog/Changelog'),
-);
+const RoadmapChangelogPage = React.lazy(() => import('@/pages/changelog/Changelog'));
export default (
+
}
>
{
const original: typeof i18nextModule = await importOriginal();
diff --git a/packages/manager/apps/hub/src/utils/deepMerge.spec.ts b/packages/manager/apps/hub/src/utils/deepMerge.spec.ts
index 52047f50cd98..212b700cb148 100644
--- a/packages/manager/apps/hub/src/utils/deepMerge.spec.ts
+++ b/packages/manager/apps/hub/src/utils/deepMerge.spec.ts
@@ -1,4 +1,5 @@
-import { describe, it, expect } from 'vitest';
+import { describe, expect, it } from 'vitest';
+
import { deepMerge } from './deepMerge';
describe('deepMerge', () => {
diff --git a/packages/manager/apps/hub/src/utils/deepMerge.ts b/packages/manager/apps/hub/src/utils/deepMerge.ts
index fe76839d90b9..df9c00500b58 100644
--- a/packages/manager/apps/hub/src/utils/deepMerge.ts
+++ b/packages/manager/apps/hub/src/utils/deepMerge.ts
@@ -5,31 +5,28 @@ type Primitive = string | number | boolean | null | undefined;
type DeepMerge = T extends Primitive
? U
: T extends Array
- ? U extends Array
- ? Array
- : U
- : T extends Record
- ? U extends Record
- ? {
- [K in keyof (T & U)]: K extends keyof U
- ? K extends keyof T
- ? DeepMerge
- : U[K]
- : K extends keyof T
- ? T[K]
- : never;
- }
- : U
- : U;
+ ? U extends Array
+ ? Array
+ : U
+ : T extends Record
+ ? U extends Record
+ ? {
+ [K in keyof (T & U)]: K extends keyof U
+ ? K extends keyof T
+ ? DeepMerge
+ : U[K]
+ : K extends keyof T
+ ? T[K]
+ : never;
+ }
+ : U
+ : U;
function isRecord(item: unknown): item is Record {
return item !== null && typeof item === 'object' && !Array.isArray(item);
}
-export function deepMerge<
- T extends Record,
- U extends Record
->(
+export function deepMerge, U extends Record>(
target: T,
source: U,
options: { arrayMode?: DeepMergeArrayMode } = {},
@@ -48,10 +45,7 @@ export function deepMerge<
options,
);
} else if (Array.isArray(sourceValue) && Array.isArray(targetValue)) {
- output[key] =
- arrayMode === 'concat'
- ? [...targetValue, ...sourceValue]
- : [...sourceValue];
+ output[key] = arrayMode === 'concat' ? [...targetValue, ...sourceValue] : [...sourceValue];
} else {
output[key] = sourceValue;
}
diff --git a/packages/manager/apps/hub/tsconfig.json b/packages/manager/apps/hub/tsconfig.json
index 8ff43fa18040..8f627226fc16 100644
--- a/packages/manager/apps/hub/tsconfig.json
+++ b/packages/manager/apps/hub/tsconfig.json
@@ -1,26 +1,15 @@
{
+ "extends": "@ovh-ux/manager-static-analysis-kit/tsconfig/react",
"compilerOptions": {
- "lib": ["dom", "es2020"],
- "noEmit": true,
- "target": "es2020",
"types": ["vite/client", "node"],
- "module": "ES2020",
- "moduleResolution": "node",
- "removeComments": true,
"outDir": "dist",
- "esModuleInterop": true,
- "isolatedModules": true,
- "allowSyntheticDefaultImports": true,
- "skipLibCheck": true,
"noImplicitAny": true,
- "declaration": true,
"resolveJsonModule": true,
"allowJs": true,
- "jsx": "react-jsx",
- "baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
- }
+ },
+ "baseUrl": "."
},
"include": ["src"],
"exclude": ["node_modules", "dist", "types", "src/__tests__"]
diff --git a/packages/manager/apps/hub/tsconfig.strict.json b/packages/manager/apps/hub/tsconfig.strict.json
new file mode 100644
index 000000000000..7a15a1605db3
--- /dev/null
+++ b/packages/manager/apps/hub/tsconfig.strict.json
@@ -0,0 +1,16 @@
+{
+ "extends": "@ovh-ux/manager-static-analysis-kit/tsconfig/react-strict",
+ "compilerOptions": {
+ "types": ["vite/client", "node"],
+ "outDir": "dist",
+ "noImplicitAny": true,
+ "resolveJsonModule": true,
+ "allowJs": true,
+ "paths": {
+ "@/*": ["./src/*"]
+ },
+ "baseUrl": "."
+ },
+ "include": ["src"],
+ "exclude": ["node_modules", "dist", "types", "src/__tests__"]
+}
|