]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9513 Add spacebar shortcut to check an issue
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 15 Aug 2017 14:26:32 +0000 (16:26 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Thu, 17 Aug 2017 14:42:15 +0000 (16:42 +0200)
server/sonar-web/src/main/js/components/issue/Issue.js

index 42f1a54a0727a7c38d80d4167cd9657e02fcfb7d..674d9c35216eb90064b954c69688ab812149be6d 100644 (file)
  */
 // @flow
 import React from 'react';
-import PropTypes from 'prop-types';
 import key from 'keymaster';
+import PropTypes from 'prop-types';
 import IssueView from './IssueView';
-import { updateIssue } from './actions';
-import { setIssueAssignee } from '../../api/issues';
 import { onFail } from '../../store/rootActions';
+import { setIssueAssignee } from '../../api/issues';
+import { updateIssue } from './actions';
 /*:: import type { Issue } from './types'; */
 
 /*::
@@ -116,6 +116,12 @@ export default class BaseIssue extends React.PureComponent {
       this.togglePopup('edit-tags');
       return false;
     });
+    key('space', 'issues', () => {
+      if (this.props.onCheck) {
+        this.props.onCheck(this.props.issue.key);
+        return false;
+      }
+    });
   }
 
   unbindShortcuts() {
@@ -124,6 +130,7 @@ export default class BaseIssue extends React.PureComponent {
     key.unbind('m', 'issues');
     key.unbind('i', 'issues');
     key.unbind('c', 'issues');
+    key.unbind('space', 'issues');
     key.unbind('t', 'issues');
   }