diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-01-18 13:39:48 +0100 |
---|---|---|
committer | Stas Vilchik <stas-vilchik@users.noreply.github.com> | 2017-01-24 09:25:53 +0100 |
commit | d758d6bf03f5cd4ba5b9e55f7370a8dd95e4747a (patch) | |
tree | 2825081e5a3d10968d1c04292427021c01818e65 /server/sonar-web/src/main/js/store | |
parent | 0eb12aca0e73a4347d78c4746d57be489bad0903 (diff) | |
download | sonarqube-d758d6bf03f5cd4ba5b9e55f7370a8dd95e4747a.tar.gz sonarqube-d758d6bf03f5cd4ba5b9e55f7370a8dd95e4747a.zip |
SONAR-8628 Display organizations on the Issues page
Diffstat (limited to 'server/sonar-web/src/main/js/store')
-rw-r--r-- | server/sonar-web/src/main/js/store/organizations/utils.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/store/organizations/utils.js b/server/sonar-web/src/main/js/store/organizations/utils.js new file mode 100644 index 00000000000..b9696dfd83b --- /dev/null +++ b/server/sonar-web/src/main/js/store/organizations/utils.js @@ -0,0 +1,34 @@ +/* + * SonarQube + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +// @flow +import getStore from '../../app/utils/getStore'; +import { getOrganizationByKey, areThereCustomOrganizations as customOrganizations } from '../rootReducer'; + +export const getOrganization = (key: string) => { + const store = getStore(); + const state = store.getState(); + return getOrganizationByKey(state, key); +}; + +export const areThereCustomOrganizations = () => { + const store = getStore(); + const state = store.getState(); + return customOrganizations(state); +}; |