aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/store
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-08-14 17:01:34 +0200
committerGrégoire Aubert <gregoire.aubert@sonarsource.com>2017-08-16 09:14:40 +0200
commita212d447fddcff546a0d274d5186d5963f9ecf83 (patch)
tree64a3a75acd558cd2205195ed6da9c72e709abf54 /server/sonar-web/src/main/js/store
parent83c40b005c2ed08bd1d1b3459e6b5a4c7224d476 (diff)
downloadsonarqube-a212d447fddcff546a0d274d5186d5963f9ecf83.tar.gz
sonarqube-a212d447fddcff546a0d274d5186d5963f9ecf83.zip
Fix quality flaws
Diffstat (limited to 'server/sonar-web/src/main/js/store')
-rw-r--r--server/sonar-web/src/main/js/store/organizations/duck.js8
-rw-r--r--server/sonar-web/src/main/js/store/rootActions.js10
2 files changed, 7 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/js/store/organizations/duck.js b/server/sonar-web/src/main/js/store/organizations/duck.js
index fa8af85260f..77ebd43e2f3 100644
--- a/server/sonar-web/src/main/js/store/organizations/duck.js
+++ b/server/sonar-web/src/main/js/store/organizations/duck.js
@@ -229,12 +229,10 @@ function my(state /*: MyState */ = [], action /*: Action */) {
}
function groups(state /*: GroupsState */ = {}, action /*: Action */) {
- switch (action.type) {
- case 'RECEIVE_ORGANIZATION_GROUPS':
- return { ...state, [action.key]: action.groups };
- default:
- return state;
+ if (action.type === 'RECEIVE_ORGANIZATION_GROUPS') {
+ return { ...state, [action.key]: action.groups };
}
+ return state;
}
export default combineReducers({ byKey, my, groups });
diff --git a/server/sonar-web/src/main/js/store/rootActions.js b/server/sonar-web/src/main/js/store/rootActions.js
index 1ec61770048..5185ad9701e 100644
--- a/server/sonar-web/src/main/js/store/rootActions.js
+++ b/server/sonar-web/src/main/js/store/rootActions.js
@@ -37,13 +37,11 @@ export const onFail = dispatch => error =>
export const fetchAppState = () => dispatch =>
getGlobalNavigation().then(appState => dispatch(setAppState(appState)), onFail(dispatch));
-export const fetchLanguages = () => dispatch => {
- return getLanguages().then(languages => dispatch(receiveLanguages(languages)), onFail(dispatch));
-};
+export const fetchLanguages = () => dispatch =>
+ getLanguages().then(languages => dispatch(receiveLanguages(languages)), onFail(dispatch));
-export const fetchMetrics = () => dispatch => {
- return getMetrics().then(metrics => dispatch(receiveMetrics(metrics)), onFail(dispatch));
-};
+export const fetchMetrics = () => dispatch =>
+ getMetrics().then(metrics => dispatch(receiveMetrics(metrics)), onFail(dispatch));
export const fetchOrganizations = (organizations /*: Array<string> | void */) => dispatch =>
getOrganizations(organizations).then(