1- import { eventsTableConfig } from "../configs/tableConfigs/eventsTableConfig" ;
2- import { seriesTableConfig } from "../configs/tableConfigs/seriesTableConfig" ;
3- import { recordingsTableConfig } from "../configs/tableConfigs/recordingsTableConfig" ;
4- import { jobsTableConfig } from "../configs/tableConfigs/jobsTableConfig" ;
5- import { serversTableConfig } from "../configs/tableConfigs/serversTableConfig" ;
6- import { servicesTableConfig } from "../configs/tableConfigs/servicesTableConfig" ;
7- import { usersTableConfig } from "../configs/tableConfigs/usersTableConfig" ;
8- import { groupsTableConfig } from "../configs/tableConfigs/groupsTableConfig" ;
9- import { TableConfig , aclsTableConfig } from "../configs/tableConfigs/aclsTableConfig" ;
10- import { themesTableConfig } from "../configs/tableConfigs/themesTableConfig" ;
1+ import { TableConfig } from "../configs/tableConfigs/aclsTableConfig" ;
112import {
123 deselectAll ,
134 loadResourceIntoTable ,
@@ -78,21 +69,13 @@ export const loadEventsIntoTable = (): AppThunk => async (dispatch, getState) =>
7869 resource : "events" as const ,
7970 rows : resource ,
8071 columns : events . columns ,
81- multiSelect : table . multiSelect ,
72+ multiSelect : table . multiSelect [ "events" ] ,
8273 pages : pages ,
8374 sortBy : table . sortBy [ "events" ] ,
8475 reverse : table . reverse [ "events" ] ,
8576 totalItems : total ,
8677 } ;
8778
88- if ( table . resource !== "events" ) {
89- const multiSelect = eventsTableConfig . multiSelect ;
90-
91- tableData = {
92- ...tableData ,
93- multiSelect : multiSelect ,
94- } ;
95- }
9679 dispatch ( loadResourceIntoTable ( tableData ) ) ;
9780} ;
9881
@@ -125,21 +108,13 @@ export const loadSeriesIntoTable = (): AppThunk => (dispatch, getState) => {
125108 resource : "series" as const ,
126109 rows : resource ,
127110 columns : series . columns ,
128- multiSelect : table . multiSelect ,
111+ multiSelect : table . multiSelect [ "series" ] ,
129112 pages : pages ,
130113 sortBy : table . sortBy [ "series" ] ,
131114 reverse : table . reverse [ "series" ] ,
132115 totalItems : total ,
133116 } ;
134117
135- if ( table . resource !== "series" ) {
136- const multiSelect = seriesTableConfig . multiSelect ;
137-
138- tableData = {
139- ...tableData ,
140- multiSelect : multiSelect ,
141- } ;
142- }
143118 dispatch ( loadResourceIntoTable ( tableData ) ) ;
144119} ;
145120
@@ -154,7 +129,7 @@ export const loadRecordingsIntoTable = (): AppThunk => (dispatch, getState) => {
154129 let tableData = {
155130 resource : "recordings" as const ,
156131 columns : recordings . columns ,
157- multiSelect : table . multiSelect ,
132+ multiSelect : table . multiSelect [ "recordings" ] ,
158133 pages : pages ,
159134 sortBy : table . sortBy [ "recordings" ] ,
160135 reverse : table . reverse [ "recordings" ] ,
@@ -164,15 +139,6 @@ export const loadRecordingsIntoTable = (): AppThunk => (dispatch, getState) => {
164139 totalItems : total ,
165140 } ;
166141
167- if ( table . resource !== "recordings" ) {
168- const multiSelect = recordingsTableConfig . multiSelect ;
169-
170- tableData = {
171- ...tableData ,
172- multiSelect : multiSelect ,
173- } ;
174- }
175-
176142 dispatch ( loadResourceIntoTable ( tableData ) ) ;
177143} ;
178144
@@ -190,21 +156,13 @@ export const loadJobsIntoTable = (): AppThunk => (dispatch, getState) => {
190156 return { ...obj , selected : false }
191157 } ) ,
192158 columns : jobs . columns ,
193- multiSelect : table . multiSelect ,
159+ multiSelect : table . multiSelect [ "jobs" ] ,
194160 pages : pages ,
195161 sortBy : table . sortBy [ "jobs" ] ,
196162 reverse : table . reverse [ "jobs" ] ,
197163 totalItems : total ,
198164 } ;
199165
200- if ( table . resource !== "jobs" ) {
201- const multiSelect = jobsTableConfig . multiSelect ;
202-
203- tableData = {
204- ...tableData ,
205- multiSelect : multiSelect ,
206- } ;
207- }
208166 dispatch ( loadResourceIntoTable ( tableData ) ) ;
209167} ;
210168
@@ -222,21 +180,13 @@ export const loadServersIntoTable = (): AppThunk => (dispatch, getState) => {
222180 return { ...obj , selected : false }
223181 } ) ,
224182 columns : servers . columns ,
225- multiSelect : table . multiSelect ,
183+ multiSelect : table . multiSelect [ "servers" ] ,
226184 pages : pages ,
227185 sortBy : table . sortBy [ "servers" ] ,
228186 reverse : table . reverse [ "servers" ] ,
229187 totalItems : total ,
230188 } ;
231189
232- if ( table . resource !== "servers" ) {
233- const multiSelect = serversTableConfig . multiSelect ;
234-
235- tableData = {
236- ...tableData ,
237- multiSelect : multiSelect ,
238- } ;
239- }
240190 dispatch ( loadResourceIntoTable ( tableData ) ) ;
241191} ;
242192
@@ -256,20 +206,11 @@ export const loadServicesIntoTable = (): AppThunk => (dispatch, getState) => {
256206 totalItems : total ,
257207 resource : "services" as const ,
258208 columns : services . columns ,
259- multiSelect : table . multiSelect ,
209+ multiSelect : table . multiSelect [ "services" ] ,
260210 sortBy : table . sortBy [ "services" ] ,
261211 reverse : table . reverse [ "services" ] ,
262212 } ;
263213
264- if ( table . resource !== "services" ) {
265- const multiSelect = servicesTableConfig . multiSelect ;
266-
267- tableData = {
268- ...tableData ,
269- multiSelect : multiSelect ,
270- } ;
271- }
272-
273214 dispatch ( loadResourceIntoTable ( tableData ) ) ;
274215} ;
275216
@@ -287,21 +228,13 @@ export const loadUsersIntoTable = (): AppThunk => (dispatch, getState) => {
287228 return { ...obj , selected : false }
288229 } ) ,
289230 columns : users . columns ,
290- multiSelect : table . multiSelect ,
231+ multiSelect : table . multiSelect [ "users" ] ,
291232 pages : pages ,
292233 sortBy : table . sortBy [ "users" ] ,
293234 reverse : table . reverse [ "users" ] ,
294235 totalItems : total ,
295236 } ;
296237
297- if ( table . resource !== "users" ) {
298- const multiSelect = usersTableConfig . multiSelect ;
299-
300- tableData = {
301- ...tableData ,
302- multiSelect : multiSelect ,
303- } ;
304- }
305238 dispatch ( loadResourceIntoTable ( tableData ) ) ;
306239} ;
307240
@@ -319,21 +252,13 @@ export const loadGroupsIntoTable = (): AppThunk => (dispatch, getState) => {
319252 return { ...obj , selected : false }
320253 } ) ,
321254 columns : groups . columns ,
322- multiSelect : table . multiSelect ,
255+ multiSelect : table . multiSelect [ "groups" ] ,
323256 pages : pages ,
324257 sortBy : table . sortBy [ "groups" ] ,
325258 reverse : table . reverse [ "groups" ] ,
326259 totalItems : total ,
327260 } ;
328261
329- if ( table . resource !== "groups" ) {
330- const multiSelect = groupsTableConfig . multiSelect ;
331-
332- tableData = {
333- ...tableData ,
334- multiSelect : multiSelect ,
335- } ;
336- }
337262 dispatch ( loadResourceIntoTable ( tableData ) ) ;
338263} ;
339264
@@ -351,20 +276,13 @@ export const loadAclsIntoTable = (): AppThunk => (dispatch, getState) => {
351276 return { ...obj , selected : false }
352277 } ) ,
353278 columns : acls . columns ,
354- multiSelect : table . multiSelect ,
279+ multiSelect : table . multiSelect [ "acls" ] ,
355280 pages : pages ,
356281 sortBy : table . sortBy [ "acls" ] ,
357282 reverse : table . reverse [ "acls" ] ,
358283 totalItems : total ,
359284 } ;
360285
361- if ( table . resource !== "acls" ) {
362- const multiSelect = aclsTableConfig . multiSelect ;
363- tableData = {
364- ...tableData ,
365- multiSelect : multiSelect ,
366- } ;
367- }
368286 dispatch ( loadResourceIntoTable ( tableData ) ) ;
369287} ;
370288
@@ -382,21 +300,13 @@ export const loadThemesIntoTable = (): AppThunk => (dispatch, getState) => {
382300 return { ...obj , selected : false }
383301 } ) ,
384302 columns : themes . columns ,
385- multiSelect : table . multiSelect ,
303+ multiSelect : table . multiSelect [ "themes" ] ,
386304 pages : pages ,
387305 sortBy : table . sortBy [ "themes" ] ,
388306 reverse : table . reverse [ "themes" ] ,
389307 totalItems : total ,
390308 } ;
391309
392- if ( table . resource !== "themes" ) {
393- const multiSelect = themesTableConfig . multiSelect ;
394-
395- tableData = {
396- ...tableData ,
397- multiSelect : multiSelect ,
398- } ;
399- }
400310 dispatch ( loadResourceIntoTable ( tableData ) ) ;
401311} ;
402312
0 commit comments