Skip to content

Commit 8f8b6ba

Browse files
darseneyjaaouane
authored andcommitted
chore(observability): bump ODS 19.5
resolves: #MAOBS-29 Signed-off-by: David Arsène <david.arsene.ext@ovhcloud.com>
1 parent 1fdb8ae commit 8f8b6ba

File tree

12 files changed

+357
-101
lines changed

12 files changed

+357
-101
lines changed

packages/manager/apps/observability/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"@ovh-ux/manager-module-order": "*",
2828
"@ovh-ux/manager-react-core-application": "*",
2929
"@ovh-ux/manager-react-shell-client": "*",
30-
"@ovh-ux/muk": "0.13.2",
30+
"@ovh-ux/muk": "1.2.0",
3131
"@ovh-ux/request-tagger": "*",
3232
"@ovh-ux/shell": "^4.5.7",
33-
"@ovhcloud/ods-react": "^19.4.0",
34-
"@ovhcloud/ods-themes": "^19.4.0",
33+
"@ovhcloud/ods-react": "19.5.0",
34+
"@ovhcloud/ods-themes": "19.5.0",
3535
"@tanstack/react-query": "5.51.21",
3636
"axios": "^1.6.0",
3737
"clsx": "^2.1.1",
@@ -60,4 +60,4 @@
6060
"EU",
6161
"US"
6262
]
63-
}
63+
}

packages/manager/apps/observability/src/components/infrastructures/region-badge-type/RegionBadgeType.component.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ import {
1010
Tooltip,
1111
TooltipContent,
1212
TooltipTrigger,
13-
} from '@ovh-ux/muk';
13+
} from '@ovhcloud/ods-react';
1414

15+
import { RegionBadgeTypeProps } from '@/components/infrastructures/region-badge-type/RegionBadgeType.props';
1516
import { RegionType } from '@/types/infrastructures.type';
1617
import { REGION_BADGE_LABELS } from '@/utils/labels.constants';
1718

18-
import { RegionBadgeTypeProps } from './RegionBadgeType.props';
19-
2019
const bgColors: Record<RegionType, string> = {
2120
'LOCAL-ZONE': 'bg-[--ods-color-primary-100]',
2221
'REGION-1-AZ': 'bg-[--ods-color-primary-400]',

packages/manager/apps/observability/src/components/infrastructures/region-badge-type/__tests__/RegionBadgeType.component.spec.tsx

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ vi.mock('react-i18next', () => ({
2020
}),
2121
}));
2222

