From ccbdf257df3f9406d38e3b16f66ec764dd0f7603 Mon Sep 17 00:00:00 2001 From: David Cho-Lerat Date: Fri, 20 Sep 2024 10:18:00 +0200 Subject: [PATCH] SONAR-23030 Use Label from Echoes --- .../src/components/input/FormField.tsx | 6 ++-- .../background-tasks/components/Search.tsx | 31 ++++++++++++------- .../js/apps/users/components/TokensForm.tsx | 29 ++++++----------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/server/sonar-web/design-system/src/components/input/FormField.tsx b/server/sonar-web/design-system/src/components/input/FormField.tsx index 0a1c5369948..be9a4afa452 100644 --- a/server/sonar-web/design-system/src/components/input/FormField.tsx +++ b/server/sonar-web/design-system/src/components/input/FormField.tsx @@ -17,7 +17,9 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + import styled from '@emotion/styled'; +import { Label } from '@sonarsource/echoes-react'; import { ReactNode } from 'react'; import tw from 'twin.macro'; import { Note } from '../../sonar-aligned'; @@ -50,7 +52,7 @@ export function FormField({ title, ariaLabel, requiredAriaLabel, -}: Props) { +}: Readonly) { return ( @@ -72,7 +74,7 @@ export function FormField({ // This is needed to prevent the target input/button from being focused // when clicking/hovering on the label. More info https://stackoverflow.com/questions/9098581/why-is-hover-for-input-triggered-on-corresponding-label-in-css -const StyledLabel = styled.label` +const StyledLabel = styled(Label)` pointer-events: none; `; diff --git a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.tsx b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.tsx index f611187e49b..88168451661 100644 --- a/server/sonar-web/src/main/js/apps/background-tasks/components/Search.tsx +++ b/server/sonar-web/src/main/js/apps/background-tasks/components/Search.tsx @@ -17,7 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { Button } from '@sonarsource/echoes-react'; + +import { Button, Label } from '@sonarsource/echoes-react'; import { InputSearch } from 'design-system'; import * as React from 'react'; import { translate } from '../../../helpers/l10n'; @@ -88,24 +89,27 @@ export default class Search extends React.PureComponent {
  • - + +
  • + {types.length > 1 && (
  • - + + { />
  • )} + {!component && (
  • - +
  • )} +
  • - + + { + diff --git a/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx b/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx index d7914cb8807..7bbe0507467 100644 --- a/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx +++ b/server/sonar-web/src/main/js/apps/users/components/TokensForm.tsx @@ -18,14 +18,12 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { Heading } from '@sonarsource/echoes-react'; +import { Button, ButtonVariety, Heading, Label, Spinner } from '@sonarsource/echoes-react'; import { - ButtonPrimary, ContentCell, GreySeparator, InputField, InputSelect, - Spinner, Table, TableRow, } from 'design-system'; @@ -203,9 +201,7 @@ export function TokensForm(props: Readonly) {
    - + ) { {displayTokenTypeInput && ( <>
    - + ) { {newTokenType === TokenType.Project && (
    - + ) { )}
    - + ) { />
    - {translate('users.generate')} - + {newToken && } - +