diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2020-12-16 15:38:48 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-12-22 20:09:37 +0000 |
commit | abced7a7e962a91b53b0d50465a01d6100d87a57 (patch) | |
tree | 68ef47df97c082c7a4108b2c99075559bb53b570 /server/sonar-web/src/main/js/store | |
parent | 845542d4912f32222abe15a010a38e16622c158b (diff) | |
download | sonarqube-abced7a7e962a91b53b0d50465a01d6100d87a57.tar.gz sonarqube-abced7a7e962a91b53b0d50465a01d6100d87a57.zip |
SONAR-13999 Use global default project visibility
Diffstat (limited to 'server/sonar-web/src/main/js/store')
-rw-r--r-- | server/sonar-web/src/main/js/store/rootActions.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/server/sonar-web/src/main/js/store/rootActions.ts b/server/sonar-web/src/main/js/store/rootActions.ts index c6471073c65..70d9b2a4911 100644 --- a/server/sonar-web/src/main/js/store/rootActions.ts +++ b/server/sonar-web/src/main/js/store/rootActions.ts @@ -22,7 +22,7 @@ import { Dispatch } from 'redux'; import * as auth from '../api/auth'; import { getLanguages } from '../api/languages'; import { getAllMetrics } from '../api/metrics'; -import { getOrganization, getOrganizationNavigation } from '../api/organizations'; +import { getOrganization } from '../api/organizations'; import { getQualityGateProjectStatus } from '../api/quality-gates'; import { getBranchLikeQuery } from '../helpers/branch-like'; import { extractStatusConditionsFromProjectStatus } from '../helpers/qualityGates'; @@ -38,7 +38,9 @@ export function fetchLanguages() { return (dispatch: Dispatch) => { getLanguages().then( languages => dispatch(receiveLanguages(languages)), - () => {} + () => { + /* do nothing */ + } ); }; } @@ -47,20 +49,18 @@ export function fetchMetrics() { return (dispatch: Dispatch) => { getAllMetrics().then( metrics => dispatch(receiveMetrics(metrics)), - () => {} + () => { + /* do nothing */ + } ); }; } -export const fetchOrganization = (key: string) => (dispatch: Dispatch) => { - return Promise.all([getOrganization(key), getOrganizationNavigation(key)]).then( - ([organization, navigation]) => { - if (organization) { - const organizationWithPermissions = { ...organization, ...navigation }; - dispatch(receiveOrganizations([organizationWithPermissions])); - } - } - ); +export const fetchOrganization = (key: string) => async (dispatch: Dispatch) => { + const organization = await getOrganization(key); + if (organization) { + dispatch(receiveOrganizations([organization])); + } }; export function fetchBranchStatus(branchLike: BranchLike, projectKey: string) { |