From d197db105955eb1a0edcec8a6e5a4940aa89cae0 Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Thu, 2 Jun 2022 12:04:02 +0200 Subject: [PATCH] SONAR-16448 Show default cursor for issue box not clickable --- .../ComponentSourceSnippetGroupViewer.tsx | 3 --- server/sonar-web/src/main/js/components/issue/Issue.css | 5 +++++ server/sonar-web/src/main/js/components/issue/Issue.tsx | 2 +- server/sonar-web/src/main/js/components/issue/IssueView.tsx | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx index 8aaa4277267..2fe03336c70 100644 --- a/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx +++ b/server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { noop } from 'lodash'; import * as React from 'react'; import { getSources } from '../../../api/components'; import Issue from '../../../components/issue/Issue'; @@ -333,7 +332,6 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone issue={issueToDisplay} key={issueToDisplay.key} onChange={this.props.onIssueChange} - onClick={noop} onPopupToggle={this.props.onIssuePopupToggle} openPopup={ this.props.issuePopup && this.props.issuePopup.issue === issueToDisplay.key @@ -435,7 +433,6 @@ export default class ComponentSourceSnippetGroupViewer extends React.PureCompone void; onCheck?: (issue: string) => void; - onClick: (issueKey: string) => void; + onClick?: (issueKey: string) => void; onFilter?: (property: string, issue: TypeIssue) => void; onPopupToggle: (issue: string, popupName: string, open?: boolean) => void; openPopup?: string; 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 919237c89c8..3b8997144f4 100644 --- a/server/sonar-web/src/main/js/components/issue/IssueView.tsx +++ b/server/sonar-web/src/main/js/components/issue/IssueView.tsx @@ -40,7 +40,7 @@ interface Props { onAssign: (login: string) => void; onChange: (issue: Issue) => void; onCheck?: (issue: string) => void; - onClick: (issueKey: string) => void; + onClick?: (issueKey: string) => void; onFilter?: (property: string, issue: Issue) => void; selected: boolean; togglePopup: (popup: string, show: boolean | void) => void; @@ -82,6 +82,7 @@ export default class IssueView extends React.PureComponent { const hasCheckbox = this.props.onCheck != null; const issueClass = classNames('issue', { + 'no-click': this.props.onClick === undefined, hotspot: issue.type === 'SECURITY_HOTSPOT', 'issue-with-checkbox': hasCheckbox, selected: this.props.selected -- 2.39.5