Skip to content

Commit e43753c

Browse files
ppprevostlionel95200x
authored andcommitted
feat(pci-kubernetes): delete shadcn and update to ods 19
ref: #TAPC-5164 Signed-off-by: Pierre-Philippe <[email protected]>
1 parent 80b2521 commit e43753c

File tree

10 files changed

+179
-175
lines changed

10 files changed

+179
-175
lines changed

packages/manager/apps/pci-kubernetes/package.json

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@
77
"scripts": {
88
"build": "tsc --project tsconfig.build.json && vite build",
99
"build:strict": "tsc --project tsconfig.json && vite build",
10-
"coverage": "vitest run --coverage",
10+
"coverage": "manager-test run --coverage",
1111
"lint": "eslint ./src",
1212
"lint:modern": "manager-lint --config eslint.config.mjs ./src",
1313
"lint:modern:fix": "manager-lint --fix --config eslint.config.mjs ./src",
1414
"start": "vite",
15-
"test": "vitest run",
16-
"test:watch": "vitest"
15+
"test": "manager-test run",
16+
"test:watch": "manager-test"
1717
},
1818
"dependencies": {
19-
"@datatr-ux/ods-tailwind-config": "1.0.3",
20-
"@datatr-ux/ovhcloud-types": "1.0.8",
21-
"@datatr-ux/uxlib": "0.0.10",
2219
"@hookform/resolvers": "^3.3.4",
2320
"@ovh-ux/manager-common-translations": "^0.19.2",
2421
"@ovh-ux/manager-config": "^8.6.4",
@@ -34,7 +31,9 @@
3431
"@ovhcloud/ods-common-stencil": "17.2.2",
3532
"@ovhcloud/ods-common-theming": "17.2.2",
3633
"@ovhcloud/ods-components": "17.2.2",
34+
"@ovhcloud/ods-react": "^19.0.2",
3735
"@ovhcloud/ods-theme-blue-jeans": "17.2.2",
36+
"@ovhcloud/ods-themes": "^19.0.2",
3837
"@tanstack/react-query": "^5.51.21",
3938
"@tanstack/react-table": "^8.17.3",
4039
"clsx": "^2.1.1",
@@ -58,21 +57,14 @@
5857
"@ovh-ux/manager-static-analysis-kit": "^0.11.0",
5958
"@ovh-ux/manager-vite-config": "^0.13.3",
6059
"@tanstack/react-query-devtools": "^5.51.21",
61-
"@testing-library/dom": "^10.1.0",
62-
"@testing-library/jest-dom": "^6.4.5",
63-
"@testing-library/react": "^16.0.0",
64-
"@testing-library/user-event": "^14.5.2",
6560
"@types/jest": "^29.5.12",
6661
"@types/react": "^18.2.79",
6762
"@types/react-dom": "^18.3.0",
68-
"@vitejs/plugin-react": "^4.3.0",
69-
"@vitest/coverage-v8": "^2.1.9",
7063
"autoprefixer": "^10.4.19",
7164
"postcss": "^8.4.38",
7265
"rollup": "^4.18.0",
7366
"tailwindcss": "^3.4.4",
74-
"typescript": "^5.4.5",
75-
"vitest": "^2.1.9"
67+
"typescript": "^5.4.5"
7668
},
7769
"regions": [
7870
"CA",

packages/manager/apps/pci-kubernetes/src/components/radio-tile/RadioTile.component.tsx

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ const RadioTile = ({
3333
{...(!disabled && { tabIndex: 0 })}
3434
onKeyDown={handleLabelKeyDown}
3535
data-testid="radio-tile-container"
36+
className={cn(tileClassName, 'h-full')}
3637
>
37-
<div className={cn(tileClassName)}>
38+
<div className="h-full">
3839
<input
3940
onChange={(e) => (props.onChange ? props.onChange(e) : null)}
4041
className="hidden"
@@ -48,13 +49,14 @@ const RadioTile = ({
4849
<label
4950
id={labelId}
5051
className={cn(
51-
'flex flex-col h-full w-full group border-2 border-primary-100 rounded-md',
52+
'flex flex-col h-full w-full group border-2 border-solid rounded-md',
5253
{
53-
'border-primary-600 selected': !disabled && props.checked,
54-
'border-primary-100 bg-white': !disabled && !props.checked,
55-
'hover:shadow-sm hover:border-primary-600 hover:bg-primary-100 cursor-pointer':
54+
'border-[--ods-color-blue-600] selected': !disabled && props.checked,
55+
'border-[--ods-color-blue-100] bg-white': !disabled && !props.checked,
56+
'hover:shadow-sm hover:bg-[--ods-color-blue-100] hover:border-[--ods-color-blue-600] cursor-pointer':
5657
!disabled,
57-
'bg-neutral-100 border-neutral-100 text-neutral-800': disabled,
58+
'bg-neutral-100 text-neutral-800 border-[--ods-color-border-readonly-default]':
59+
disabled,
5860
},
5961

6062
labelClassName,
@@ -69,8 +71,4 @@ const RadioTile = ({
6971
);
7072
};
7173

72-
RadioTile.Separator = function RadioTileSeparator() {
73-
return <div className="w-full border-neutral-100 border-t mt-2 pt-2 " aria-hidden="true"></div>;
74-
};
75-
7674
export default RadioTile;

packages/manager/apps/pci-kubernetes/src/components/region-selector/KubeDeploymentTile.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,13 @@ export function KubeDeploymentTile({
3232
value={title}
3333
checked={isSelected}
3434
>
35-
<div className="flex flex-col w-full items-center text-center space-y-4 px-[24px] py-[16px] min-h-[200px]">
36-
<div className="flex flex-col lg:flex-row gap-4">
35+
<article className="flex flex-col items-center text-center px-[24px] py-[16px] gap-4 lg:gap-2 rounded-md">
36+
<div className="flex flex-col lg:flex-row gap-1 lg:gap-4 items-center lg:items-baseline">
3737
<h2
38-
className={clsx('text-base text-[#4d5693]', isSelected ? 'font-bold' : 'font-normal')}
38+
className={clsx(
39+
'text-base text-[--ods-color-text-500] mb-0 lg:mb-2',
40+
isSelected ? 'font-bold' : 'font-normal',
41+
)}
3942
>
4043
{title}
4144
</h2>
@@ -44,8 +47,8 @@ export function KubeDeploymentTile({
4447
</span>
4548
</div>
4649
<span className="inline-block px-4">{pillLabel}</span>
47-
<p className="text-sm text-[#4d5693]">{description}</p>
48-
</div>
50+
<p className="text-sm text-[--ods-color-text-500]">{description}</p>
51+
</article>
4952
</RadioTile>
5053
);
5154
}

packages/manager/apps/pci-kubernetes/src/index.css

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@import '@datatr-ux/ods-tailwind-config/style.css';
2-
@import '@datatr-ux/uxlib/style.css';
3-
41
@tailwind base;
52
@tailwind components;
63
@tailwind utilities;
@@ -9,6 +6,10 @@
96
@apply md:mx-12 mt-8;
107
}
118

9+
html {
10+
font-family: var(--ods-font-family-default);
11+
}
12+
1213
a:not([class]),
1314
.oui-link {
1415
font-family: 'Source Sans Pro', sans-serif;
@@ -43,12 +44,12 @@ code {
4344
border-radius: 6px !important;
4445
}
4546

46-
osds-tile,
47-
osds-input {
48-
border-width: var(--ods-size-input-md-border-width);
49-
border-color: var(--ods-color-primary-200);
47+
.log-container {
48+
color: var(--ods-color-text-500);
5049
}
5150

51+
osds-tile,
5252
osds-input {
53+
border-width: var(--ods-size-input-md-border-width);
5354
border-color: var(--ods-color-primary-200);
5455
}

packages/manager/apps/pci-kubernetes/src/main.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React from 'react';
22

33
import ReactDOM from 'react-dom/client';
44

5+
import '@ovhcloud/ods-themes/default';
6+
57
import '@ovh-ux/manager-pci-common/dist/style.css';
68
import { ShellContext, initI18n, initShellContext } from '@ovh-ux/manager-react-shell-client';
79

packages/manager/apps/pci-kubernetes/src/pages/detail/log/Logs.page.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useNavigate, useParams } from 'react-router-dom';
1+
import { useNavigate } from 'react-router-dom';
22

33
import { useTranslation } from 'react-i18next';
44

@@ -12,18 +12,18 @@ import {
1212
} from '@ovhcloud/ods-components';
1313
import { OsdsIcon, OsdsLink, OsdsText } from '@ovhcloud/ods-components/react';
1414

15-
import { LogsView } from '@ovh-ux/manager-pci-common';
15+
import { LogsView, useParam } from '@ovh-ux/manager-pci-common';
1616
import { Notifications, useMe } from '@ovh-ux/manager-react-components';
1717

1818
import { KubeLogsProvider } from './KubeLogsProvider';
1919
import { LOGS_INFO } from './constants';
2020

2121
export default function LogsPage() {
2222
const { t } = useTranslation('logs');
23-
const { kubeId, projectId } = useParams();
23+
const { kubeId, projectId } = useParam('kubeId', 'projectId');
2424
const navigate = useNavigate();
2525
const ovhSubsidiary = useMe()?.me?.ovhSubsidiary;
26-
const infoLink = LOGS_INFO[ovhSubsidiary] || LOGS_INFO.DEFAULT;
26+
const infoLink = LOGS_INFO[ovhSubsidiary as keyof typeof LOGS_INFO] || LOGS_INFO.DEFAULT;
2727

2828
return (
2929
<KubeLogsProvider kubeId={kubeId} projectId={projectId}>
@@ -52,7 +52,9 @@ export default function LogsPage() {
5252
/>
5353
</span>
5454
</OsdsLink>
55-
<LogsView onGotoStreams={() => navigate('./streams')} />
55+
<div className="log-container">
56+
<LogsView onGotoStreams={() => navigate('./streams')} />
57+
</div>
5658
</KubeLogsProvider>
5759
);
5860
}

packages/manager/apps/pci-kubernetes/src/pages/new/steps/LocationStep.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export function LocationStep({ projectId, onSubmit, step }: Readonly<LocationSte
167167
/>
168168
</div>
169169

170-
<div className="grid md:grid-cols-4 gap-4 my-5">
170+
<div className="grid md:grid-cols-3 lg:grid-cols-4 gap-6 my-5">
171171
{tilesData.map(({ title, pillLabel, description, regionType, badge }) => (
172172
<KubeDeploymentTile
173173
key={regionType}

0 commit comments

Comments
 (0)