]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16448 Show default cursor for issue box not clickable
authorMathieu Suen <mathieu.suen@sonarsource.com>
Thu, 2 Jun 2022 10:04:02 +0000 (12:04 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 2 Jun 2022 20:03:18 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/issues/crossComponentSourceViewer/ComponentSourceSnippetGroupViewer.tsx
server/sonar-web/src/main/js/components/issue/Issue.css
server/sonar-web/src/main/js/components/issue/Issue.tsx
server/sonar-web/src/main/js/components/issue/IssueView.tsx

index 8aaa4277267e2a8ab5e9a19f6c6d026de500ee88..2fe03336c7064a1795e0f1458809a222f2e711c7 100644 (file)
@@ -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
             <Issue
               issue={issue}
               onChange={this.props.onIssueChange}
-              onClick={noop}
               onPopupToggle={this.props.onIssuePopupToggle}
               openPopup={issuePopup && issuePopup.issue === issue.key ? issuePopup.name : undefined}
               selected={true}
index 672ec17f50081e44c1d6f869afefa2625954b51f..4f527b68846d33f627c128733da6b957101bdb12 100644 (file)
   padding-bottom: var(--gridSize);
   background-color: var(--issueBgColor);
   transition: all 0.3s ease, border 0s ease;
+  cursor: pointer;
+}
+
+.issue.no-click {
+  cursor: initial;
 }
 
 .issue.hotspot {
index b91d7065d7313f415a38f5ce1ecdede1470ebb74..4a1a3f729f73ac4b4e1bc9855f6923202a08a829 100644 (file)
@@ -36,7 +36,7 @@ interface Props {
   issue: TypeIssue;
   onChange: (issue: TypeIssue) => 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;
index 919237c89c8a3bc1c432c18260a75e5671e82289..3b8997144f42cae3722794faff93f4be2afec3a8 100644 (file)
@@ -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<Props> {
     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