@bento-core/table 1.0.1-ccdihub.90 → 1.0.1-ccdihub.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/DefaultThemConfig.js +1 -1
  2. package/dist/ExtendedView.js +6 -4
  3. package/dist/TableView.js +11 -6
  4. package/dist/body/CustomTblBody.js +4 -2
  5. package/dist/body/DisplayBodyCell.js +8 -4
  6. package/dist/body/components/CPIModal.js +154 -7
  7. package/dist/body/components/CPIView.js +4 -2
  8. package/dist/body/components/assets/Cart_Icon.svg +3 -0
  9. package/dist/body/components/assets/Question_Icon.svg +4 -0
  10. package/dist/toolbar/DownloadButtonView.js +11 -7
  11. package/dist/toolbar/ManageColumnView.js +110 -28
  12. package/dist/toolbar/assets/Hidden_Column.svg +4 -0
  13. package/dist/toolbar/assets/View_Columns.svg +6 -0
  14. package/dist/wrapper/WrapperService.js +36 -0
  15. package/dist/wrapper/components/AddFiles.js +63 -0
  16. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +35 -0
  17. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogController.js +36 -0
  18. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogView.js +43 -0
  19. package/dist/wrapper/components/CPIFilesView/CPIFilesView.js +178 -0
  20. package/dist/wrapper/components/ReduxAddFile.js +27 -0
  21. package/dist/wrapper/components/Snackbar/Snackbar.js +40 -0
  22. package/dist/wrapper/components/Snackbar/SnackbarRedux.js +16 -0
  23. package/dist/wrapper/components/Snackbar/SuccessOutlined.js +17 -0
  24. package/dist/wrapper/components/TextFieldView.js +37 -0
  25. package/dist/wrapper/components/TooltipView.js +40 -0
  26. package/package.json +8 -2
  27. package/src/DefaultThemConfig.js +1 -1
  28. package/src/ExtendedView.js +7 -5
  29. package/src/TableView.js +10 -5
  30. package/src/body/CustomTblBody.js +2 -0
  31. package/src/body/DisplayBodyCell.js +4 -0
  32. package/src/body/components/CPIModal.js +163 -1
  33. package/src/body/components/CPIView.js +2 -0
  34. package/src/body/components/assets/Cart_Icon.svg +3 -0
  35. package/src/body/components/assets/Question_Icon.svg +4 -0
  36. package/src/toolbar/DownloadButtonView.js +8 -5
  37. package/src/toolbar/ManageColumnView.js +113 -26
  38. package/src/toolbar/assets/Hidden_Column.svg +4 -0
  39. package/src/toolbar/assets/View_Columns.svg +6 -0
  40. package/src/wrapper/WrapperService.js +25 -0
  41. package/src/wrapper/components/AddFiles.js +62 -0
  42. package/src/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +37 -0
  43. package/src/wrapper/components/AddToCartDialog/AddToCartDialogController.js +32 -0
  44. package/src/wrapper/components/AddToCartDialog/AddToCartDialogView.js +57 -0
  45. package/src/wrapper/components/CPIFilesView/CPIFilesView.js +190 -0
  46. package/src/wrapper/components/ReduxAddFile.js +20 -0
  47. package/src/wrapper/components/Snackbar/Snackbar.js +43 -0
  48. package/src/wrapper/components/Snackbar/SnackbarRedux.js +11 -0
  49. package/src/wrapper/components/Snackbar/SuccessOutlined.js +10 -0
  50. package/src/wrapper/components/TextFieldView.js +32 -0
  51. package/src/wrapper/components/TooltipView.js +35 -0
