Skip to content

Commit af9a387

Browse files
fix(manager-react-components): correct eslint naming convention
ref: #MANAGER-18712 Signed-off-by: Alex Boungnaseng <[email protected]>
1 parent 8870469 commit af9a387

File tree

20 files changed

+53
-53
lines changed

20 files changed

+53
-53
lines changed

packages/manager-react-components/src/components/Link/Link.component.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import {
99
TOOLTIP_POSITION,
1010
} from '@ovhcloud/ods-react';
1111
import { useTranslation } from 'react-i18next';
12-
import { LINK_TYPE, LinkProps, LinkIconsProps } from './Link.props';
12+
import { LinkType, LinkProps, LinkIconsProps } from './Link.props';
1313
import { useAuthorizationIam } from '../../hooks';
1414

1515
const LinkIcons: React.FC<LinkIconsProps> = ({ type, children }) => (
1616
<>
17-
{type === LINK_TYPE.back && <Icon name="arrow-left" />}
17+
{type === LinkType.back && <Icon name="arrow-left" />}
1818
{children}
19-
{type === LINK_TYPE.external && <Icon name="external-link" />}
20-
{type === LINK_TYPE.next && <Icon name="arrow-right" />}
19+
{type === LinkType.external && <Icon name="external-link" />}
20+
{type === LinkType.next && <Icon name="arrow-right" />}
2121
</>
2222
);
2323

packages/manager-react-components/src/components/Link/Link.props.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { DOMAttributes } from 'react';
22
import { LinkProp } from '@ovhcloud/ods-react';
33

