From 5d7a55d1a1f259ab7b9395743c36af7aa83827a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Aubert?= Date: Wed, 19 Jul 2017 17:24:02 +0200 Subject: [PATCH] SONAR-9566, SONAR-9570 Filter tags by organization when updating an issue tags --- .../src/main/js/components/issue/components/IssueTags.js | 1 + .../issue/components/__tests__/IssueTags-test.js | 1 + .../__tests__/__snapshots__/IssueTags-test.js.snap | 2 ++ .../main/js/components/issue/popups/SetIssueTagsPopup.js | 4 +++- .../issue/popups/__tests__/SetIssueTagsPopup-test.js | 7 ++++++- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/components/issue/components/IssueTags.js b/server/sonar-web/src/main/js/components/issue/components/IssueTags.js index 8974ced8031..6e0365be9aa 100644 --- a/server/sonar-web/src/main/js/components/issue/components/IssueTags.js +++ b/server/sonar-web/src/main/js/components/issue/components/IssueTags.js @@ -67,6 +67,7 @@ export default class IssueTags extends React.PureComponent { popup={ diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTags-test.js b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTags-test.js index ac17925d7bc..0262c1b317c 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTags-test.js +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/IssueTags-test.js @@ -24,6 +24,7 @@ import { click } from '../../../../helpers/testUtils'; const issue = { key: 'issuekey', + projectOrganization: 'foo', tags: ['mytag', 'test'] }; diff --git a/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTags-test.js.snap b/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTags-test.js.snap index 1e1fc747a1f..6cfa1ab8ea8 100644 --- a/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTags-test.js.snap +++ b/server/sonar-web/src/main/js/components/issue/components/__tests__/__snapshots__/IssueTags-test.js.snap @@ -24,6 +24,7 @@ exports[`should open the popup when the button is clicked 2`] = ` popup={ void, + organization: string, selectedTags: Array, setTags: (Array) => void }; @@ -59,7 +60,8 @@ export default class SetIssueTagsPopup extends React.PureComponent { onSearch = (query: string) => { searchIssueTags({ q: query || '', - ps: Math.min(this.props.selectedTags.length - 1 + LIST_SIZE, 100) + ps: Math.min(this.props.selectedTags.length - 1 + LIST_SIZE, 100), + organization: this.props.organization }).then((tags: Array) => { if (this.mounted) { this.setState({ searchResult: tags }); diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetIssueTagsPopup-test.js b/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetIssueTagsPopup-test.js index c9d1c0a4e23..2786b59ad9e 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetIssueTagsPopup-test.js +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/SetIssueTagsPopup-test.js @@ -23,7 +23,12 @@ import SetIssueTagsPopup from '../SetIssueTagsPopup'; it('should render tags popup correctly', () => { const element = shallow( - + ); element.setState({ searchResult: ['mytag', 'test', 'second'] }); expect(element).toMatchSnapshot(); -- 2.39.5