]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-11910 Allow to assign a Security Hotspot in issues page
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Fri, 5 Apr 2019 13:51:17 +0000 (15:51 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 23 Apr 2019 18:21:10 +0000 (20:21 +0200)
server/sonar-web/src/main/js/components/issue/components/IssueActionsBar.tsx
server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueActionsBar-test.tsx.snap

index cdacdb475724a85536dd04e06eb06a24cc558f3a..7c7b2353c9df31a5107fa87db0e242e8baed4aed 100644 (file)
@@ -127,17 +127,15 @@ export default class IssueActionsBar extends React.PureComponent<Props, State> {
               togglePopup={this.props.togglePopup}
             />
           </li>
-          {!isSecurityHotspot && (
-            <li className="issue-meta">
-              <IssueAssign
-                canAssign={canAssign}
-                isOpen={this.props.currentPopup === 'assign' && canAssign}
-                issue={issue}
-                onAssign={this.props.onAssign}
-                togglePopup={this.props.togglePopup}
-              />
-            </li>
-          )}
+          <li className="issue-meta">
+            <IssueAssign
+              canAssign={canAssign}
+              isOpen={this.props.currentPopup === 'assign' && canAssign}
+              issue={issue}
+              onAssign={this.props.onAssign}
+              togglePopup={this.props.togglePopup}
+            />
+          </li>
           {!isSecurityHotspot && issue.effort && (
             <li className="issue-meta">
               <span className="issue-meta-label">
index 471c32d588a7b7da82b8cede6f220307c76921c2..229651354a32e832e58906f9fb05ef5bbc75d0e3 100644 (file)
@@ -814,6 +814,49 @@ exports[`should render security hotspot correctly 1`] = `
         togglePopup={[MockFunction]}
       />
     </li>
+    <li
+      className="issue-meta"
+    >
+      <IssueAssign
+        canAssign={false}
+        isOpen={false}
+        issue={
+          Object {
+            "actions": Array [],
+            "component": "main.js",
+            "componentLongName": "main.js",
+            "componentQualifier": "FIL",
+            "componentUuid": "foo1234",
+            "creationDate": "2017-03-01T09:36:01+0100",
+            "flows": Array [],
+            "fromHotspot": false,
+            "key": "AVsae-CQS-9G3txfbFN2",
+            "line": 25,
+            "message": "Reduce the number of conditional operators (4) used in the expression",
+            "organization": "myorg",
+            "project": "myproject",
+            "projectKey": "foo",
+            "projectName": "Foo",
+            "projectOrganization": "org",
+            "rule": "javascript:S1067",
+            "ruleName": "foo",
+            "secondaryLocations": Array [],
+            "severity": "MAJOR",
+            "status": "OPEN",
+            "textRange": Object {
+              "endLine": 26,
+              "endOffset": 15,
+              "startLine": 25,
+              "startOffset": 0,
+            },
+            "transitions": Array [],
+            "type": "SECURITY_HOTSPOT",
+          }
+        }
+        onAssign={[MockFunction]}
+        togglePopup={[MockFunction]}
+      />
+    </li>
   </ul>
   <ul
     className="list-inline"