4-
export enum LINK_TYPE {
4+
export enum LinkType {
55
back = 'back',
66
next = 'next',
77
external = 'external',
@@ -15,7 +15,7 @@ export interface LinkProps extends LinkProp, DOMAttributes<HTMLAnchorElement> {
1515
href?: string;
1616
rel?: string;
1717
target?: string;
18-
type?: LINK_TYPE;
18+
type?: LinkType;
1919
// Iam trigger
2020
iamActions?: string[];
2121
urn?: string;
@@ -25,6 +25,6 @@ export interface LinkProps extends LinkProp, DOMAttributes<HTMLAnchorElement> {
2525
}
2626

2727
export interface LinkIconsProps {
28-
type?: LINK_TYPE;
28+
type?: LinkType;
2929
children: React.ReactNode;
3030
}

packages/manager-react-components/src/components/Link/__tests__/Link.snapshot.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Link } from '../Link.component';
2-
import { LINK_TYPE } from '../Link.props';
2+
import { LinkType } from '../Link.props';
33
import { render } from '../../../utils/test.provider';
44

55
describe('Link component', () => {
@@ -16,7 +16,7 @@ describe('Link component', () => {
1616
const props = {
1717
children: 'Back to the list',
1818
href: 'https://www.example.com',
19-
type: LINK_TYPE.back,
19+
type: LinkType.back,
2020
};
2121
const { asFragment } = render(<Link {...props} />);
2222
expect(asFragment()).toMatchSnapshot();
@@ -26,7 +26,7 @@ describe('Link component', () => {
2626
const props = {
2727
children: 'Next Page',
2828
href: 'https://www.example.com',
29-
type: LINK_TYPE.next,
29+
type: LinkType.next,
3030
};
3131
const { asFragment } = render(<Link {...props} />);
3232
expect(asFragment()).toMatchSnapshot();
@@ -37,7 +37,7 @@ describe('Link component', () => {
3737
href: 'https://www.ovhcloud.com/',
3838
target: '_blank',
3939
children: 'External Page',
40-
type: LINK_TYPE.external,
40+
type: LinkType.external,
4141
};
4242

4343
const { asFragment } = render(<Link {...props} />);

packages/manager-react-components/src/components/Link/__tests__/Link.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import AxiosMockAdapter from 'axios-mock-adapter';
22
import { screen, waitFor } from '@testing-library/react';
33
import apiClient from '@ovh-ux/manager-core-api';
44
import { Link } from '../Link.component';
5-
import { LINK_TYPE } from '../Link.props';
5+
import { LinkType } from '../Link.props';
66
import { render } from '../../../utils/test.provider';
77

88
const PROPS_LINK = {
@@ -26,7 +26,7 @@ describe('Link component', () => {
2626
const props = {
2727
children: 'Back to the list',
2828
href: 'https://www.example.com',
29-
type: LINK_TYPE.back,
29+
type: LinkType.back,
3030
};
3131
render(<Link {...props} />);
3232
const linkElement = screen.getByText('Back to the list');
@@ -43,7 +43,7 @@ describe('Link component', () => {
4343
const props = {
4444
children: 'Next Page',
4545
href: 'https://www.example.com',
46-
type: LINK_TYPE.next,
46+
type: LinkType.next,
4747
};
4848
render(<Link {...props} />);
4949
const linkElement = screen.getByText('Next Page');
@@ -61,7 +61,7 @@ describe('Link component', () => {
6161
href: 'https://www.ovhcloud.com/',
6262
target: '_blank',
6363
children: 'External Page',
64-
type: LINK_TYPE.external,
64+
type: LinkType.external,
6565
};
6666

6767
render(<Link {...props} />);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export { Link } from './Link.component';
22
export type { LinkProps } from './Link.props';
3-
export { LINK_TYPE } from './Link.props';
3+
export { LinkType } from './Link.props';

packages/manager-react-components/src/components/navigation/card/card.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { useTranslation } from 'react-i18next';
33

44
import { OdsBadge, OdsCard } from '@ovhcloud/ods-components/react';
5-
import { LINK_TYPE, Link } from '../../Link';
5+
import { LinkType, Link } from '../../Link';
66
import './translations/translations';
77

88
export interface IBadge {
@@ -89,7 +89,7 @@ export const Card: React.FC<CardProps> = ({
8989
<Link
9090
tab-index="-1"
9191
label={hrefLabel ?? t('see_more_label')}
92-
type={isExternalHref ? LINK_TYPE.external : LINK_TYPE.next}
92+
type={isExternalHref ? LinkType.external : LinkType.next}
9393
/>
9494
</div>
9595
</div>

packages/manager-react-components/src/components/navigation/menus/changelog/changelog.component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
import { OdsPopover, OdsButton } from '@ovhcloud/ods-components/react';
88
import { useTranslation } from 'react-i18next';
99
import { useOvhTracking } from '@ovh-ux/manager-react-shell-client';
10-
import { Link, LINK_TYPE } from '../../../Link';
10+
import { Link, LinkType } from '../../../Link';
1111
import '../translations/translation';
1212

1313
export interface ChangelogLinks {
@@ -54,8 +54,8 @@ export const ChangelogButton: React.FC<ChangelogButtonProps> = ({
5454
<Link
5555
href={value}
5656
target="_blank"
57-
type={LINK_TYPE.external}
58-
rel={LINK_TYPE.external}
57+
type={LinkType.external}
58+
rel={LinkType.external}
5959
label={t(`mrc_changelog_${key}`)}
6060
onClick={() =>
6161
trackClick({

packages/manager-react-components/src/components/navigation/menus/guide/guide.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@ovhcloud/ods-components';
88
import { OdsPopover, OdsButton } from '@ovhcloud/ods-components/react';
99
import { useTranslation } from 'react-i18next';
10-
import { Link, LinkProps, LINK_TYPE } from '../../../Link';
10+
import { Link, LinkProps, LinkType } from '../../../Link';
1111
import '../translations/translation';
1212

1313
export interface GuideItem extends Omit<LinkProps, 'id'> {
@@ -53,7 +53,7 @@ export const GuideButton: React.FC<GuideButtonProps> = ({
5353
{items.map(({ id, onClick, ...rest }) => (
5454
<Link
5555
key={id}
56-
type={LINK_TYPE.external}
56+
type={LinkType.external}
5757
onClick={onClick}
5858
{...rest}
5959
/>

packages/manager-react-components/src/components/order/OrderSummary.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { OdsButton, OdsText } from '@ovhcloud/ods-components/react';
77
import { Trans, useTranslation } from 'react-i18next';
88
import React, { useEffect } from 'react';
99
import { useOrderContext } from './Order.context';
10-
import { Link, LINK_TYPE } from '../Link';
10+
import { Link, LinkType } from '../Link';
1111

1212
export type TOrderSummary = {
1313
onFinish: () => void;
@@ -54,7 +54,7 @@ export const OrderSummary: React.FC<TOrderSummary> = ({
5454
components={{
5555
ExternalLink: (
5656
<Link
57-
type={LINK_TYPE.external}
57+
type={LinkType.external}
5858
target="_blank"
5959
href={orderLink}
6060
data-testid="order-summary-link"

packages/manager-react-components/src/components/price/Price.component.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
} from './Price.utils';
1616
import './translations';
1717

18-
import { PriceText, PRICE_TEXT_PRESET } from './price-text';
18+
import { PriceText, PriceTextPreset } from './price-text';
1919

2020
export function Price({
2121
value,
@@ -74,7 +74,7 @@ export function Price({
7474
<PriceText
7575
price={priceWithTax}
7676
label={t('price_ttc_label')}
77-
preset={PRICE_TEXT_PRESET.WITH_TAX}
77+
preset={PriceTextPreset.WITH_TAX}
7878
/>
7979
</>
8080
),
@@ -117,7 +117,7 @@ export function Price({
117117
<PriceText
118118
price={priceWithTax}
119119
label={t('price_gst_incl_label')}
120-
preset={PRICE_TEXT_PRESET.WITH_TAX}
120+
preset={PriceTextPreset.WITH_TAX}
121121
/>
122122
</>
123123
),

0 commit comments

Comments
 (0)