23-
// Mock MUK components
24-
vi.mock('@ovh-ux/muk', () => ({
23+
// Mock ODS React components
24+
vi.mock('@ovhcloud/ods-react', () => ({
2525
Badge: ({
2626
id,
2727
children,
@@ -39,6 +39,10 @@ vi.mock('@ovh-ux/muk', () => ({
3939
{children}
4040
</div>
4141
),
42+
BADGE_COLOR: {
43+
information: 'information',
44+
promotion: 'promotion',
45+
},
4246
Icon: ({ name, className }: { name: string; className?: string }) => (
4347
<span data-testid="icon" data-name={name} className={className} />
4448
),
@@ -63,23 +67,6 @@ vi.mock('@ovh-ux/muk', () => ({
6367
{children}
6468
</div>
6569
),
66-
Text: ({
67-
children,
68-
preset,
69-
className,
70-
}: {
71-
children: React.ReactNode;
72-
preset?: string;
73-
className?: string;
74-
}) => (
75-
<span data-testid="text" data-preset={preset} className={className}>
76-
{children}
77-
</span>
78-
),
79-
BADGE_COLOR: {
80-
information: 'information',
81-
promotion: 'promotion',
82-
},
8370
ICON_NAME: {
8471
circleInfo: 'circle-info',
8572
},

packages/manager/apps/observability/src/components/listing/common/confirmation-modal/ConfirmationModal.component.tsx

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ import {
88
Button,
99
MODAL_COLOR,
1010
Message,
11+
Modal,
12+
ModalBody,
13+
ModalContent,
1114
SPINNER_SIZE,
1215
Spinner,
1316
TEXT_PRESET,
1417
Text,
1518
} from '@ovhcloud/ods-react';
1619

1720
import { NAMESPACES } from '@ovh-ux/manager-common-translations';
18-
import { Modal } from '@ovh-ux/muk';
1921

2022
import ErrorMessage from '@/components/error/ErrorMessage.component';
2123
import { ConfirmationModalProps } from '@/components/listing/common/confirmation-modal/ConfirmationModal.props';
@@ -36,52 +38,54 @@ export const ConfirmationModal = ({
3638
const { t } = useTranslation(NAMESPACES.ACTIONS);
3739

3840
return (
39-
<Modal data-testid="confirmation-modal" type={type} onOpenChange={onDismiss} open={true}>
40-
<div className="space-y-4">
41-
{error && (
42-
<Message
43-
color="critical"
44-
dismissible={false}
45-
className="w-full"
46-
data-testid="confirmation-modal-error-message"
47-
>
48-
<ErrorMessage error={error} />
49-
</Message>
50-
)}
41+
<Modal data-testid="confirmation-modal" open>
42+
<ModalContent dismissible={false}>
43+
<ModalBody className="space-y-4">
44+
{error && (
45+
<Message
46+
color="critical"
47+
dismissible={false}
48+
className="w-full"
49+
data-testid="confirmation-modal-error-message"
50+
>
51+
<ErrorMessage error={error} />
52+
</Message>
53+
)}
5154

52-
<Text preset={TEXT_PRESET.heading4}>{title}</Text>
53-
<Text preset={TEXT_PRESET.paragraph}>{message}</Text>
55+
<Text preset={TEXT_PRESET.heading4}>{title}</Text>
56+
<Text preset={TEXT_PRESET.paragraph}>{message}</Text>
5457

55-
{isLoading && (
56-
<div data-testid="spinner" className="my-5 flex justify-center">
57-
<Spinner size={SPINNER_SIZE.md} inline-block></Spinner>
58-
</div>
59-
)}
58+
{isLoading && (
59+
<div data-testid="spinner" className="my-5 flex justify-center">
60+
<Spinner size={SPINNER_SIZE.md} inline-block></Spinner>
61+
</div>
62+
)}
6063

61-
{!isLoading && (
62-
<div className="flex justify-end gap-2">
63-
<Button
64-
data-testid={'cancel-button-test-id'}
65-
color={BUTTON_COLOR.primary}
66-
onClick={onDismiss}
67-
variant={BUTTON_VARIANT.ghost}
68-
>
69-
{cancelButtonLabel || t('cancel')}
70-
</Button>
64+
{!isLoading && (
65+
<div className="flex justify-end gap-2">
66+
<Button
67+
data-testid={'cancel-button-test-id'}
68+
color={BUTTON_COLOR.primary}
69+
onClick={onDismiss}
70+
variant={BUTTON_VARIANT.ghost}
71+
>
72+
{cancelButtonLabel || t('cancel')}
73+
</Button>
7174

72-
<Button
73-
data-testid={'confirm-button-test-id'}
74-
color={type === MODAL_COLOR.critical ? BUTTON_COLOR.critical : BUTTON_COLOR.primary}
75-
onClick={onConfirm}
76-
disabled={isConfirmButtonDisabled || isConfirmButtonLoading}
77-
loading={isConfirmButtonLoading}
78-
variant={BUTTON_VARIANT.default}
79-
>
80-
{confirmButtonLabel || t('confirm')}
81-
</Button>
82-
</div>
83-
)}
84-
</div>
75+
<Button
76+
data-testid={'confirm-button-test-id'}
77+
color={type === MODAL_COLOR.critical ? BUTTON_COLOR.critical : BUTTON_COLOR.primary}
78+
onClick={onConfirm}
79+
disabled={isConfirmButtonDisabled || isConfirmButtonLoading}
80+
loading={isConfirmButtonLoading}
81+
variant={BUTTON_VARIANT.default}
82+
>
83+
{confirmButtonLabel || t('confirm')}
84+
</Button>
85+
</div>
86+
)}
87+
</ModalBody>
88+
</ModalContent>
8589
</Modal>
8690
);
8791
};

packages/manager/apps/observability/src/components/listing/common/confirmation-modal/__tests__/ConfirmationModal.spec.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ vi.mock('react-i18next', () => ({
1818
),
1919
}));
2020

21-
vi.mock('@ovh-ux/muk', () => ({
21+
vi.mock('@ovhcloud/ods-react', () => ({
2222
Modal: ({
2323
children,
2424
'data-testid': dataTestId,
@@ -32,6 +32,10 @@ vi.mock('@ovh-ux/muk', () => ({
3232
{children}
3333
</div>
3434
),
35+
ModalContent: ({ children }: { children: React.ReactNode }) => <div>{children}</div>,
36+
ModalBody: ({ children, className }: { children: React.ReactNode; className?: string }) => (
37+
<div className={className}>{children}</div>
38+
),
3539
Text: ({ children }: { children: React.ReactNode }) => <span>{children}</span>,
3640
Button: ({
3741
children,
@@ -69,12 +73,13 @@ vi.mock('@ovh-ux/muk', () => ({
6973
},
7074
BUTTON_VARIANT: {
7175
default: 'default',
72-
outline: 'outline',
76+
ghost: 'ghost',
7377
},
7478
SPINNER_SIZE: {
7579
md: 'md',
7680
},
7781
TEXT_PRESET: {
82+
heading4: 'heading4',
7883
paragraph: 'paragraph',
7984
},
8085
}));

packages/manager/apps/observability/src/components/listing/tenants/actions/TenantsListActions.component.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ import { useNavigate } from 'react-router-dom';
44

55
import { useTranslation } from 'react-i18next';
66

7+
import { BUTTON_COLOR, BUTTON_VARIANT, ICON_NAME, POPOVER_POSITION } from '@ovhcloud/ods-react';
8+
79
import { NAMESPACES } from '@ovh-ux/manager-common-translations';
8-
import {
9-
ActionMenu,
10-
ActionMenuItemProps,
11-
BUTTON_COLOR,
12-
BUTTON_VARIANT,
13-
ICON_NAME,
14-
POPOVER_POSITION,
15-
} from '@ovh-ux/muk';
10+
import { ActionMenu, ActionMenuItemProps } from '@ovh-ux/muk';
1611

1712
import { LocationPathParams } from '@/routes/Routes.constants';
1813
import { getDeleteTenantUrl, getEditTenantUrl, getTenantDashboardUrl } from '@/routes/Routes.utils';

packages/manager/apps/observability/src/components/listing/tenants/actions/__tests__/TenantsListActions.component.spec.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ vi.mock('react-i18next', () => ({
2323
}),
2424
}));
2525

26+
// Mock ODS React components
27+
vi.mock('@ovhcloud/ods-react', () => ({
28+
ICON_NAME: {
29+
ellipsisVertical: 'ellipsis-vertical',
30+
},
31+
POPOVER_POSITION: {
32+
bottomEnd: 'bottom-end',
33+
},
34+
BUTTON_COLOR: {
35+
critical: 'critical',
36+
},
37+
BUTTON_VARIANT: {
38+
ghost: 'ghost',
39+
},
40+
}));
41+
2642
// Mock MUK components
2743
vi.mock('@ovh-ux/muk', () => ({
2844
ActionMenu: ({
@@ -62,18 +78,6 @@ vi.mock('@ovh-ux/muk', () => ({
6278
</div>
6379
),
6480
ActionMenuItem: {},
65-
BUTTON_COLOR: {
66-
critical: 'critical',
67-
},
68-
BUTTON_VARIANT: {
69-
ghost: 'ghost',
70-
},
71-
ICON_NAME: {
72-
ellipsisVertical: 'ellipsis-vertical',
73-
},
74-
POPOVER_POSITION: {
75-
bottomEnd: 'bottom-end',
76-
},
7781
}));
7882

7983
vi.mock('@/routes/Routes.utils', () => ({

packages/manager/apps/observability/src/components/listing/tenants/top-bar/TenantsListTopbar.component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export default function TenantsListTopbar() {
2828
variant={BUTTON_VARIANT.default}
2929
urn={selectedService?.iam?.urn ?? ''}
3030
iamActions={IAM_ACTIONS.CREATE_TENANT}
31-
isIamTrigger={true}
3231
displayTooltip={true}
3332
disabled={isLoading}
3433
loading={isLoading}

packages/manager/apps/observability/src/components/listing/tenants/top-bar/__tests__/TenantsListTopbar.component.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ vi.mock('@ovh-ux/muk', () => ({
4646
onClick={onClick}
4747
data-variant={variant}
4848
data-urn={urn}
49-
data-iam-actions={iamActions.join(',')}
49+
data-iam-actions={iamActions?.join(',') ?? ''}
5050
data-display-tooltip={displayTooltip}
5151
>
5252
{children}

packages/manager/apps/observability/src/pages/tenants/TenantForm.component.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ export const TenantForm = ({ tenant }: TenantFormProps) => {
187187
loading={isPending}
188188
iamActions={isEditionMode ? IAM_ACTIONS.EDIT_TENANT : IAM_ACTIONS.CREATE_TENANT}
189189
urn={isEditionMode ? tenant.iam?.urn : selectedService?.iam?.urn}
190-
isIamTrigger={true}
191190
>
192191
{t(`${NAMESPACES.ACTIONS}:${isEditionMode ? 'save' : 'create'}`)}
193192
</Button>

0 commit comments

Comments
 (0)