package/src/TableView.js CHANGED
@@ -62,8 +62,10 @@ const TableView = ({
62
62
  totalRowCount,
63
63
  onSortByColumn,
64
64
  onColumnViewChange,
65
+ onAllColumnViewChange,
65
66
  themeConfig = {},
66
67
  queryVariables,
68
+ navigation,
67
69
  }) => {
68
70
  useEffect(() => {
69
71
  const tableContainer = document.getElementById('tableContainer');
@@ -91,6 +93,7 @@ const TableView = ({
91
93
  <ExtendedView
92
94
  table={table}
93
95
  onColumnViewChange={onColumnViewChange}
96
+ onAllColumnViewChange={onAllColumnViewChange}
94
97
  onRowsPerPageChange={onRowsPerPageChange}
95
98
  onPageChange={onPageChange}
96
99
  numSelected={table?.selectedRows?.length || 0}
@@ -120,6 +123,7 @@ const TableView = ({
120
123
  rows={tableRows}
121
124
  table={table}
122
125
  onRowSelectChange={onRowSelectChange}
126
+ navigation={navigation}
123
127
  />
124
128
  </Table>
125
129
  </CustomTableContainer>
@@ -143,15 +147,16 @@ const TableView = ({
143
147
  onPageChange={onPageChange}
144
148
  onRowsPerPageChange={onRowsPerPageChange}
145
149
  />
146
- <DownloadButton
147
- count={table.totalRowCount || 0}
148
- queryVariables={queryVariables}
149
- table={table}
150
- />
151
150
  <ManageColumnView
152
151
  table={table}
153
152
  manageViewColumns={manageViewColumns}
154
153
  onColumnViewChange={onColumnViewChange}
154
+ onAllColumnViewChange={onAllColumnViewChange}
155
+ />
156
+ <DownloadButton
157
+ count={table.totalRowCount || 0}
158
+ queryVariables={queryVariables}
159
+ table={table}
155
160
  />
156
161
  </div>
157
162
  </>
@@ -22,6 +22,7 @@ const CustomTableBody = ({
22
22
  table,
23
23
  onRowSelectChange,
24
24
  customTheme = {},
25
+ navigation,
25
26
  }) => {
26
27
  const { columns } = table;
27
28
  const displayColunms = columns.filter((col) => col.display);
@@ -51,6 +52,7 @@ const CustomTableBody = ({
51
52
  column={column}
52
53
  row={row}
53
54
  themeConfig={themeConfig}
55
+ navigation={navigation}
54
56
  />
55
57
  );
56
58
  })
@@ -31,6 +31,7 @@ const ViewCell = ({
31
31
  column,
32
32
  row,
33
33
  themeConfig,
34
+ navigation,
34
35
  }) => {
35
36
  const { cellType } = column;
36
37
  switch (cellType) {
@@ -61,6 +62,7 @@ const ViewCell = ({
61
62
  row={row}
62
63
  column={column}
63
64
  themeConfig={themeConfig}
65
+ navigation={navigation}
64
66
  />
65
67
  );
66
68
  default:
@@ -76,12 +78,14 @@ const DisplayCell = ({
76
78
  row,
77
79
  column,
78
80
  themeConfig,
81
+ navigation,
79
82
  }) => (
80
83
  <TableCell className={column.dataField}>
81
84
  <ViewCell
82
85
  row={row}
83
86
  column={column}
84
87
  themeConfig={themeConfig}
88
+ navigation={navigation}
85
89
  />
86
90
  </TableCell>
87
91
  );
@@ -1,6 +1,8 @@
1
1
  import React, { useState } from 'react';
2
+ import { NavLink } from 'react-router-dom';
2
3
  import {
3
4
  Box,
5
+ Checkbox,
4
6
  Modal,
5
7
  Typography,
6
8
  IconButton,
@@ -12,6 +14,7 @@ import {
12
14
  TableRow,
13
15
  TableCell,
14
16
  TableBody,
17
+ Button,
15
18
  } from '@material-ui/core';
16
19
  // import CustomTableBody from '../../body/CustomTblBody';
17
20
  import CloseIcon from '@material-ui/icons/Close';
@@ -19,6 +22,31 @@ import { withStyles } from '@material-ui/core/styles';
19
22
  import styles from './ModalStyle';
20
23
  // import TableHeader from '../../header/CustomTblHeader';
21
24
  import HeaderCell from '../../header/CustomCell';
25
+ import AddFileButtonView from '../../wrapper/components/ReduxAddFile';
26
+ import questionIcon from './assets/Question_Icon.svg';
27
+ import cartIcon from './assets/Cart_Icon.svg';
28
+
29
+ const tooltipContentAddAll = {
30
+ tooltipText: 'Click button to add all Hub files associated with this participant to the cart.',
31
+ icon: questionIcon,
32
+ alt: 'tooltipIcon',
33
+ Participants: 'Click button to add all files associated with the filtered row(s).',
34
+ arrow: true,
35
+ styles: {
36
+ border: '#03A383 1px solid',
37
+ },
38
+ };
39
+
40
+ const tooltipContent = {
41
+ tooltipText: 'Click button to add all selected files associated with this participant to the cart.',
42
+ icon: questionIcon,
43
+ alt: 'tooltipIcon',
44
+ Participants: 'Click button to add files associated with the selected row(s).',
45
+ arrow: true,
46
+ styles: {
47
+ border: '#03A383 1px solid',
48
+ },
49
+ };
22
50
 
23
51
  const CustomTableContainer = (props) => {
24
52
  const { children, themeConfig, className } = props;
@@ -48,6 +76,36 @@ const CPIModal = ({
48
76
  const result = row.cpi_data;
49
77
  return result;
50
78
  });
79
+ const [selectedIds, setIds] = useState([]);
80
+ const [selectAll, setSelectAll] = useState(false);
81
+
82
+ const wrapperConfig = {
83
+ container: 'buttons',
84
+ size: 'xl',
85
+ clsName: 'container_header',
86
+ items: [
87
+ {
88
+ participantIds: data,
89
+ title: 'ADD ALL FILES FOR PARTICIPANT',
90
+ clsName: 'add_all_button',
91
+ role: 'ADD_ALL_FILES',
92
+ btnType: 'ADD_ALL_FILES',
93
+ tooltipCofig: tooltipContentAddAll,
94
+ conditional: false,
95
+ alertMessage: 'The cart is limited to 200,000 files. Please narrow the search criteria or remove some files from the cart to add more.',
96
+ },
97
+ {
98
+ participantIds: selectedIds,
99
+ title: 'ADD SELECTED FILES FOR PARTICIPANT',
100
+ clsName: 'add_selected_button',
101
+ role: 'ADD_SELECTED_FILES',
102
+ btnType: 'ADD_SELECTED_FILES',
103
+ tooltipCofig: tooltipContent,
104
+ conditional: true,
105
+ alertMessage: 'The cart is limited to 200,000 files. Please narrow the search criteria or remove some files from the cart to add more.',
106
+ },
107
+ ],
108
+ };
51
109
 
52
110
  const sortingData = (column, newOrder) => {
53
111
  const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
@@ -58,6 +116,32 @@ const CPIModal = ({
58
116
  return sortedData;
59
117
  };
60
118
 
119
+ const handleSelectAll = () => {
120
+ if (selectAll) {
121
+ setSelectAll(false);
122
+ setIds([]);
123
+ } else {
124
+ setSelectAll(true);
125
+ let toAdd = [];
126
+
127
+ data.forEach((e) => {
128
+ if (e.data_type === 'internal' && e.p_id) {
129
+ toAdd = toAdd.concat(e.p_id);
130
+ }
131
+ });
132
+ setIds(toAdd);
133
+ }
134
+ };
135
+
136
+ const handleSelect = (id) => {
137
+ if (selectedIds.indexOf(id) !== -1) {
138
+ setIds(selectedIds.filter((e) => e !== id));
139
+ } else {
140
+ const toAdd = selectedIds.concat(id);
141
+ setIds(toAdd);
142
+ }
143
+ };
144
+
61
145
  const handleSortByColumn = (column, order) => {
62
146
  const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
63
147
  const newData = sortingData(column, newOrder);
@@ -66,6 +150,47 @@ const CPIModal = ({
66
150
  setSortOrder(newOrder);
67
151
  };
68
152
 
153
+ const buttonContainer = {
154
+ display: 'flex',
155
+ justifyContent: 'center',
156
+ padding: '10px',
157
+ };
158
+
159
+ const addAllFilesButton = {
160
+ width: '174px',
161
+ height: '41px',
162
+ borderRadius: '5px',
163
+ backgroundColor: '#536D70',
164
+ fontFamily: 'Poppins',
165
+ fontWeight: '600',
166
+ fontSize: '12px',
167
+ color: 'white',
168
+ lineHeight: '14px',
169
+ };
170
+
171
+ const addSelectedFilesButton = {
172
+ width: '174px',
173
+ height: '41px',
174
+ borderRadius: '5px',
175
+ backgroundColor: selectedIds.length ? '#2A6E93' : '#B3D6EA',
176
+ fontFamily: 'Poppins',
177
+ fontWeight: '600',
178
+ fontSize: '12px',
179
+ color: 'white',
180
+ lineHeight: '14px',
181
+ };
182
+
183
+ const goToCartButton = {
184
+ width: '174px',
185
+ height: '41px',
186
+ borderRadius: '5px',
187
+ backgroundColor: '#5666BD',
188
+ fontFamily: 'Poppins',
189
+ fontWeight: '600',
190
+ fontSize: '12px',
191
+ color: 'white',
192
+ };
193
+
69
194
  const modalBody = {
70
195
  position: 'absolute',
71
196
  top: '5%',
@@ -108,6 +233,7 @@ const CPIModal = ({
108
233
  padding: '45px',
109
234
  paddingLeft: '35px',
110
235
  paddingRight: '20px',
236
+ borderTop: '1px solid #505050',
111
237
  };
112
238
 
113
239
  const link = {
@@ -205,6 +331,14 @@ const CPIModal = ({
205
331
  <Table>
206
332
  <TableHead>
207
333
  <TableRow>
334
+ <TableCell padding="checkbox">
335
+ <span style={{ display: 'none' }}>Select all</span>
336
+ <Checkbox
337
+ color="primary"
338
+ checked={selectAll}
339
+ onChange={() => handleSelectAll()}
340
+ />
341
+ </TableCell>
208
342
  {
209
343
  displayColumns.map((column) => (
210
344
  <HeaderCell
@@ -218,10 +352,18 @@ const CPIModal = ({
218
352
  }
219
353
  </TableRow>
220
354
  </TableHead>
221
- <TableBody>
355
+ <TableBody style={{ borderBottom: '3px solid rgb(147, 147, 147)' }}>
222
356
  {
223
357
  data.map((currRow) => (
224
358
  <TableRow>
359
+ <TableCell padding="checkbox">
360
+ <Checkbox
361
+ color="#2A6E93"
362
+ checked={selectedIds.includes(currRow.p_id)}
363
+ disabled={currRow.data_type === 'external'}
364
+ onChange={() => handleSelect(currRow.p_id)}
365
+ />
366
+ </TableCell>
225
367
  {
226
368
  displayColumns.map((column) => (
227
369
  (
@@ -237,6 +379,26 @@ const CPIModal = ({
237
379
  </TableBody>
238
380
  </Table>
239
381
  </CustomTableContainer>
382
+ <div style={buttonContainer}>
383
+ <AddFileButtonView
384
+ {...wrapperConfig.items[0]}
385
+ buttonStyle={addAllFilesButton}
386
+ rowID={row.id}
387
+ />
388
+ <AddFileButtonView
389
+ {...wrapperConfig.items[1]}
390
+ buttonStyle={addSelectedFilesButton}
391
+ rowID={row.id}
392
+ />
393
+ <NavLink to="/fileCentricCart">
394
+ <Button
395
+ style={goToCartButton}
396
+ >
397
+ GO TO CART
398
+ <img src={cartIcon} alt="cart" style={{ paddingLeft: '30px' }} />
399
+ </Button>
400
+ </NavLink>
401
+ </div>
240
402
  <div className="footer" style={footer}>
241
403
  All CPI mappings for a given study can be found in the "synonyms"
242
404
  tab of the downloadable manifest,
@@ -16,6 +16,7 @@ const CPIView = ({
16
16
  column,
17
17
  row,
18
18
  themeConfig,
19
+ navigation,
19
20
  }) => {
20
21
  const useStyles = makeStyles(() => ({
21
22
  arrow: {
@@ -77,6 +78,7 @@ const CPIView = ({
77
78
  open={modalOpen}
78
79
  onClose={handleModalClose}
79
80
  themeConfig={themeConfig}
81
+ navigation={navigation}
80
82
  />
81
83
  <Tooltip
82
84
  interactive
@@ -0,0 +1,3 @@
1
+ <svg width="25" height="23" viewBox="0 0 25 23" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M0.833638 0C0.373152 0 0 0.376655 0 0.841463C0 1.30627 0.373152 1.68293 0.833638 1.68293H3.49086L6.35649 15.3307C6.47013 15.8446 6.80358 16.2718 7.22487 16.2688H21.1188C21.5595 16.2748 21.9644 15.8721 21.9644 15.4273C21.9644 14.9826 21.5595 14.5794 21.1188 14.5859H7.9022L7.54592 12.9029H22.2304C22.6035 12.9004 22.9563 12.6129 23.0377 12.2458L24.9829 3.83116C25.091 3.34281 24.6712 2.80939 24.1755 2.80538H5.43651L4.98496 0.666659C4.90557 0.292509 4.5468 0 4.16819 0H0.833638ZM5.78337 4.4878H10.1252L10.5421 7.01219H6.31283L5.78337 4.4878ZM11.8272 4.4878H17.0722L16.6554 7.01219H12.2441L11.8272 4.4878ZM18.7742 4.4878H23.125L22.543 7.01219H18.3574L18.7742 4.4878ZM6.66911 8.69512H10.8199L11.2368 11.2195H7.19857L6.66911 8.69512ZM12.5219 8.69512H16.3775L15.9607 11.2195H12.9388L12.5219 8.69512ZM18.0795 8.69512H22.152L21.5699 11.2195H17.6622L18.079 8.69512H18.0795ZM10.2815 17.3902C8.75668 17.3902 7.50275 18.6559 7.50275 20.1951C7.50275 21.7343 8.75668 23 10.2815 23C11.8064 23 13.0603 21.7343 13.0603 20.1951C13.0603 18.6559 11.8064 17.3902 10.2815 17.3902ZM18.0622 17.3902C16.5373 17.3902 15.2834 18.6559 15.2834 20.1951C15.2834 21.7343 16.5373 23 18.0622 23C19.587 23 20.841 21.7343 20.841 20.1951C20.841 18.6559 19.587 17.3902 18.0622 17.3902ZM10.2815 19.0732C10.9053 19.0732 11.3931 19.5655 11.3931 20.1951C11.3931 20.8247 10.9053 21.3171 10.2815 21.3171C9.6578 21.3171 9.17002 20.8247 9.17002 20.1951C9.17002 19.5655 9.6578 19.0732 10.2815 19.0732ZM18.0622 19.0732C18.6859 19.0732 19.1737 19.5655 19.1737 20.1951C19.1737 20.8247 18.6859 21.3171 18.0622 21.3171C17.4384 21.3171 16.9506 20.8247 16.9506 20.1951C16.9506 19.5655 17.4384 19.0732 18.0622 19.0732Z" fill="white"/>
3
+ </svg>
@@ -0,0 +1,4 @@
1
+ <svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <circle cx="6.5" cy="6.5" r="6.5" fill="#6A6A6A"/>
3
+ <path d="M4.293 3.602C4.414 3.492 4.546 3.38933 4.689 3.294C4.832 3.19867 4.986 3.11433 5.151 3.041C5.31967 2.96767 5.50117 2.91083 5.6955 2.8705C5.8935 2.8265 6.10617 2.8045 6.3335 2.8045C6.63783 2.8045 6.9165 2.8485 7.1695 2.9365C7.42617 3.02083 7.64617 3.14367 7.8295 3.305C8.0165 3.46267 8.16133 3.65517 8.264 3.8825C8.36667 4.10617 8.418 4.35733 8.418 4.636C8.418 4.91467 8.37767 5.15667 8.297 5.362C8.21633 5.56367 8.11367 5.73967 7.989 5.89C7.86433 6.04033 7.72867 6.17233 7.582 6.286C7.43533 6.396 7.296 6.5005 7.164 6.5995C7.03567 6.69483 6.92383 6.792 6.8285 6.891C6.73683 6.98633 6.68183 7.09267 6.6635 7.21L6.548 8.035H5.745L5.6625 7.1275C5.64417 6.95517 5.67167 6.80667 5.745 6.682C5.81833 6.55733 5.9155 6.44 6.0365 6.33C6.16117 6.22 6.29683 6.1155 6.4435 6.0165C6.59383 5.91383 6.73317 5.80017 6.8615 5.6755C6.98983 5.55083 7.098 5.4115 7.186 5.2575C7.274 5.1035 7.318 4.91833 7.318 4.702C7.318 4.559 7.2905 4.43067 7.2355 4.317C7.1805 4.19967 7.1035 4.10067 7.0045 4.02C6.9055 3.93933 6.79 3.877 6.658 3.833C6.526 3.789 6.383 3.767 6.229 3.767C6.01267 3.767 5.82933 3.79267 5.679 3.844C5.52867 3.89533 5.40033 3.95217 5.294 4.0145C5.18767 4.07317 5.09967 4.12817 5.03 4.1795C4.96033 4.22717 4.90167 4.251 4.854 4.251C4.74033 4.251 4.656 4.2015 4.601 4.1025L4.293 3.602ZM5.349 10.1305C5.349 10.0242 5.36733 9.92517 5.404 9.8335C5.44433 9.73817 5.4975 9.65567 5.5635 9.586C5.63317 9.51633 5.71383 9.46133 5.8055 9.421C5.90083 9.38067 6.00167 9.3605 6.108 9.3605C6.21433 9.3605 6.31333 9.38067 6.405 9.421C6.50033 9.46133 6.58283 9.51633 6.6525 9.586C6.72217 9.65567 6.77717 9.73817 6.8175 9.8335C6.85783 9.92517 6.878 10.0242 6.878 10.1305C6.878 10.2405 6.85783 10.3413 6.8175 10.433C6.77717 10.5247 6.72217 10.6053 6.6525 10.675C6.58283 10.7447 6.50033 10.7978 6.405 10.8345C6.31333 10.8748 6.21433 10.895 6.108 10.895C6.00167 10.895 5.90083 10.8748 5.8055 10.8345C5.71383 10.7978 5.63317 10.7447 5.5635 10.675C5.4975 10.6053 5.44433 10.5247 5.404 10.433C5.36733 10.3413 5.349 10.2405 5.349 10.1305Z" fill="white"/>
4
+ </svg>
@@ -120,14 +120,14 @@ const DownloadButton = ({
120
120
 
121
121
  const useStyles = makeStyles({
122
122
  dropdown: {
123
- width: '60px',
124
- height: '25px',
125
- marginTop: '8px',
123
+ width: '48px',
124
+ height: '36px',
126
125
  paddingLeft: '5px',
127
126
  border: '0.75px solid #606060',
128
127
  borderRadius: '5px',
129
128
  display: 'inline-block',
130
129
  position: 'relative',
130
+ marginTop: '2px',
131
131
  },
132
132
  dropdownList: {
133
133
  display: 'block',
@@ -153,20 +153,23 @@ const DownloadButton = ({
153
153
  },
154
154
  },
155
155
  arrowdownIcon: {
156
- marginLeft: '5px',
157
156
  fill: '#606060',
157
+ marginTop: '2px',
158
158
  },
159
159
  arrowdownIconDisabled: {
160
160
  marginLeft: '5px',
161
161
  fill: '#00000042',
162
162
  },
163
+ tooltip: {
164
+ marginTop: '5px',
165
+ },
163
166
  });
164
167
 
165
168
  const classes = useStyles();
166
169
 
167
170
  return (
168
171
  <div className={classes.dropdown}>
169
- <Tooltip title="Download filtered results">
172
+ <Tooltip title="Download filtered results" className={classes.tooltip}>
170
173
  {
171
174
  count !== 0
172
175
  ? (
@@ -1,6 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
  import {
3
3
  Checkbox,
4
+ FormControlLabel,
4
5
  IconButton,
5
6
  List,
6
7
  ListItem,
@@ -8,38 +9,84 @@ import {
8
9
  Tooltip,
9
10
  Typography,
10
11
  withStyles,
12
+ Divider,
11
13
  } from '@material-ui/core';
12
14
  import {
13
- ViewColumn,
14
15
  CheckBox as CheckBoxIcon,
15
16
  CheckBoxOutlineBlank as CheckBoxBlankIcon,
16
17
  Close,
17
18
  } from '@material-ui/icons';
19
+ import KeyboardArrowDownOutlinedIcon from '@material-ui/icons/KeyboardArrowDownOutlined';
18
20
  import { cellTypes } from '../util/Types';
21
+ import viewColumnsIcon from './assets/View_Columns.svg';
22
+ import hiddenColumnsIcon from './assets/Hidden_Column.svg';
19
23
 
20
24
  const ManageColumnView = ({
21
25
  table,
22
26
  onColumnViewChange,
27
+ onAllColumnViewChange,
23
28
  manageViewColumns,
24
29
  }) => {
25
30
  if (!manageViewColumns) {
26
31
  return null;
27
32
  }
33
+ const { columns } = table;
28
34
  const [anchorEl, setAnchorEl] = useState(null);
35
+ const [selectAll, setSelectAll] = useState(false);
36
+
37
+ const viewColumns = columns.filter((col) => col.role === cellTypes.DISPLAY);
38
+
29
39
  const handleClick = (event) => {
30
40
  setAnchorEl(event.currentTarget);
31
41
  };
32
42
 
33
43
  const handleClose = () => setAnchorEl(null);
34
44
 
45
+ const handleSelectAll = () => {
46
+ const state = selectAll;
47
+ setSelectAll(!selectAll);
48
+ onAllColumnViewChange(!state);
49
+ };
50
+
51
+ const columnDropdown = {
52
+ width: '48px',
53
+ height: '36px',
54
+ paddingLeft: '5px',
55
+ border: '0.75px solid #606060',
56
+ borderRadius: '5px',
57
+ display: 'inline-flex',
58
+ position: 'relative',
59
+ marginTop: '2px',
60
+ marginRight: '7px',
61
+ };
62
+
63
+ const displayColumnStyle = {
64
+ position: 'relative',
65
+ right: '20px',
66
+ bottom: '15px',
67
+ scale: '0.5',
68
+ };
69
+
70
+ const viewColumnsStyle = {
71
+ marginTop: '6px',
72
+ height: '24px',
73
+ right: '37px',
74
+ };
75
+
76
+ const arrowdownIcon = {
77
+ fill: '#606060',
78
+ };
79
+
35
80
  const open = Boolean(anchorEl);
36
- const { columns } = table;
37
- const viewColumns = columns.filter((col) => col.role === cellTypes.DISPLAY && col.hideable);
38
81
  return (
39
- <>
82
+ <div style={columnDropdown}>
83
+ <Tooltip title="Columns may be hidden">
84
+ <img src={hiddenColumnsIcon} alt="hiddenColumnsIcon" style={displayColumnStyle} />
85
+ </Tooltip>
40
86
  <Tooltip title={manageViewColumns.title}>
41
- <IconButton variant="contained" onClick={handleClick} style={{ marginLeft: '10px', marginTop: '9px', height: '24px' }}>
42
- <ViewColumn />
87
+ <IconButton variant="contained" onClick={handleClick} style={viewColumnsStyle}>
88
+ <img src={viewColumnsIcon} alt="viewColumnsIcon" />
89
+ <KeyboardArrowDownOutlinedIcon style={arrowdownIcon} />
43
90
  </IconButton>
44
91
  </Tooltip>
45
92
  <Popover
@@ -67,33 +114,73 @@ const ManageColumnView = ({
67
114
  width={1}
68
115
  className="viewColumnListItem"
69
116
  >
70
- <Checkbox
71
- icon={(
72
- <CheckBoxBlankIcon
73
- style={{ fontSize: 18 }}
74
- className="checkBoxIcon"
75
- />
76
- )}
77
- onClick={() => onColumnViewChange(column)}
78
- checked={column.display}
79
- checkedIcon={(
80
- <CheckBoxIcon
81
- style={{
82
- fontSize: 18,
83
- }}
84
- className="checkBoxIcon"
117
+ <FormControlLabel
118
+ control={(
119
+ <Checkbox
120
+ icon={(
121
+ <CheckBoxBlankIcon
122
+ style={{ fontSize: 18 }}
123
+ className="checkBoxIcon"
124
+ />
125
+ )}
126
+ onClick={() => onColumnViewChange(column)}
127
+ checked={column.display}
128
+ checkedIcon={(
129
+ <CheckBoxIcon
130
+ style={{
131
+ fontSize: 18,
132
+ color: column.hideable ? 'rgba(11, 53, 86, 1)' : 'rgba(11, 53, 86, 0.38)',
133
+ }}
134
+ className="checkBoxIcon"
135
+ />
136
+ )}
137
+ disableRipple
138
+ color="secondary"
139
+ className="checkBox"
140
+ disabled={!column.hideable}
85
141
  />
86
142
  )}
87
- disableRipple
88
- color="secondary"
89
- className="checkBox"
143
+ disabled={!column.hideable}
144
+ label={column.header}
90
145
  />
91
- <Typography>{column.header}</Typography>
92
146
  </ListItem>
93
147
  ))}
148
+ <Divider style={{ color: '#375F9A', marginTop: '5px', marginBottom: '5px' }} />
149
+ <ListItem
150
+ width={1}
151
+ className="viewColumnListItem"
152
+ >
153
+ <FormControlLabel
154
+ control={(
155
+ <Checkbox
156
+ icon={(
157
+ <CheckBoxBlankIcon
158
+ style={{ fontSize: 18 }}
159
+ className="checkBoxIcon"
160
+ />
161
+ )}
162
+ onClick={() => handleSelectAll()}
163
+ checked={selectAll}
164
+ checkedIcon={(
165
+ <CheckBoxIcon
166
+ style={{
167
+ fontSize: 18,
168
+ color: 'rgba(11, 53, 86, 1)',
169
+ }}
170
+ className="checkBoxIcon"
171
+ />
172
+ )}
173
+ disableRipple
174
+ color="secondary"
175
+ className="checkBox"
176
+ />
177
+ )}
178
+ label={selectAll ? 'Deselect All' : 'Select All'}
179
+ />
180
+ </ListItem>
94
181
  </List>
95
182
  </Popover>
96
- </>
183
+ </div>
97
184
  );
98
185
  };
99
186
 
@@ -0,0 +1,4 @@
1
+ <svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="10" y="0.928786" width="12.2783" height="12.2783" rx="2.5" transform="rotate(45 10 0.928786)" fill="#FFEB13" stroke="black"/>
3
+ <path d="M9.99994 7.14529C9.74072 7.14529 9.52354 7.06575 9.3484 6.90667C9.18026 6.74068 9.09619 6.53664 9.09619 6.29457C9.09619 6.05249 9.18026 5.85192 9.3484 5.69284C9.52354 5.52684 9.74072 5.44385 9.99994 5.44385C10.2592 5.44385 10.4728 5.52684 10.641 5.69284C10.8161 5.85192 10.9037 6.05249 10.9037 6.29457C10.9037 6.53664 10.8161 6.74068 10.641 6.90667C10.4728 7.06575 10.2592 7.14529 9.99994 7.14529ZM10.725 7.83001V13.5776H9.25382V7.83001H10.725Z" fill="black"/>
4
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg width="20" height="18" viewBox="0 0 20 18" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M2.88892 1.40607H17.1116C17.6636 1.40633 18.1116 1.85394 18.1116 2.40607V15.5936C18.1116 16.1457 17.6636 16.5933 17.1116 16.5936H2.88892C2.33663 16.5936 1.88892 16.1459 1.88892 15.5936V2.40607C1.88892 1.85378 2.33663 1.40607 2.88892 1.40607Z" fill="white" stroke="#606060" stroke-width="2"/>
3
+ <line x1="1.79956" y1="6.08969" x2="19.1106" y2="6.08969" stroke="#606060" stroke-width="2"/>
4
+ <line x1="13.2661" y1="7.09055" x2="13.2661" y2="17.5941" stroke="#606060" stroke-width="2"/>
5
+ <line x1="7.6936" y1="7.0903" x2="7.6936" y2="17.5939" stroke="#606060" stroke-width="2"/>
6
+ </svg>
@@ -0,0 +1,25 @@
1
+ /**
2
+ * query varibales to fetch all the selected files id
3
+ */
4
+ export const getQueryVariables = (variables) => {
5
+ const queryVariables = { ...variables };
6
+ queryVariables.first = 200000;
7
+ return queryVariables;
8
+ };
9
+
10
+ export const getFilesID = ({
11
+ client,
12
+ variables,
13
+ query,
14
+ }) => {
15
+ const queryVariables = getQueryVariables(variables);
16
+ return async function getFileIDs() {
17
+ const fetchResult = await client
18
+ .query({
19
+ query,
20
+ variables: queryVariables,
21
+ })
22
+ .then((response) => response.data);
23
+ return fetchResult;
24
+ };
25
+ };