diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2019-04-10 15:48:31 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2019-05-06 11:01:14 +0200 |
commit | 0de67f888cd2cc48e7097caaf1860e4985f751c5 (patch) | |
tree | 96ae9111a35ef487e43a1c3f752e7cfb765ee2d3 /server/sonar-web/src | |
parent | 570316af531be1479cb7fa504c9ba9777babbd03 (diff) | |
download | sonarqube-0de67f888cd2cc48e7097caaf1860e4985f751c5.tar.gz sonarqube-0de67f888cd2cc48e7097caaf1860e4985f751c5.zip |
SONAR-11900 Remove location counter from issues in the code viewer and issue list
Diffstat (limited to 'server/sonar-web/src')
13 files changed, 1 insertions, 90 deletions
diff --git a/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx b/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx index fbaa4feb644..3e2d6ee44c7 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/IssuesSourceViewer.tsx @@ -111,8 +111,6 @@ export default class IssuesSourceViewer extends React.PureComponent<Props> { branchLike={this.props.branchLike} component={component} displayAllIssues={true} - displayIssueLocationsCount={false} - displayIssueLocationsLink={false} displayLocationMarkers={!allMessagesEmpty} highlightedLocationMessage={highlightedLocationMessage} highlightedLocations={highlightedLocations} diff --git a/server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx b/server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx index 2ac011d118a..91cbcd95e15 100644 --- a/server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx +++ b/server/sonar-web/src/main/js/apps/issues/components/ListItem.tsx @@ -114,7 +114,6 @@ export default class ListItem extends React.PureComponent<Props, State> { <Issue branchLike={branchLike} checked={this.props.checked} - displayLocationsLink={false} issue={issue} onChange={this.props.onChange} onCheck={this.props.onCheck} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx index 3628a9efefd..50164b72dc4 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerBase.tsx @@ -51,8 +51,6 @@ export interface Props { branchLike: T.BranchLike | undefined; component: string; displayAllIssues?: boolean; - displayIssueLocationsCount?: boolean; - displayIssueLocationsLink?: boolean; displayLocationMarkers?: boolean; highlightedLine?: number; // `undefined` elements mean they are located in a different file, @@ -118,8 +116,6 @@ export default class SourceViewerBase extends React.PureComponent<Props, State> static defaultProps = { displayAllIssues: false, - displayIssueLocationsCount: true, - displayIssueLocationsLink: true, displayLocationMarkers: true, loadComponent: defaultLoadComponent, loadIssues: defaultLoadIssues, @@ -633,8 +629,6 @@ export default class SourceViewerBase extends React.PureComponent<Props, State> branchLike={this.props.branchLike} componentKey={this.props.component} displayAllIssues={this.props.displayAllIssues} - displayIssueLocationsCount={this.props.displayIssueLocationsCount} - displayIssueLocationsLink={this.props.displayIssueLocationsLink} displayLocationMarkers={this.props.displayLocationMarkers} duplications={this.state.duplications} duplicationsByLine={this.state.duplicationsByLine} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx index 923f3b6ff9f..cac8ee2dec8 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/SourceViewerCode.tsx @@ -37,8 +37,6 @@ interface Props { branchLike: T.BranchLike | undefined; componentKey: string; displayAllIssues?: boolean; - displayIssueLocationsCount?: boolean; - displayIssueLocationsLink?: boolean; displayLocationMarkers?: boolean; duplications: T.Duplication[] | undefined; duplicationsByLine: { [line: number]: number[] }; @@ -159,8 +157,6 @@ export default class SourceViewerCode extends React.PureComponent<Props> { displayAllIssues={this.props.displayAllIssues} displayCoverage={displayCoverage} displayDuplications={displayDuplications} - displayIssueLocationsCount={this.props.displayIssueLocationsCount} - displayIssueLocationsLink={this.props.displayIssueLocationsLink} displayIssues={displayIssues} displayLocationMarkers={this.props.displayLocationMarkers} duplications={this.getDuplicationsForLine(line)} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx index 27574086a84..5d26fe77b9b 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/Line.tsx @@ -33,8 +33,6 @@ interface Props { displayAllIssues?: boolean; displayCoverage: boolean; displayDuplications: boolean; - displayIssueLocationsCount?: boolean; - displayIssueLocationsLink?: boolean; displayIssues: boolean; displayLocationMarkers?: boolean; duplications: number[]; @@ -151,8 +149,6 @@ export default class Line extends React.PureComponent<Props> { <LineCode branchLike={this.props.branchLike} - displayIssueLocationsCount={this.props.displayIssueLocationsCount} - displayIssueLocationsLink={this.props.displayIssueLocationsLink} displayLocationMarkers={this.props.displayLocationMarkers} highlightedLocationMessage={this.props.highlightedLocationMessage} highlightedSymbols={this.props.highlightedSymbols} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx index af7a7b7200a..7b9bd25fba9 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineCode.tsx @@ -31,8 +31,6 @@ import { interface Props { branchLike: T.BranchLike | undefined; - displayIssueLocationsCount?: boolean; - displayIssueLocationsLink?: boolean; displayLocationMarkers?: boolean; highlightedLocationMessage: { index: number; text: string | undefined } | undefined; highlightedSymbols: string[] | undefined; @@ -228,8 +226,6 @@ export default class LineCode extends React.PureComponent<Props, State> { {showIssues && issues.length > 0 && ( <LineIssuesList branchLike={this.props.branchLike} - displayIssueLocationsCount={this.props.displayIssueLocationsCount} - displayIssueLocationsLink={this.props.displayIssueLocationsLink} issuePopup={this.props.issuePopup} issues={issues} onIssueChange={this.props.onIssueChange} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesList.tsx b/server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesList.tsx index f64da90def8..bd9df8ed497 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesList.tsx +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/LineIssuesList.tsx @@ -22,8 +22,6 @@ import Issue from '../../issue/Issue'; interface Props { branchLike: T.BranchLike | undefined; - displayIssueLocationsCount?: boolean; - displayIssueLocationsLink?: boolean; issuePopup: { issue: string; name: string } | undefined; issues: T.Issue[]; onIssueChange: (issue: T.Issue) => void; @@ -40,8 +38,6 @@ export default function LineIssuesList(props: Props) { {props.issues.map(issue => ( <Issue branchLike={props.branchLike} - displayLocationsCount={props.displayIssueLocationsCount} - displayLocationsLink={props.displayIssueLocationsLink} issue={issue} key={issue.key} onChange={props.onIssueChange} diff --git a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssuesList-test.tsx.snap b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssuesList-test.tsx.snap index 23005294869..457c4cad762 100644 --- a/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssuesList-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/SourceViewer/components/__tests__/__snapshots__/LineIssuesList-test.tsx.snap @@ -5,8 +5,6 @@ exports[`render issues list 1`] = ` className="issue-list" > <Issue - displayLocationsCount={true} - displayLocationsLink={true} issue={ Object { "actions": Array [], @@ -40,8 +38,6 @@ exports[`render issues list 1`] = ` selected={true} /> <Issue - displayLocationsCount={true} - displayLocationsLink={true} issue={ Object { "actions": Array [], diff --git a/server/sonar-web/src/main/js/components/issue/Issue.tsx b/server/sonar-web/src/main/js/components/issue/Issue.tsx index 841c2f31a32..6e65095250d 100644 --- a/server/sonar-web/src/main/js/components/issue/Issue.tsx +++ b/server/sonar-web/src/main/js/components/issue/Issue.tsx @@ -27,8 +27,6 @@ import './Issue.css'; interface Props { branchLike?: T.BranchLike; checked?: boolean; - displayLocationsCount?: boolean; - displayLocationsLink?: boolean; issue: T.Issue; onChange: (issue: T.Issue) => void; onCheck?: (issue: string) => void; @@ -41,8 +39,6 @@ interface Props { export default class Issue extends React.PureComponent<Props> { static defaultProps = { - displayLocationsCount: true, - displayLocationsLink: true, selected: false }; @@ -134,8 +130,6 @@ export default class Issue extends React.PureComponent<Props> { branchLike={this.props.branchLike} checked={this.props.checked} currentPopup={this.props.openPopup} - displayLocationsCount={this.props.displayLocationsCount} - displayLocationsLink={this.props.displayLocationsLink} issue={this.props.issue} onAssign={this.handleAssignement} onChange={this.props.onChange} diff --git a/server/sonar-web/src/main/js/components/issue/IssueView.tsx b/server/sonar-web/src/main/js/components/issue/IssueView.tsx index 21a0eaee419..e1d2371d4a7 100644 --- a/server/sonar-web/src/main/js/components/issue/IssueView.tsx +++ b/server/sonar-web/src/main/js/components/issue/IssueView.tsx @@ -30,8 +30,6 @@ interface Props { branchLike?: T.BranchLike; checked?: boolean; currentPopup?: string; - displayLocationsCount?: boolean; - displayLocationsLink?: boolean; issue: T.Issue; onAssign: (login: string) => void; onChange: (issue: T.Issue) => void; @@ -85,8 +83,6 @@ export default class IssueView extends React.PureComponent<Props> { <IssueTitleBar branchLike={this.props.branchLike} currentPopup={this.props.currentPopup} - displayLocationsCount={this.props.displayLocationsCount} - displayLocationsLink={this.props.displayLocationsLink} issue={issue} onFilter={this.props.onFilter} togglePopup={this.props.togglePopup} diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx b/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx index eb657cc73a4..963ae5a26f5 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTitleBar.tsx @@ -23,19 +23,14 @@ import IssueChangelog from './IssueChangelog'; import IssueMessage from './IssueMessage'; import SimilarIssuesFilter from './SimilarIssuesFilter'; import LinkIcon from '../../icons-components/LinkIcon'; -import LocationIndex from '../../common/LocationIndex'; -import Tooltip from '../../controls/Tooltip'; import { getBranchLikeQuery } from '../../../helpers/branches'; import { getComponentIssuesUrl } from '../../../helpers/urls'; -import { formatMeasure } from '../../../helpers/measures'; -import { translate, translateWithParameters } from '../../../helpers/l10n'; +import { translate } from '../../../helpers/l10n'; import { WorkspaceContext } from '../../workspace/context'; interface Props { branchLike?: T.BranchLike; currentPopup?: string; - displayLocationsCount?: boolean; - displayLocationsLink?: boolean; issue: T.Issue; onFilter?: (property: string, issue: T.Issue) => void; togglePopup: (popup: string, show?: boolean) => void; @@ -45,22 +40,6 @@ export default function IssueTitleBar(props: Props) { const { issue } = props; const hasSimilarIssuesFilter = props.onFilter != null; - const locationsCount = - issue.secondaryLocations.length + - issue.flows.reduce((sum, locations) => sum + locations.length, 0); - - const locationsBadge = ( - <Tooltip - overlay={translateWithParameters( - 'issue.this_issue_involves_x_code_locations', - formatMeasure(locationsCount, 'INT') - )}> - <LocationIndex>{locationsCount}</LocationIndex> - </Tooltip> - ); - - const displayLocations = props.displayLocationsCount && locationsCount > 0; - const issueUrl = getComponentIssuesUrl(issue.project, { ...getBranchLikeQuery(props.branchLike), issues: issue.key, @@ -100,17 +79,6 @@ export default function IssueTitleBar(props: Props) { </span> </li> )} - {displayLocations && ( - <li className="issue-meta"> - {props.displayLocationsLink ? ( - <Link target="_blank" to={issueUrl}> - {locationsBadge} - </Link> - ) : ( - locationsBadge - )} - </li> - )} <li className="issue-meta"> <Link className="js-issue-permalink link-no-underline" diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTitleBar-test.tsx b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTitleBar-test.tsx index e275e337033..555d271d42b 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTitleBar-test.tsx +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTitleBar-test.tsx @@ -23,7 +23,6 @@ import IssueTitleBar from '../IssueTitleBar'; import { mockIssue } from '../../../../helpers/testMocks'; const issue: T.Issue = mockIssue(); -const issueWithLocations: T.Issue = mockIssue(true); it('should render the titlebar correctly', () => { const branch: T.ShortLivingBranch = { @@ -45,17 +44,6 @@ it('should render the titlebar with the filter', () => { expect(element).toMatchSnapshot(); }); -it('should count all code locations', () => { - const element = shallow( - <IssueTitleBar - displayLocationsCount={true} - issue={issueWithLocations} - togglePopup={jest.fn()} - /> - ); - expect(element.find('LocationIndex')).toMatchSnapshot(); -}); - it('should have a correct permalink for security hotspots', () => { const wrapper = shallow( <IssueTitleBar issue={{ ...issue, type: 'SECURITY_HOTSPOT' }} togglePopup={jest.fn()} /> diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap b/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap index 3fc0b16bfe3..812027acb3b 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTitleBar-test.tsx.snap @@ -1,11 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should count all code locations 1`] = ` -<LocationIndex> - 7 -</LocationIndex> -`; - exports[`should render the titlebar correctly 1`] = ` <div className="issue-row" |