1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
/*
* SonarQube
* Copyright (C) 2009-2017 SonarSource SA
* mailto:info 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.
*/
import { combineReducers } from 'redux';
import appState from './appState/duck';
import components, * as fromComponents from './components/reducer';
import users, * as fromUsers from './users/reducer';
import favorites, * as fromFavorites from './favorites/duck';
import languages, * as fromLanguages from './languages/reducer';
import measures, * as fromMeasures from './measures/reducer';
import metrics, * as fromMetrics from './metrics/reducer';
import notifications, * as fromNotifications from './notifications/duck';
import organizations, * as fromOrganizations from './organizations/duck';
import organizationsMembers, * as fromOrganizationsMembers from './organizationsMembers/reducer';
import globalMessages, * as fromGlobalMessages from './globalMessages/duck';
import permissionsApp, * as fromPermissionsApp from '../apps/permissions/shared/store/rootReducer';
import projectAdminApp, * as fromProjectAdminApp from '../apps/project-admin/store/rootReducer';
import projectsApp, * as fromProjectsApp from '../apps/projects/store/reducer';
import qualityGatesApp from '../apps/quality-gates/store/rootReducer';
import settingsApp, * as fromSettingsApp from '../apps/settings/store/rootReducer';
export default combineReducers({
appState,
components,
globalMessages,
favorites,
languages,
measures,
metrics,
notifications,
organizations,
organizationsMembers,
users,
// apps
permissionsApp,
projectAdminApp,
projectsApp,
qualityGatesApp,
settingsApp
});
export const getAppState = state => state.appState;
export const getComponent = (state, key) => fromComponents.getComponent(state.components, key);
export const getGlobalMessages = state =>
fromGlobalMessages.getGlobalMessages(state.globalMessages);
export const getLanguages = state => fromLanguages.getLanguages(state.languages);
export const getLanguageByKey = (state, key) =>
fromLanguages.getLanguageByKey(state.languages, key);
export const getCurrentUser = state => fromUsers.getCurrentUser(state.users);
export const getUserLogins = state => fromUsers.getUserLogins(state.users);
export const getUserByLogin = (state, login) => fromUsers.getUserByLogin(state.users, login);
export const getUsersByLogins = (state, logins) => fromUsers.getUsersByLogins(state.users, logins);
export const getUsers = state => fromUsers.getUsers(state.users);
export const isFavorite = (state, componentKey) =>
fromFavorites.isFavorite(state.favorites, componentKey);
export const getComponentMeasure = (state, componentKey, metricKey) =>
fromMeasures.getComponentMeasure(state.measures, componentKey, metricKey);
export const getComponentMeasures = (state, componentKey) =>
fromMeasures.getComponentMeasures(state.measures, componentKey);
export const getMetrics = state => fromMetrics.getMetrics(state.metrics);
export const getMetricByKey = (state, key) => fromMetrics.getMetricByKey(state.metrics, key);
export const getMetricsKey = state => fromMetrics.getMetricsKey(state.metrics);
export const getGlobalNotifications = state => fromNotifications.getGlobal(state.notifications);
export const getProjectsWithNotifications = state =>
fromNotifications.getProjects(state.notifications);
export const getProjectNotifications = (state, project) =>
fromNotifications.getForProject(state.notifications, project);
export const getNotificationChannels = state => fromNotifications.getChannels(state.notifications);
export const getNotificationGlobalTypes = state =>
fromNotifications.getGlobalTypes(state.notifications);
export const getNotificationPerProjectTypes = state =>
fromNotifications.getPerProjectTypes(state.notifications);
export const getOrganizationByKey = (state, key) =>
fromOrganizations.getOrganizationByKey(state.organizations, key);
export const getOrganizationGroupsByKey = (state, key) =>
fromOrganizations.getOrganizationGroupsByKey(state.organizations, key);
export const getMyOrganizations = state =>
fromOrganizations.getMyOrganizations(state.organizations);
export const areThereCustomOrganizations = state => getAppState(state).organizationsEnabled;
export const getOrganizationMembersLogins = (state, organization) =>
fromOrganizationsMembers.getOrganizationMembersLogins(state.organizationsMembers, organization);
export const getOrganizationMembersState = (state, organization) =>
fromOrganizationsMembers.getOrganizationMembersState(state.organizationsMembers, organization);
export const getProjects = state => fromProjectsApp.getProjects(state.projectsApp);
export const getProjectsAppState = state => fromProjectsApp.getState(state.projectsApp);
export const getProjectsAppFacetByProperty = (state, property) =>
fromProjectsApp.getFacetByProperty(state.projectsApp, property);
export const getProjectsAppMaxFacetValue = state =>
fromProjectsApp.getMaxFacetValue(state.projectsApp);
export const getQualityGatesAppState = state => state.qualityGatesApp;
export const getPermissionsAppUsers = state => fromPermissionsApp.getUsers(state.permissionsApp);
export const getPermissionsAppGroups = state => fromPermissionsApp.getGroups(state.permissionsApp);
export const isPermissionsAppLoading = state => fromPermissionsApp.isLoading(state.permissionsApp);
export const getPermissionsAppQuery = state => fromPermissionsApp.getQuery(state.permissionsApp);
export const getPermissionsAppFilter = state => fromPermissionsApp.getFilter(state.permissionsApp);
export const getPermissionsAppSelectedPermission = state =>
fromPermissionsApp.getSelectedPermission(state.permissionsApp);
export const getPermissionsAppError = state => fromPermissionsApp.getError(state.permissionsApp);
export const getGlobalSettingValue = (state, key) =>
fromSettingsApp.getValue(state.settingsApp, key);
export const getSettingsAppDefinition = (state, key) =>
fromSettingsApp.getDefinition(state.settingsApp, key);
export const getSettingsAppAllCategories = state =>
fromSettingsApp.getAllCategories(state.settingsApp);
export const getSettingsAppDefaultCategory = state =>
fromSettingsApp.getDefaultCategory(state.settingsApp);
export const getSettingsAppSettingsForCategory = (state, category, componentKey) =>
fromSettingsApp.getSettingsForCategory(state.settingsApp, category, componentKey);
export const getSettingsAppChangedValue = (state, key) =>
fromSettingsApp.getChangedValue(state.settingsApp, key);
export const isSettingsAppLoading = (state, key) =>
fromSettingsApp.isLoading(state.settingsApp, key);
export const getSettingsAppLicenseByKey = (state, key) =>
fromSettingsApp.getLicenseByKey(state.settingsApp, key);
export const getSettingsAppAllLicenseKeys = state =>
fromSettingsApp.getAllLicenseKeys(state.settingsApp);
export const getSettingsAppValidationMessage = (state, key) =>
fromSettingsApp.getValidationMessage(state.settingsApp, key);
export const getSettingsAppEncryptionState = state =>
fromSettingsApp.getEncryptionState(state.settingsApp);
export const getSettingsAppGlobalMessages = state =>
fromSettingsApp.getGlobalMessages(state.settingsApp);
export const getProjectAdminProfileByKey = (state, profileKey) =>
fromProjectAdminApp.getProfileByKey(state.projectAdminApp, profileKey);
export const getProjectAdminAllProfiles = state =>
fromProjectAdminApp.getAllProfiles(state.projectAdminApp);
export const getProjectAdminProjectProfiles = (state, projectKey) =>
fromProjectAdminApp.getProjectProfiles(state.projectAdminApp, projectKey);
export const getProjectAdminGateById = (state, gateId) =>
fromProjectAdminApp.getGateById(state.projectAdminApp, gateId);
export const getProjectAdminAllGates = state =>
fromProjectAdminApp.getAllGates(state.projectAdminApp);
export const getProjectAdminProjectGate = (state, projectKey) =>
fromProjectAdminApp.getProjectGate(state.projectAdminApp, projectKey);
export const getProjectAdminLinkById = (state, linkId) =>
fromProjectAdminApp.getLinkById(state.projectAdminApp, linkId);
export const getProjectAdminProjectLinks = (state, projectKey) =>
fromProjectAdminApp.getProjectLinks(state.projectAdminApp, projectKey);
export const getProjectAdminComponentByKey = (state, componentKey) =>
fromProjectAdminApp.getComponentByKey(state.projectAdminApp, componentKey);
export const getProjectAdminProjectModules = (state, projectKey) =>
fromProjectAdminApp.getProjectModules(state.projectAdminApp, projectKey);
export const getProjectAdminGlobalMessages = state =>
fromProjectAdminApp.getGlobalMessages(state.projectAdminApp);
|