From 80e8eb730b5d437a0c0a38087bba9399fe39fb5b Mon Sep 17 00:00:00 2001 From: Ismail Cherri Date: Thu, 25 Apr 2024 17:36:02 +0200 Subject: [PATCH] SONAR-22049 Align FlagMessage --- .../design-system/src/components/index.ts | 1 - .../{ => sonar-aligned}/components/FlagMessage.tsx | 14 ++++++++++---- .../components/__tests__/FlagMessage-test.tsx | 4 ++-- .../src/sonar-aligned/components/index.ts | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) rename server/sonar-web/design-system/src/{ => sonar-aligned}/components/FlagMessage.tsx (93%) rename server/sonar-web/design-system/src/{ => sonar-aligned}/components/__tests__/FlagMessage-test.tsx (96%) diff --git a/server/sonar-web/design-system/src/components/index.ts b/server/sonar-web/design-system/src/components/index.ts index 35e06bdc597..e94ac812c9e 100644 --- a/server/sonar-web/design-system/src/components/index.ts +++ b/server/sonar-web/design-system/src/components/index.ts @@ -39,7 +39,6 @@ export * from './FacetBox'; export * from './FacetItem'; export { FailedQGConditionLink } from './FailedQGConditionLink'; export * from './FavoriteButton'; -export { DismissableFlagMessage, FlagMessage } from './FlagMessage'; export * from './FlowStep'; export * from './HighlightRing'; export * from './HighlightedSection'; diff --git a/server/sonar-web/design-system/src/components/FlagMessage.tsx b/server/sonar-web/design-system/src/sonar-aligned/components/FlagMessage.tsx similarity index 93% rename from server/sonar-web/design-system/src/components/FlagMessage.tsx rename to server/sonar-web/design-system/src/sonar-aligned/components/FlagMessage.tsx index 47fb9b9fa58..6b05991c12b 100644 --- a/server/sonar-web/design-system/src/components/FlagMessage.tsx +++ b/server/sonar-web/design-system/src/sonar-aligned/components/FlagMessage.tsx @@ -22,10 +22,16 @@ import classNames from 'classnames'; import * as React from 'react'; import { useIntl } from 'react-intl'; import tw from 'twin.macro'; -import { themeBorder, themeColor, themeContrast } from '../helpers/theme'; -import { ThemeColors } from '../types/theme'; -import { InteractiveIcon } from './InteractiveIcon'; -import { CloseIcon, FlagErrorIcon, FlagInfoIcon, FlagSuccessIcon, FlagWarningIcon } from './icons'; +import { ThemeColors } from '~types/theme'; +import { InteractiveIcon } from '../../components/InteractiveIcon'; +import { + CloseIcon, + FlagErrorIcon, + FlagInfoIcon, + FlagSuccessIcon, + FlagWarningIcon, +} from '../../components/icons'; +import { themeBorder, themeColor, themeContrast } from '../../helpers/theme'; export type Variant = 'error' | 'warning' | 'success' | 'info'; diff --git a/server/sonar-web/design-system/src/components/__tests__/FlagMessage-test.tsx b/server/sonar-web/design-system/src/sonar-aligned/components/__tests__/FlagMessage-test.tsx similarity index 96% rename from server/sonar-web/design-system/src/components/__tests__/FlagMessage-test.tsx rename to server/sonar-web/design-system/src/sonar-aligned/components/__tests__/FlagMessage-test.tsx index 2b2afc1ee11..6772436944f 100644 --- a/server/sonar-web/design-system/src/components/__tests__/FlagMessage-test.tsx +++ b/server/sonar-web/design-system/src/sonar-aligned/components/__tests__/FlagMessage-test.tsx @@ -19,8 +19,8 @@ */ import { screen } from '@testing-library/react'; import { IntlShape } from 'react-intl'; -import { render } from '../../helpers/testUtils'; -import { FCProps } from '../../types/misc'; +import { FCProps } from '~types/misc'; +import { render } from '../../../helpers/testUtils'; import { DismissableFlagMessage, FlagMessage, Variant } from '../FlagMessage'; jest.mock( diff --git a/server/sonar-web/design-system/src/sonar-aligned/components/index.ts b/server/sonar-web/design-system/src/sonar-aligned/components/index.ts index 459ba9d1655..9ffeb585803 100644 --- a/server/sonar-web/design-system/src/sonar-aligned/components/index.ts +++ b/server/sonar-web/design-system/src/sonar-aligned/components/index.ts @@ -19,6 +19,7 @@ */ export * from './Card'; +export { DismissableFlagMessage, FlagMessage } from './FlagMessage'; export * from './MetricsRatingBadge'; export * from './Table'; export * from './buttons'; -- 2.39.5