]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9566, SONAR-9571 Update bulk operation to display only tags and assignee relate...
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>
Wed, 19 Jul 2017 15:11:03 +0000 (17:11 +0200)
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>
Tue, 25 Jul 2017 07:20:30 +0000 (09:20 +0200)
server/sonar-web/src/main/js/api/issues.js
server/sonar-web/src/main/js/apps/issues/components/App.js
server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.js

index 30cb211e96e3618ad9bcf55d084b2d7c0bae7baf..598fdce00de42734cf7298b55924a0e0edc6f248 100644 (file)
@@ -89,7 +89,7 @@ export function getIssuesCount(query: {}): Promise<*> {
 }
 
 export const searchIssueTags = (
-  data: { ps?: number, q?: string } = { ps: 500 }
+  data: { organization?: string, ps?: number, q?: string } = { ps: 500 }
 ): Promise<Array<string>> => getJSON('/api/issues/tags', data).then(r => r.tags);
 
 export function getIssueChangelog(issue: string): Promise<*> {
index 4e7d31c1ead58c719fb711fce829f0c7758c2204..43dfe6ecba7d61c163325a9bea0ec65baf2043e0 100644 (file)
@@ -669,6 +669,7 @@ export default class App extends React.PureComponent {
             onClose={this.closeBulkChange}
             onDone={this.handleBulkChangeDone}
             onRequestFail={this.props.onRequestFail}
+            organization={this.props.organization}
           />}
       </div>
     );
index 8fe75c2019c2fa49c559b0c87af005799c82ecfc..4340f1670bf8f6387bc56954456492a92285ae9d 100644 (file)
@@ -41,7 +41,8 @@ type Props = {|
   fetchIssues: ({}) => Promise<*>,
   onClose: () => void,
   onDone: () => void,
-  onRequestFail: Error => void
+  onRequestFail: Error => void,
+  organization?: { key: string }
 |};
 
 type State = {|
@@ -58,6 +59,7 @@ type State = {|
   assignee?: string,
   comment?: string,
   notifications?: boolean,
+  organization?: string,
   removeTags?: Array<string>,
   severity?: string,
   transition?: string,
@@ -74,12 +76,20 @@ export default class BulkChangeModal extends React.PureComponent {
 
   constructor(props: Props) {
     super(props);
-    this.state = { issues: [], loading: true, submitting: false };
+    let organization = props.component && props.component.organization;
+    if (props.organization && !organization) {
+      organization = props.organization.key;
+    }
+    this.state = { issues: [], loading: true, submitting: false, organization };
   }
 
   componentDidMount() {
     this.mounted = true;
-    Promise.all([this.loadIssues(), searchIssueTags()]).then(([issues, tags]) => {
+
+    Promise.all([
+      this.loadIssues(),
+      searchIssueTags({ organization: this.state.organization, ps: 500 })
+    ]).then(([issues, tags]) => {
       if (this.mounted) {
         this.setState({
           issues: issues.issues,
@@ -107,7 +117,7 @@ export default class BulkChangeModal extends React.PureComponent {
 
   handleAssigneeSearch = (query: string) => {
     if (query.length > 1) {
-      return searchAssignees(query, this.props.component);
+      return searchAssignees(query, this.state.organization);
     } else {
       const { currentUser } = this.props;
       const { issues } = this.state;