aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/store/rootReducer.js
blob: aee309845c2e5ead300d74a8abc911efa6b2f4d3 (plain)
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
/*
 * 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 notifications, * as fromNotifications from './notifications/duck';
import organizations, * as fromOrganizations from './organizations/duck';
import globalMessages, * as fromGlobalMessages from './globalMessages/duck';
import projectActivity from './projectActivity/duck';
import measuresApp, * as fromMeasuresApp from '../apps/component-measures/store/rootReducer';
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,
  notifications,
  organizations,
  projectActivity,
  users,

  // apps
  measuresApp,
  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, key) => (
    fromLanguages.getLanguages(state.languages, key)
);

export const getCurrentUser = state => (
    fromUsers.getCurrentUser(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 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 getMyOrganizations = state => (
    fromOrganizations.getMyOrganizations(state.organizations)
);

export const areThereCustomOrganizations = state => (
    getAppState(state).organizationsEnabled
);

export const getProjectActivity = state => (
    state.projectActivity
);

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 getSettingValue = (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) => (
    fromSettingsApp.getSettingsForCategory(state.settingsApp, category)
);

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)
);

export const getMeasuresAppComponent = state => (
    fromMeasuresApp.getComponent(state.measuresApp)
);

export const getMeasuresAppAllMetrics = state => (
    fromMeasuresApp.getAllMetrics(state.measuresApp)
);

export const getMeasuresAppDetailsMetric = state => (
    fromMeasuresApp.getDetailsMetric(state.measuresApp)
);

export const getMeasuresAppDetailsMeasure = state => (
    fromMeasuresApp.getDetailsMeasure(state.measuresApp)
);

export const getMeasuresAppDetailsSecondaryMeasure = state => (
    fromMeasuresApp.getDetailsSecondaryMeasure(state.measuresApp)
);

export const getMeasuresAppDetailsPeriods = state => (
    fromMeasuresApp.getDetailsPeriods(state.measuresApp)
);

export const isMeasuresAppFetching = state => (
    fromMeasuresApp.isFetching(state.measuresApp)
);

export const getMeasuresAppList = state => (
    fromMeasuresApp.getList(state.measuresApp)
);

export const getMeasuresAppListComponents = state => (
    fromMeasuresApp.getListComponents(state.measuresApp)
);

export const getMeasuresAppListSelected = state => (
    fromMeasuresApp.getListSelected(state.measuresApp)
);

export const getMeasuresAppListTotal = state => (
    fromMeasuresApp.getListTotal(state.measuresApp)
);

export const getMeasuresAppListPageIndex = state => (
    fromMeasuresApp.getListPageIndex(state.measuresApp)
);

export const getMeasuresAppTree = state => (
    fromMeasuresApp.getTree(state.measuresApp)
);

export const getMeasuresAppTreeComponents = state => (
    fromMeasuresApp.getTreeComponents(state.measuresApp)
);

export const getMeasuresAppTreeBreadcrumbs = state => (
    fromMeasuresApp.getTreeBreadcrumbs(state.measuresApp)
);

export const getMeasuresAppTreeSelected = state => (
    fromMeasuresApp.getTreeSelected(state.measuresApp)
);

export const getMeasuresAppTreeTotal = state => (
    fromMeasuresApp.getTreeTotal(state.measuresApp)
);

export const getMeasuresAppTreePageIndex = state => (
    fromMeasuresApp.getTreePageIndex(state.measuresApp)
);

export const getMeasuresAppHomeDomains = state => (
    fromMeasuresApp.getHomeDomains(state.measuresApp)
);

export const getMeasuresAppHomePeriods = state => (
    fromMeasuresApp.getHomePeriods(state.measuresApp)
);