aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-07-19 17:11:03 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-07-25 09:20:30 +0200
commit69490493bc79d654e9c2d6aa3e5ff1821bccef1b (patch)
tree99b4209aed474a6273615ec00ba2c2a77109aa65 /server
parent1b282fb36a9f0387b526ac9d360b52c551942dae (diff)
downloadsonarqube-69490493bc79d654e9c2d6aa3e5ff1821bccef1b.tar.gz
sonarqube-69490493bc79d654e9c2d6aa3e5ff1821bccef1b.zip
SONAR-9566, SONAR-9571 Update bulk operation to display only tags and assignee related to the selected organization
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/api/issues.js2
-rw-r--r--server/sonar-web/src/main/js/apps/issues/components/App.js1
-rw-r--r--server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.js18
3 files changed, 16 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/api/issues.js b/server/sonar-web/src/main/js/api/issues.js
index 30cb211e96e..598fdce00de 100644
--- a/server/sonar-web/src/main/js/api/issues.js
+++ b/server/sonar-web/src/main/js/api/issues.js
@@ -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<*> {
diff --git a/server/sonar-web/src/main/js/apps/issues/components/App.js b/server/sonar-web/src/main/js/apps/issues/components/App.js
index 4e7d31c1ead..43dfe6ecba7 100644
--- a/server/sonar-web/src/main/js/apps/issues/components/App.js
+++ b/server/sonar-web/src/main/js/apps/issues/components/App.js
@@ -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>
);
diff --git a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.js b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.js
index 8fe75c2019c..4340f1670bf 100644
--- a/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.js
+++ b/server/sonar-web/src/main/js/apps/issues/components/BulkChangeModal.js
@@ -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;