From: Jeremy Davis Date: Wed, 22 May 2024 10:12:50 +0000 (+0200) Subject: SONAR-22218 Rename props to match the new API X-Git-Tag: 10.6.0.92116~92 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=42537a47960b55f568297ba2140a3b2919b017df;p=sonarqube.git SONAR-22218 Rename props to match the new API --- diff --git a/server/sonar-web/design-system/src/components/Breadcrumbs.tsx b/server/sonar-web/design-system/src/components/Breadcrumbs.tsx index bb30a36052b..5d981c9ce65 100644 --- a/server/sonar-web/design-system/src/components/Breadcrumbs.tsx +++ b/server/sonar-web/design-system/src/components/Breadcrumbs.tsx @@ -117,9 +117,9 @@ export function Breadcrumbs(props: Props) { if (isLastBreadcrumb && breadcrumbSize > maxWidth) { onlyVisibleBreadcrumbs.push( {modifiedChildren[index]} , diff --git a/server/sonar-web/design-system/src/components/BubbleChart.tsx b/server/sonar-web/design-system/src/components/BubbleChart.tsx index 61bdbd22b86..108527dbb93 100644 --- a/server/sonar-web/design-system/src/components/BubbleChart.tsx +++ b/server/sonar-web/design-system/src/components/BubbleChart.tsx @@ -365,7 +365,7 @@ export function BubbleChart(props: BubbleChartProps) { return (
- + {zoomLabel} {': '} @@ -423,7 +423,7 @@ function Bubble(props: BubbleProps) { ); - return {circle}; + return {circle}; } const BubbleStyled = styled.circle` diff --git a/server/sonar-web/design-system/src/components/ColorsLegend.tsx b/server/sonar-web/design-system/src/components/ColorsLegend.tsx index 19abcdc298b..43f7c415241 100644 --- a/server/sonar-web/design-system/src/components/ColorsLegend.tsx +++ b/server/sonar-web/design-system/src/components/ColorsLegend.tsx @@ -49,7 +49,7 @@ export function ColorsLegend(props: ColorLegendProps) { {colors.map((color, idx) => (
  • - +
    {({ setCopyButton, copySuccess }) => ( - +
  • void; onClick?: (isOpen: boolean) => void; open?: boolean; - tooltipComponent?: React.ComponentType>; + tooltipComponent?: React.ComponentType>; } export function FacetBox(props: FacetBoxProps) { @@ -105,7 +105,7 @@ export function FacetBox(props: FacetBoxProps) { {expandable && } {disabled ? ( - + {Boolean(clearable) && ( - + ; overlay: string; toggleFavorite: VoidFunction; - tooltip?: React.ComponentType>; + tooltip?: React.ComponentType>; } export function FavoriteButton(props: Props) { @@ -36,7 +36,7 @@ export function FavoriteButton(props: Props) { const Tooltip = tooltip ?? React.Fragment; return ( - + { const y = Math.round((yScale(index) ?? 0) + yScale.bandwidth() / 2 + BAR_HEIGHT / 2); return ( - + {value} diff --git a/server/sonar-web/design-system/src/components/NavBarTabs.tsx b/server/sonar-web/design-system/src/components/NavBarTabs.tsx index ab3286ec0cf..590cb913605 100644 --- a/server/sonar-web/design-system/src/components/NavBarTabs.tsx +++ b/server/sonar-web/design-system/src/components/NavBarTabs.tsx @@ -75,7 +75,7 @@ export function NavBarTabLink(props: NavBarTabLinkProps) { export function DisabledTabLink(props: { label: string; overlay: React.ReactNode }) { return ( - + {props.label} diff --git a/server/sonar-web/design-system/src/components/Tags.tsx b/server/sonar-web/design-system/src/components/Tags.tsx index 3444f6af034..9fd333135b6 100644 --- a/server/sonar-web/design-system/src/components/Tags.tsx +++ b/server/sonar-web/design-system/src/components/Tags.tsx @@ -40,7 +40,7 @@ interface Props { tags: string[]; tagsClassName?: string; tagsToDisplay?: number; - tooltip?: React.ComponentType>; + tooltip?: React.ComponentType>; } export function Tags({ @@ -63,7 +63,7 @@ export function Tags({ const Tooltip = tooltip || React.Fragment; const displayedTagsContent = (open = false) => ( - + {/* Display first 3 (tagsToDisplay) tags */} {displayedTags.map((tag) => ( diff --git a/server/sonar-web/design-system/src/components/Tooltip.tsx b/server/sonar-web/design-system/src/components/Tooltip.tsx index 053c54d9033..bf17f07979f 100644 --- a/server/sonar-web/design-system/src/components/Tooltip.tsx +++ b/server/sonar-web/design-system/src/components/Tooltip.tsx @@ -37,11 +37,11 @@ const MILLISECONDS_IN_A_SECOND = 1000; interface TooltipProps { children: React.ReactElement; + content: React.ReactNode; mouseEnterDelay?: number; mouseLeaveDelay?: number; onHide?: VoidFunction; onShow?: VoidFunction; - overlay: React.ReactNode; placement?: BasePlacement; visible?: boolean; } @@ -84,7 +84,7 @@ export function Tooltip(props: TooltipProps) { // overlay is a ReactNode, so it can be a boolean, `undefined` or `null` // this allows to easily render a tooltip conditionally // more generaly we avoid rendering empty tooltips - return props.overlay ? {props.children} : props.children; + return props.content ? {props.children} : props.children; } export class TooltipInner extends React.Component { @@ -404,7 +404,7 @@ export class TooltipInner extends React.Component { role="tooltip" style={style} > - {this.props.overlay} + {this.props.content} = ICON_VISIBLE_AT_WIDTH && height >= ICON_VISIBLE_AT_HEIGHT; return ( - + diff --git a/server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx b/server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx index 5e2aebceb65..8f855b319b2 100644 --- a/server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx +++ b/server/sonar-web/design-system/src/components/__tests__/DropdownMenu-test.tsx @@ -43,7 +43,7 @@ it('should render a full menu correctly', () => { it('menu items should work with tooltips', async () => { render( - + button , {}, diff --git a/server/sonar-web/design-system/src/components/__tests__/Tooltip-test.tsx b/server/sonar-web/design-system/src/components/__tests__/Tooltip-test.tsx index 487d1bbf5cf..2d0882b1c3f 100644 --- a/server/sonar-web/design-system/src/components/__tests__/Tooltip-test.tsx +++ b/server/sonar-web/design-system/src/components/__tests__/Tooltip-test.tsx @@ -96,7 +96,7 @@ describe('TooltipInner', () => { children =
    , ) { return render( - } {...props}> + } mouseLeaveDelay={0} {...props}> {children} , ); @@ -105,19 +105,19 @@ describe('TooltipInner', () => { describe('Tooltip', () => { it('should not render tooltip without overlay', async () => { - const { user } = setupWithProps({ overlay: undefined }); + const { user } = setupWithProps({ content: undefined }); await user.hover(screen.getByRole('note')); expect(screen.queryByRole('tooltip')).not.toBeInTheDocument(); }); it('should not render undefined tooltips', async () => { - const { user } = setupWithProps({ overlay: undefined, visible: true }); + const { user } = setupWithProps({ content: undefined, visible: true }); await user.hover(screen.getByRole('note')); expect(screen.queryByRole('tooltip')).not.toBeInTheDocument(); }); it('should not render empty tooltips', async () => { - const { user } = setupWithProps({ overlay: '', visible: true }); + const { user } = setupWithProps({ content: '', visible: true }); await user.hover(screen.getByRole('note')); expect(screen.queryByRole('tooltip')).not.toBeInTheDocument(); }); @@ -127,7 +127,7 @@ describe('Tooltip', () => { children =
    , ) { return render( - } {...props}> + } {...props}> {children} , ); diff --git a/server/sonar-web/design-system/src/components/clipboard.tsx b/server/sonar-web/design-system/src/components/clipboard.tsx index a5c30188f6b..ffe88b4a045 100644 --- a/server/sonar-web/design-system/src/components/clipboard.tsx +++ b/server/sonar-web/design-system/src/components/clipboard.tsx @@ -116,12 +116,12 @@ export function ClipboardButton({ return ( {({ setCopyButton, copySuccess }) => ( - + {children ?? copyLabel} @@ -159,12 +159,12 @@ export function ClipboardIconButton(props: IconButtonProps) { {({ setCopyButton, copySuccess }) => { return ( {copySuccess ? copiedLabel : copyLabel}
    } + mouseEnterDelay={INTERACTIVE_TOOLTIP_DELAY} {...(copySuccess ? { visible: copySuccess } : undefined)} > + {coverageStatus === 'covered' && } {coverageStatus === 'uncovered' && } diff --git a/server/sonar-web/design-system/src/components/input/MultiSelectMenuOption.tsx b/server/sonar-web/design-system/src/components/input/MultiSelectMenuOption.tsx index 2df004a3c6a..2336dd914a3 100644 --- a/server/sonar-web/design-system/src/components/input/MultiSelectMenuOption.tsx +++ b/server/sonar-web/design-system/src/components/input/MultiSelectMenuOption.tsx @@ -56,7 +56,7 @@ export function MultiSelectMenuOption(props: MultiSelectOptionProps) { const label = renderLabel(element); return ( - + css` --background: ${themeColor('button')(props)}; @@ -31,6 +31,6 @@ export const PrimaryStyle = (props: ThemedProps) => css` --border: ${themeBorder('default', 'transparent')(props)}; `; -export const ButtonPrimary: React.FC> = styled(Button)` +export const ButtonPrimary = styled(Button)` ${PrimaryStyle} `; diff --git a/server/sonar-web/design-system/src/sonar-aligned/components/buttons/ButtonSecondary.tsx b/server/sonar-web/design-system/src/sonar-aligned/components/buttons/ButtonSecondary.tsx index 3ee6c5f2892..f513c5f803a 100644 --- a/server/sonar-web/design-system/src/sonar-aligned/components/buttons/ButtonSecondary.tsx +++ b/server/sonar-web/design-system/src/sonar-aligned/components/buttons/ButtonSecondary.tsx @@ -19,9 +19,9 @@ */ import styled from '@emotion/styled'; import { OPACITY_20_PERCENT, themeBorder, themeColor, themeContrast } from '../../../helpers'; -import { Button, ButtonProps } from './Button'; +import { Button } from './Button'; -export const ButtonSecondary: React.FC> = styled(Button)` +export const ButtonSecondary = styled(Button)` --background: ${themeColor('buttonSecondary')}; --backgroundHover: ${themeColor('buttonSecondaryHover')}; --color: ${themeContrast('buttonSecondary')}; diff --git a/server/sonar-web/design-system/src/sonar-aligned/components/buttons/DangerButtonPrimary.tsx b/server/sonar-web/design-system/src/sonar-aligned/components/buttons/DangerButtonPrimary.tsx index b0770cdfce1..ca701d8944e 100644 --- a/server/sonar-web/design-system/src/sonar-aligned/components/buttons/DangerButtonPrimary.tsx +++ b/server/sonar-web/design-system/src/sonar-aligned/components/buttons/DangerButtonPrimary.tsx @@ -19,9 +19,9 @@ */ import styled from '@emotion/styled'; import { OPACITY_20_PERCENT, themeBorder, themeColor, themeContrast } from '../../../helpers'; -import { Button, ButtonProps } from './Button'; +import { Button } from './Button'; -export const DangerButtonPrimary: React.FC> = styled(Button)` +export const DangerButtonPrimary = styled(Button)` --background: ${themeColor('dangerButton')}; --backgroundHover: ${themeColor('dangerButtonHover')}; --color: ${themeContrast('dangerButton')}; diff --git a/server/sonar-web/design-system/src/sonar-aligned/components/buttons/DangerButtonSecondary.tsx b/server/sonar-web/design-system/src/sonar-aligned/components/buttons/DangerButtonSecondary.tsx index 8815ab12de9..81cfc90010b 100644 --- a/server/sonar-web/design-system/src/sonar-aligned/components/buttons/DangerButtonSecondary.tsx +++ b/server/sonar-web/design-system/src/sonar-aligned/components/buttons/DangerButtonSecondary.tsx @@ -19,9 +19,9 @@ */ import styled from '@emotion/styled'; import { OPACITY_20_PERCENT, themeBorder, themeColor, themeContrast } from '../../../helpers'; -import { Button, ButtonProps } from './Button'; +import { Button } from './Button'; -export const DangerButtonSecondary: React.FC> = styled(Button)` +export const DangerButtonSecondary = styled(Button)` --background: ${themeColor('dangerButtonSecondary')}; --backgroundHover: ${themeColor('dangerButtonSecondaryHover')}; --color: ${themeContrast('dangerButtonSecondary')}; diff --git a/server/sonar-web/design-system/src/sonar-aligned/components/buttons/ThirdPartyButton.tsx b/server/sonar-web/design-system/src/sonar-aligned/components/buttons/ThirdPartyButton.tsx index 9239e4ab209..afc27b57f1c 100644 --- a/server/sonar-web/design-system/src/sonar-aligned/components/buttons/ThirdPartyButton.tsx +++ b/server/sonar-web/design-system/src/sonar-aligned/components/buttons/ThirdPartyButton.tsx @@ -18,7 +18,6 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import styled from '@emotion/styled'; -import React from 'react'; import { OPACITY_20_PERCENT } from '../../../helpers/constants'; import { themeBorder, themeColor, themeContrast } from '../../../helpers/theme'; import { Button, ButtonProps } from './Button'; @@ -43,7 +42,7 @@ export function ThirdPartyButton({ ); } -const ThirdPartyButtonStyled: React.FC> = styled(Button)` +const ThirdPartyButtonStyled = styled(Button)` --background: ${themeColor('thirdPartyButton')}; --backgroundHover: ${themeColor('thirdPartyButtonHover')}; --color: ${themeContrast('thirdPartyButton')}; diff --git a/server/sonar-web/src/main/js/app/components/global-search/GlobalSearch.tsx b/server/sonar-web/src/main/js/app/components/global-search/GlobalSearch.tsx index 7e849acf4ea..22f2a8856b3 100644 --- a/server/sonar-web/src/main/js/app/components/global-search/GlobalSearch.tsx +++ b/server/sonar-web/src/main/js/app/components/global-search/GlobalSearch.tsx @@ -420,7 +420,7 @@ export class GlobalSearch extends React.PureComponent { return (
    {!open && !query ? ( - + ( ) { {project.qualityGate !== undefined && (
    - + {({ onClick }) => ( - + { return (
    {!loading && workerCount > 1 && ( - +
    @@ -108,7 +108,7 @@ export default class Workers extends React.PureComponent<{}, State> { {!loading && canSetWorkerCount && ( - + { ); if (!canBulkChange) { return ( - + {translate('bulk_change')} ); diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderMeta.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderMeta.tsx index 846377823dd..f89b77de11b 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderMeta.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsHeaderMeta.tsx @@ -43,7 +43,7 @@ export default function RuleDetailsHeaderMeta(props: Readonly) { {!ruleDetails.isExternal && ruleDetails.isTemplate && ( <>
  • - + {translate('coding_rules.rule_template')} @@ -117,7 +117,7 @@ export default function RuleDetailsHeaderMeta(props: Readonly) {
  • ) { <>
  • - + {translate('rules.status', ruleDetails.status)} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx index c09f2c8b9c0..a4080ff26ee 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleDetailsIssues.tsx @@ -155,7 +155,7 @@ export class RuleDetailsIssues extends React.PureComponent { } return ( - {totalItem} + {totalItem} ); }; diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx index 394220d35a6..81aba54fac1 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx @@ -107,7 +107,7 @@ export default class RuleListItem extends React.PureComponent {
    {activation.inherit === 'OVERRIDES' && ( { )} {activation.inherit === 'INHERITED' && ( { if (selectedProfile.isBuiltIn && canCopy) { return (
    - + {translate('coding_rules', activation ? 'deactivate' : 'activate')} @@ -173,7 +173,7 @@ export default class RuleListItem extends React.PureComponent { )} ) : ( - + {translate('coding_rules.deactivate')} @@ -271,7 +271,7 @@ export default class RuleListItem extends React.PureComponent { <>
  • - + {translate('coding_rules.rule_template')} diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx index 34492842e8e..4fb5f846278 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/LeakPeriodLegend.tsx @@ -86,7 +86,7 @@ class LeakPeriodLegend extends React.PureComponent ); - return {label}; + return {label}; } } diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx index aaed001569c..59bea826a71 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx @@ -72,7 +72,7 @@ export default function MeasureHeader(props: Readonly) {
  • {!isDiff && hasHistory && ( - + + {project.name} } secondaryTextNode={ - + {project.pathName} } diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx index f4925ec2e62..3ba705f36a2 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesApp.tsx @@ -965,7 +965,7 @@ export class App extends React.PureComponent { {this.getButtonLabel(checked, checkAll, paging)} diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx index b0ea8e15593..1a4d7c0b87c 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginActions.tsx @@ -149,7 +149,7 @@ export default class PluginActions extends React.PureComponent { />
    ))} - + {translate('marketplace.uninstall')} @@ -157,7 +157,7 @@ export default class PluginActions extends React.PureComponent { )} {isAvailablePlugin(plugin) && ( - + ) : ( - + {release.version} diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginLicense.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginLicense.tsx index aa5ac6ccacb..67def352cc2 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginLicense.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginLicense.tsx @@ -33,7 +33,7 @@ export default function PluginLicense({ license }: Readonly) { } return ( - +
    ) { return null; } return ( - + {translateWithParameters('marketplace.update_to_x', update.release.version)} diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx index 9c6923f8bb2..fe90b7b6a9d 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/PluginUpdateItem.tsx @@ -37,7 +37,7 @@ export default function PluginUpdateItem({ release, update, pluginName }: Readon {update.status === 'COMPATIBLE' ? ( {release.version} ) : ( - + {release.version} diff --git a/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx b/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx index 61ec2cbf3bc..bd55e0a1313 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/BranchMetaTopBar.tsx @@ -78,7 +78,7 @@ export default function BranchMetaTopBar({ {showTakeTheTourButton && ( - + ) { {showActions && (
    {canChange && ( - + ) { )} {canDelete && ( - + @@ -186,7 +186,7 @@ export default class ProjectActivityAnalysesList extends React.PureComponent {version.version} diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx index 27223214eee..9d9ef2d832e 100644 --- a/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx +++ b/server/sonar-web/src/main/js/apps/projectActivity/components/ProjectActivityAnalysis.tsx @@ -101,7 +101,7 @@ function ProjectActivityAnalysis(props: ProjectActivityAnalysisProps) { return ( <> - + {translate('project_activity.new_code_period_start')} - + diff --git a/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaQualityProfiles.tsx b/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaQualityProfiles.tsx index dc94c4d0417..103b591e188 100644 --- a/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaQualityProfiles.tsx +++ b/server/sonar-web/src/main/js/apps/projectInformation/about/components/MetaQualityProfiles.tsx @@ -99,7 +99,7 @@ function ProfileItem({ {profile.deleted ? (
    {profile.name}
    @@ -119,7 +119,7 @@ function ProfileItem({ {count > 0 && ( {translate('deprecated')} diff --git a/server/sonar-web/src/main/js/apps/projectNewCode/components/BranchListRow.tsx b/server/sonar-web/src/main/js/apps/projectNewCode/components/BranchListRow.tsx index 8d0b663ed8b..79709380d55 100644 --- a/server/sonar-web/src/main/js/apps/projectNewCode/components/BranchListRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectNewCode/components/BranchListRow.tsx @@ -117,7 +117,7 @@ export default function BranchListRow(props: BranchListRowProps) { {branch.isMain && {translate('branches.main_branch')}} - + {settingWarning !== undefined && } {branch.newCodePeriod @@ -143,7 +143,7 @@ export default function BranchListRow(props: BranchListRowProps) { ariaLabel={translateWithParameters('branch_list.show_actions_for_x', branch.name)} > diff --git a/server/sonar-web/src/main/js/apps/projectNewCode/components/NewCodeDefinitionSettingReferenceBranch.tsx b/server/sonar-web/src/main/js/apps/projectNewCode/components/NewCodeDefinitionSettingReferenceBranch.tsx index e3135885d33..76fa8185cc5 100644 --- a/server/sonar-web/src/main/js/apps/projectNewCode/components/NewCodeDefinitionSettingReferenceBranch.tsx +++ b/server/sonar-web/src/main/js/apps/projectNewCode/components/NewCodeDefinitionSettingReferenceBranch.tsx @@ -56,7 +56,7 @@ function renderBranchOption(props: OptionProps) { {option.isInvalid ? (
    - + { /> diff --git a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx index 9a2b27300cb..d2e64fd1476 100644 --- a/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx +++ b/server/sonar-web/src/main/js/apps/projects/components/project-card/ProjectCard.tsx @@ -99,7 +99,7 @@ function renderFirstLine( {qualifier === ComponentQualifier.Application && ( {translate('qualifier.APP')} {measures.projects !== '' && ( @@ -117,14 +117,14 @@ function renderFirstLine( )} - + {translate('visibility', visibility)} {awaitingScan && !isNewCode && !isEmpty(analysisDate) && measures.ncloc !== undefined && ( - + {translate('projects.awaiting_scan')} @@ -135,7 +135,7 @@ function renderFirstLine(
    {isDefined(analysisDate) && analysisDate !== '' && ( - + + {languagesText} ); diff --git a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx index 915cea83100..8be3a04d3d5 100644 --- a/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx +++ b/server/sonar-web/src/main/js/apps/projectsManagement/ProjectRow.tsx @@ -61,7 +61,7 @@ export default function ProjectRow(props: Readonly) { highlight={LinkHighlight.CurrentColor} to={getComponentOverviewUrl(project.key, project.qualifier)} > - + {project.name} @@ -73,7 +73,7 @@ export default function ProjectRow(props: Readonly) { - + {project.key} diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx index c3c91ffbec5..0df69ce9ad4 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/BuiltInQualityGateBadge.tsx @@ -28,7 +28,7 @@ interface Props { export default function BuiltInQualityGateBadge({ className }: Props) { return ( - + {translate('quality_gates.built_in')} ); diff --git a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx index c55952d85d1..8087e5f2d42 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx +++ b/server/sonar-web/src/main/js/apps/quality-gates/components/DetailsHeader.tsx @@ -82,7 +82,7 @@ export default function DetailsHeader({ qualityGate }: Readonly) { )} {actions.copy && ( ) { )} {actions.setAsDefault && ( ) { )} {actions.copy && ( ) { )} {actions.setAsDefault && ( {qualityGate.caycStatus !== CaycStatus.NonCompliant && ( - + diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx index 58a9815dbbc..0446064fca5 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonForm.tsx @@ -81,7 +81,7 @@ function OptionRenderer(props: Readonly>) { {label} {isDefault && ( - + {intl.formatMessage({ id: 'default' })} diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx index 7727b0f947d..7df42fa7ea5 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/compare/ComparisonResultActivation.tsx @@ -60,7 +60,7 @@ export default function ComparisonResultActivation(props: React.PropsWithChildre return ( - + {({ onClick }) => ( {badge}; + return {badge}; } return badge; diff --git a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx index a4d14dadec6..a35dcd8b9fa 100644 --- a/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx +++ b/server/sonar-web/src/main/js/apps/quality-profiles/home/ProfilesListRow.tsx @@ -66,7 +66,7 @@ export function ProfilesListRow(props: Readonly) { {profile.isDefault ? ( - + {intl.formatMessage({ id: 'default' })} ) : ( @@ -80,7 +80,7 @@ export function ProfilesListRow(props: Readonly) { {profile.activeDeprecatedRuleCount > 0 && ( - + {profile.activeDeprecatedRuleCount} diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeaderRightSection.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeaderRightSection.tsx index 3c3f2cc680d..64ea79d4804 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeaderRightSection.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotHeaderRightSection.tsx @@ -49,7 +49,7 @@ export default function HotspotHeaderRightSection(props: Props) { {hotspot.codeVariants && hotspot.codeVariants.length > 0 && ( - + {hotspot.codeVariants.join(', ')} diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx index 1a587ce308b..b640a000212 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/HotspotSidebarHeader.tsx @@ -128,8 +128,8 @@ function HotspotSidebarHeader(props: SecurityHotspotsAppRendererProps) { {userLoggedIn && ( } - placement="right" + content={} + side="right" >
    {filterByFile ? ( - + {fileFromPath(filterByFile)} diff --git a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusReviewButton.tsx b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusReviewButton.tsx index d956ec80cea..171ea409a3c 100644 --- a/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusReviewButton.tsx +++ b/server/sonar-web/src/main/js/apps/security-hotspots/components/status/StatusReviewButton.tsx @@ -41,8 +41,8 @@ export function StatusReviewButton(props: StatusProps) { return ( <> setIsOpen(true)} disabled={readonly}> {translate('hotspots.status.review')} diff --git a/server/sonar-web/src/main/js/apps/settings/components/DefinitionDescription.tsx b/server/sonar-web/src/main/js/apps/settings/components/DefinitionDescription.tsx index 4e63f301c92..342f00dde2b 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/DefinitionDescription.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/DefinitionDescription.tsx @@ -45,7 +45,7 @@ export default function DefinitionDescription({ definition }: Readonly) { /> )} - + {translateWithParameters('settings.key_x', definition.key)} diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx index 2cca33a9d60..9b54225ab2f 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmBindingDefinitionBox.tsx @@ -182,7 +182,7 @@ export default function AlmBindingDefinitionBox(props: AlmBindingDefinitionBoxPr {status.type !== AlmSettingsBindingStatusType.Warning && (
    - + {translate('settings.almintegration.feature.status_reporting.title')} {getPRDecorationFeatureStatus(branchesEnabled, status.type)} @@ -190,7 +190,7 @@ export default function AlmBindingDefinitionBox(props: AlmBindingDefinitionBoxPr {IMPORT_COMPATIBLE_ALMS.includes(alm) && (
    {translate('settings.almintegration.feature.alm_repo_import.title')} diff --git a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx index 76ba872ca80..2fb9dbece83 100644 --- a/server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx +++ b/server/sonar-web/src/main/js/apps/settings/components/almIntegration/CreationTooltip.tsx @@ -46,7 +46,7 @@ export function CreationTooltip(props: CreationTooltipProps) { return ( {statusIndicator} diff --git a/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.tsx b/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.tsx index 6cf82658848..894be35d029 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/DeprecatedBadge.tsx @@ -32,7 +32,7 @@ export default function DeprecatedBadge({ since }: { since?: string }) { ? translateWithParameters('api_documentation.deprecated_since_x', since) : translate('api_documentation.deprecated'); return ( - + {label} diff --git a/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx b/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx index f659020d052..7d4e5444aa8 100644 --- a/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx +++ b/server/sonar-web/src/main/js/apps/web-api/components/InternalBadge.tsx @@ -24,7 +24,7 @@ import { translate } from '../../../helpers/l10n'; export default function InternalBadge() { return ( - + {translate('internal')} diff --git a/server/sonar-web/src/main/js/apps/webhooks/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/webhooks/components/PageActions.tsx index 57b6c4cc83d..8fcebb986f7 100644 --- a/server/sonar-web/src/main/js/apps/webhooks/components/PageActions.tsx +++ b/server/sonar-web/src/main/js/apps/webhooks/components/PageActions.tsx @@ -52,7 +52,7 @@ export default function PageActions(props: Props) { if (webhooksCount >= WEBHOOKS_LIMIT) { return ( - + {translate('create')} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx index 897b60e7bea..a05afb97244 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineDuplicationBlock.tsx @@ -48,7 +48,7 @@ export function LineDuplicationBlock(props: LineDuplicationBlockProps) { const handleClose = React.useCallback(() => setPopupOpen(false), []); return duplicated ? ( - + - + } - placement={PopupPlacement.Right} - visible={isOpen} + content={} + side={PopupPlacement.Right} + isOpen={isOpen} isInteractive classNameInner="sw-max-w-abs-600" > diff --git a/server/sonar-web/src/main/js/components/activity-graph/EventInner.tsx b/server/sonar-web/src/main/js/components/activity-graph/EventInner.tsx index af8dc01651b..3996d5e2125 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/EventInner.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/EventInner.tsx @@ -65,7 +65,7 @@ export default function EventInner({ event, readonly }: EventInnerProps) { : event.description; return ( - +
    diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendCustom.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendCustom.tsx index a2ef7eb9830..4dd506acea5 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendCustom.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendCustom.tsx @@ -53,7 +53,7 @@ export default function GraphsLegendCustom(props: GraphsLegendCustomProps) { return (
  • {isDeprecated && ( + {label} {disabledReason !== undefined && ({disabledReason})} diff --git a/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx b/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx index cc9ebd48d7b..2090c30a993 100644 --- a/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx +++ b/server/sonar-web/src/main/js/components/common/PrivacyBadgeContainer.tsx @@ -35,7 +35,7 @@ export default function PrivacyBadgeContainer({ visibility, }: PrivacyBadgeContainerProps) { return ( - +
    {translate('visibility', visibility)}
    ); diff --git a/server/sonar-web/src/main/js/components/controls/Favorite.tsx b/server/sonar-web/src/main/js/components/controls/Favorite.tsx index a5c5e17fdde..07e81ed4619 100644 --- a/server/sonar-web/src/main/js/components/controls/Favorite.tsx +++ b/server/sonar-web/src/main/js/components/controls/Favorite.tsx @@ -96,7 +96,7 @@ export default class Favorite extends React.PureComponent { toggleFavorite={this.toggleFavorite} tooltip={Tooltip} favorite={favorite} - innerRef={(node) => (this.buttonNode = node)} + innerRef={(node: HTMLElement | null) => (this.buttonNode = node)} /> ); } diff --git a/server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx b/server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx index e7d6e2ff1af..e0fe8fbe090 100644 --- a/server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx +++ b/server/sonar-web/src/main/js/components/controls/HomePageSelect.tsx @@ -65,7 +65,7 @@ export function HomePageSelect(props: Readonly) { const Icon = isChecked ? HomeFillIcon : HomeIcon; return ( - + {type === 'icon' ? ( void; onHide?: () => void; - overlay: React.ReactNode; - placement?: Placement; - visible?: boolean; + content: React.ReactNode; + side?: Placement; + isOpen?: boolean; // If tooltip overlay has interactive content (links for instance) we may set this to true to stop // default behavior of tabbing (other changes should be done outside of this component to make it work) // See example DocHelpTooltip @@ -90,7 +90,7 @@ function isMeasured(state: State): state is OwnState & Measurements { export default function Tooltip(props: TooltipProps) { // `overlay` is a ReactNode, so it can be `undefined` or `null`. This allows to easily // render a tooltip conditionally. More generally, we avoid rendering empty tooltips. - return props.overlay != null && props.overlay !== '' ? ( + return props.content != null && props.content !== '' ? ( ) : ( props.children @@ -114,8 +114,8 @@ export class TooltipInner extends React.Component { super(props); this.state = { flipped: false, - placement: props.placement, - visible: props.visible ?? false, + placement: props.side, + visible: props.isOpen ?? false, }; this.id = uniqueId('tooltip-'); this.throttledPositionTooltip = throttle(this.positionTooltip, 10); @@ -123,15 +123,15 @@ export class TooltipInner extends React.Component { componentDidMount() { this.mounted = true; - if (this.props.visible === true) { + if (this.props.isOpen === true) { this.positionTooltip(); this.addEventListeners(); } } componentDidUpdate(prevProps: TooltipProps, prevState: State) { - if (this.props.placement !== prevProps.placement) { - this.setState({ placement: this.props.placement }); + if (this.props.side !== prevProps.side) { + this.setState({ placement: this.props.side }); // Break. This will trigger a new componentDidUpdate() call, so the below // positionTooltip() call will be correct. Otherwise, it might not use // the new state.placement value. @@ -140,15 +140,15 @@ export class TooltipInner extends React.Component { if ( // opens - (this.props.visible === true && !prevProps.visible) || - (this.props.visible === undefined && this.state.visible && !prevState.visible) + (this.props.isOpen === true && !prevProps.isOpen) || + (this.props.isOpen === undefined && this.state.visible && !prevState.visible) ) { this.positionTooltip(); this.addEventListeners(); } else if ( // closes - (!this.props.visible && prevProps.visible === true) || - (this.props.visible === undefined && !this.state.visible && prevState.visible) + (!this.props.isOpen && prevProps.isOpen === true) || + (this.props.isOpen === undefined && !this.state.visible && prevState.visible) ) { this.clearPosition(); this.removeEventListeners(); @@ -177,7 +177,7 @@ export class TooltipInner extends React.Component { }; isVisible = () => { - return this.props.visible ?? this.state.visible; + return this.props.isOpen ?? this.state.visible; }; getPlacement = (): Placement => { @@ -255,7 +255,7 @@ export class TooltipInner extends React.Component { top: undefined, width: undefined, height: undefined, - placement: this.props.placement, + placement: this.props.side, }); }; @@ -267,7 +267,7 @@ export class TooltipInner extends React.Component { // (if it's `undefined`, it means the timer has been reset). if ( this.mounted && - this.props.visible === undefined && + this.props.isOpen === undefined && this.mouseEnterTimeout !== undefined ) { this.setState({ visible: true }); @@ -290,7 +290,7 @@ export class TooltipInner extends React.Component { if (!this.mouseIn) { this.mouseLeaveTimeout = window.setTimeout( () => { - if (this.mounted && this.props.visible === undefined && !this.mouseIn) { + if (this.mounted && this.props.isOpen === undefined && !this.mouseIn) { this.setState({ visible: false }); } if (this.props.onHide && !this.mouseIn) { @@ -415,7 +415,12 @@ export class TooltipInner extends React.Component { renderOverlay() { const isVisible = this.isVisible(); - const { classNameSpace = 'tooltip', isInteractive, overlay, classNameInner } = this.props; + const { + classNameSpace = 'tooltip', + isInteractive, + content: overlay, + classNameInner, + } = this.props; return (
    {({ onToggleClick, open }) => ( - + ) { <>
  • {ruleEngine} @@ -89,7 +89,7 @@ export default function IssueMetaBar(props: Readonly) { {!!issue.codeVariants?.length && ( <> - + {issue.codeVariants.length > 1 ? translateWithParameters('issue.x_code_variants', issue.codeVariants.length) @@ -116,7 +116,7 @@ export default function IssueMetaBar(props: Readonly) { {showLine && isDefined(issue.textRange) && ( <> - + {translateWithParameters('issue.ncloc_x.short', issue.textRange.endLine)} diff --git a/server/sonar-web/src/main/js/components/issue/components/SonarLintBadge.tsx b/server/sonar-web/src/main/js/components/issue/components/SonarLintBadge.tsx index ae18f700477..5f03969c216 100644 --- a/server/sonar-web/src/main/js/components/issue/components/SonarLintBadge.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/SonarLintBadge.tsx @@ -39,7 +39,7 @@ export default function SonarLintBadge({ compact }: Readonly) { function SonarLintBadgeFull() { return ( { ) { return ( - + ) { mouseLeaveDelay={0.25} onShow={handleShowTooltip} onHide={handleHideTooltip} - overlay={overlay} - placement={placement} + content={overlay} + side={placement} isInteractive > ) { props.className, )} > - +