From bef0ed1d0964a3f231af0ac6268f6dfb2312cc59 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Thu, 12 Oct 2023 09:31:07 +0200 Subject: [PATCH] SONAR-20738 Remove useless "current issue" counter on issues page --- .../src/main/js/apps/issues/components/IssuesApp.tsx | 7 +------ .../src/main/js/apps/issues/components/IssuesCounter.tsx | 8 +------- .../src/main/js/apps/issues/components/PageActions.tsx | 5 ++--- .../issues-subnavigation/SubnavigationIssuesList.tsx | 9 +-------- .../SubnavigationIssuesListHeader.tsx | 7 ++----- 5 files changed, 7 insertions(+), 29 deletions(-) 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 80a291dc4f4..11766feb3d4 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 @@ -1184,11 +1184,9 @@ export class App extends React.PureComponent { renderHeader({ openIssue, paging, - selectedIndex, }: { openIssue: Issue | undefined; paging: Paging | undefined; - selectedIndex: number | undefined; }) { return openIssue ? ( @@ -1202,7 +1200,6 @@ export class App extends React.PureComponent { canSetHome={!this.props.component} effortTotal={this.state.effortTotal} paging={this.props.component?.needIssueSync ? undefined : paging} - selectedIndex={selectedIndex} /> @@ -1221,8 +1218,6 @@ export class App extends React.PureComponent { loadingRule, } = this.state; - const selectedIndex = this.getSelectedIndex(); - return ( {({ top }) => ( @@ -1233,7 +1228,7 @@ export class App extends React.PureComponent { })} style={{ height: `calc((100vh - ${top + LAYOUT_FOOTER_HEIGHT}px)` }} > - {this.renderHeader({ openIssue, paging, selectedIndex })} + {this.renderHeader({ openIssue, paging })} {/* eslint-disable-next-line local-rules/no-conditional-rendering-of-deferredspinner */} diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesCounter.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesCounter.tsx index 1f603d0a7da..09c4f00f5be 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesCounter.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesCounter.tsx @@ -22,17 +22,11 @@ import PageCounter from '../../../components/common/PageCounter'; import { translate } from '../../../helpers/l10n'; interface Props { - current: number | undefined; total: number; } export default function IssuesCounter(props: Props) { return ( - + ); } diff --git a/server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx b/server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx index 6af94914793..ed87e3a39ba 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/PageActions.tsx @@ -29,18 +29,17 @@ export interface PageActionsProps { canSetHome: boolean; effortTotal: number | undefined; paging?: Paging; - selectedIndex?: number; } export default function PageActions(props: PageActionsProps) { - const { canSetHome, effortTotal, paging, selectedIndex } = props; + const { canSetHome, effortTotal, paging } = props; return (
- {paging != null && } + {paging != null && } {effortTotal !== undefined && } {canSetHome && } diff --git a/server/sonar-web/src/main/js/apps/issues/issues-subnavigation/SubnavigationIssuesList.tsx b/server/sonar-web/src/main/js/apps/issues/issues-subnavigation/SubnavigationIssuesList.tsx index 4fcdbf16cac..0b37db4b348 100644 --- a/server/sonar-web/src/main/js/apps/issues/issues-subnavigation/SubnavigationIssuesList.tsx +++ b/server/sonar-web/src/main/js/apps/issues/issues-subnavigation/SubnavigationIssuesList.tsx @@ -51,16 +51,9 @@ export default function SubnavigationIssuesList(props: Props) { selectedLocationIndex, } = props; - let selectedIndex: number | undefined = issues.findIndex((issue) => issue.key === selected); - selectedIndex = selectedIndex === -1 ? undefined : selectedIndex; - return ( - + {issues.map((issue, index) => { const previousIssue = index > 0 ? issues[index - 1] : undefined; diff --git a/server/sonar-web/src/main/js/apps/issues/issues-subnavigation/SubnavigationIssuesListHeader.tsx b/server/sonar-web/src/main/js/apps/issues/issues-subnavigation/SubnavigationIssuesListHeader.tsx index 17c203ef227..6ea525abe5d 100644 --- a/server/sonar-web/src/main/js/apps/issues/issues-subnavigation/SubnavigationIssuesListHeader.tsx +++ b/server/sonar-web/src/main/js/apps/issues/issues-subnavigation/SubnavigationIssuesListHeader.tsx @@ -26,17 +26,14 @@ import IssuesCounter from '../components/IssuesCounter'; interface Props { loading: boolean; paging: Paging | undefined; - selectedIndex: number | undefined; } export default function SubnavigationIssuesListHeader(props: Props) { - const { loading, paging, selectedIndex } = props; + const { loading, paging } = props; return ( - - {paging && } - + {paging && } ); } -- 2.39.5