diff options
author | Kevin Silva <kevin.silva@sonarsource.com> | 2023-12-06 13:52:37 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-12-06 20:02:46 +0000 |
commit | f4f4d3702f6da77c2568b7fddbfe0ef7387c4295 (patch) | |
tree | 7a1dfa534f915efe6a3edcfcb67b0614efb33db5 /server/sonar-web | |
parent | fc0c5dcca515aa1c45299c9e2e28e7be5fec4b8e (diff) | |
download | sonarqube-f4f4d3702f6da77c2568b7fddbfe0ef7387c4295.tar.gz sonarqube-f4f4d3702f6da77c2568b7fddbfe0ef7387c4295.zip |
SONAR-20992 - Remove dynamic counter from rules
Diffstat (limited to 'server/sonar-web')
3 files changed, 3 insertions, 10 deletions
diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesApp.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesApp.tsx index 58d698e00b3..b12c3a524ad 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesApp.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/CodingRulesApp.tsx @@ -568,7 +568,6 @@ export class CodingRulesApp extends React.PureComponent<Props, State> { render() { const { paging, rules } = this.state; - const selectedIndex = this.getSelectedIndex(); const query = parseQuery(this.props.location.query); const openRule = this.getOpenRule(this.state.rules); const usingPermalink = hasRuleKey(this.props.location.query); @@ -639,9 +638,7 @@ export class CodingRulesApp extends React.PureComponent<Props, State> { size="auto" /> {this.renderBulkButton()} - {!usingPermalink && ( - <PageActions paging={paging} selectedIndex={selectedIndex} /> - )} + {!usingPermalink && <PageActions paging={paging} />} </div> </div> )} diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx index 556bab1faac..a1dc227bf7a 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/PageActions.tsx @@ -25,10 +25,9 @@ import { Paging } from '../../../types/types'; export interface PageActionsProps { paging?: Paging; - selectedIndex?: number; } -export default function PageActions(props: PageActionsProps) { +export default function PageActions(props: Readonly<PageActionsProps>) { return ( <div className="sw-body-sm sw-flex sw-items-center sw-gap-6 sw-justify-end sw-flex-1"> <KeyboardHint title={translate('coding_rules.to_select_rules')} command="ArrowUp ArrowDown" /> @@ -37,7 +36,6 @@ export default function PageActions(props: PageActionsProps) { {props.paging && ( <PageCounter className="sw-ml-2" - current={props.selectedIndex} label={translate('coding_rules._rules')} total={props.paging.total} /> diff --git a/server/sonar-web/src/main/js/components/common/PageCounter.tsx b/server/sonar-web/src/main/js/components/common/PageCounter.tsx index 3647f9e646c..10ace32654f 100644 --- a/server/sonar-web/src/main/js/components/common/PageCounter.tsx +++ b/server/sonar-web/src/main/js/components/common/PageCounter.tsx @@ -23,16 +23,14 @@ import { MetricType } from '../../types/metrics'; export interface PageCounterProps { className?: string; - current?: number; label: string; total: number; } -export default function PageCounter({ className, current, label, total }: PageCounterProps) { +export default function PageCounter({ className, label, total }: Readonly<PageCounterProps>) { return ( <div className={className}> <strong className="sw-mr-1"> - {current !== undefined && formatMeasure(current + 1, MetricType.Integer) + ' / '} <span data-testid="page-counter-total">{formatMeasure(total, MetricType.Integer)}</span> </strong> {label} |