From: stanislavh Date: Wed, 27 Sep 2023 14:19:08 +0000 (+0200) Subject: SONAR-20366 Migrate profile compare page X-Git-Tag: 10.3.0.82913~308 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ff7c5fd8418e47d82310972731527807c2b6899c;p=sonarqube.git SONAR-20366 Migrate profile compare page Co-authored-by: Benjamin Raymond <31401273+7PH@users.noreply.github.com> --- diff --git a/server/sonar-web/__mocks__/react-intl.tsx b/server/sonar-web/__mocks__/react-intl.tsx index dbd784e1301..aa20e55fbda 100644 --- a/server/sonar-web/__mocks__/react-intl.tsx +++ b/server/sonar-web/__mocks__/react-intl.tsx @@ -21,6 +21,9 @@ import * as React from 'react'; module.exports = { ...jest.requireActual('react-intl'), + useIntl: () => ({ + formatMessage: ({ id }, values = {}) => [id, ...Object.values(values)].join('.'), + }), FormattedMessage: ({ id, values }: { id: string; values?: { [x: string]: React.ReactNode } }) => { return ( <> diff --git a/server/sonar-web/design-system/src/components/Table.tsx b/server/sonar-web/design-system/src/components/Table.tsx index b44ce861b8b..0e24be3e324 100644 --- a/server/sonar-web/design-system/src/components/Table.tsx +++ b/server/sonar-web/design-system/src/components/Table.tsx @@ -26,6 +26,7 @@ import { themeBorder, themeColor } from '../helpers'; import { FCProps } from '../types/misc'; export interface TableProps extends ComponentProps<'table'> { + caption?: ReactNode; columnCount: number; columnWidths?: Array; header?: ReactNode; @@ -39,6 +40,7 @@ export function Table(props: TableProps) { columnCount, columnWidths = [], header, + caption, children, noHeaderTopBorder, noSidePadding, @@ -49,7 +51,7 @@ export function Table(props: TableProps) { @@ -58,11 +60,21 @@ export function Table(props: TableProps) { ))} + + {caption && ( + +
+ {caption} +
+ + )} + {header && ( {header} )} + {children}
); diff --git a/server/sonar-web/design-system/src/components/input/SearchSelectDropdown.tsx b/server/sonar-web/design-system/src/components/input/SearchSelectDropdown.tsx index d6f0fe887d6..ecbd8e59d55 100644 --- a/server/sonar-web/design-system/src/components/input/SearchSelectDropdown.tsx +++ b/server/sonar-web/design-system/src/components/input/SearchSelectDropdown.tsx @@ -48,12 +48,13 @@ export interface SearchSelectDropdownProps< V, Option extends LabelValueSelectOption, IsMulti extends boolean = false, - Group extends GroupBase