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

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 (47) hide show
  1. package/dist/ExtendedView.js +2 -8
  2. package/dist/TableView.js +5 -9
  3. package/dist/body/CustomTblBody.js +2 -4
  4. package/dist/body/DisplayBodyCell.js +4 -8
  5. package/dist/body/components/CPIModal.js +15 -156
  6. package/dist/body/components/CPIView.js +4 -6
  7. package/dist/body/components/CustomLinkView.js +1 -1
  8. package/dist/header/CustomTblHeader.js +3 -5
  9. package/dist/pagination/CustomPagination.js +2 -7
  10. package/package.json +2 -8
  11. package/src/ExtendedView.js +6 -15
  12. package/src/TableView.js +5 -11
  13. package/src/body/CustomTblBody.js +0 -2
  14. package/src/body/DisplayBodyCell.js +0 -4
  15. package/src/body/components/CPIModal.js +12 -165
  16. package/src/body/components/CPIView.js +2 -10
  17. package/src/body/components/CustomLinkView.js +1 -1
  18. package/src/header/CustomTblHeader.js +1 -6
  19. package/src/pagination/CustomPagination.js +0 -2
  20. package/dist/body/components/assets/Cart_Icon.svg +0 -3
  21. package/dist/body/components/assets/Question_Icon.svg +0 -4
  22. package/dist/wrapper/WrapperService.js +0 -36
  23. package/dist/wrapper/components/AddFiles.js +0 -63
  24. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +0 -35
  25. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogController.js +0 -36
  26. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogView.js +0 -43
  27. package/dist/wrapper/components/CPIFilesView/CPIFilesView.js +0 -178
  28. package/dist/wrapper/components/ReduxAddFile.js +0 -27
  29. package/dist/wrapper/components/Snackbar/Snackbar.js +0 -40
  30. package/dist/wrapper/components/Snackbar/SnackbarRedux.js +0 -16
  31. package/dist/wrapper/components/Snackbar/SuccessOutlined.js +0 -17
  32. package/dist/wrapper/components/TextFieldView.js +0 -37
  33. package/dist/wrapper/components/TooltipView.js +0 -40
  34. package/src/body/components/assets/Cart_Icon.svg +0 -3
  35. package/src/body/components/assets/Question_Icon.svg +0 -4
  36. package/src/wrapper/WrapperService.js +0 -25
  37. package/src/wrapper/components/AddFiles.js +0 -62
  38. package/src/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +0 -37
  39. package/src/wrapper/components/AddToCartDialog/AddToCartDialogController.js +0 -32
  40. package/src/wrapper/components/AddToCartDialog/AddToCartDialogView.js +0 -57
  41. package/src/wrapper/components/CPIFilesView/CPIFilesView.js +0 -190
  42. package/src/wrapper/components/ReduxAddFile.js +0 -20
  43. package/src/wrapper/components/Snackbar/Snackbar.js +0 -43
  44. package/src/wrapper/components/Snackbar/SnackbarRedux.js +0 -11
  45. package/src/wrapper/components/Snackbar/SuccessOutlined.js +0 -10
  46. package/src/wrapper/components/TextFieldView.js +0 -32
  47. package/src/wrapper/components/TooltipView.js +0 -35
@@ -1,8 +1,6 @@
1
1
  import React, { useState } from 'react';
2
- import { NavLink } from 'react-router-dom';
3
2
  import {
4
3
  Box,
5
- Checkbox,
6
4
  Modal,
7
5
  Typography,
8
6
  IconButton,
@@ -14,7 +12,6 @@ import {
14
12
  TableRow,
15
13
  TableCell,
16
14
  TableBody,
17
- Button,
18
15
  } from '@material-ui/core';
19
16
  // import CustomTableBody from '../../body/CustomTblBody';
20
17
  import CloseIcon from '@material-ui/icons/Close';
@@ -22,36 +19,11 @@ import { withStyles } from '@material-ui/core/styles';
22
19
  import styles from './ModalStyle';
23
20
  // import TableHeader from '../../header/CustomTblHeader';
24
21
  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
- };
50
22
 
51
23
  const CustomTableContainer = (props) => {
52
24
  const { children, themeConfig, className } = props;
53
25
  const tableStyle = {
54
- height: '450px',
26
+ height: '470px',
55
27
  overflowX: 'hidden',
56
28
  };
57
29
  return (
@@ -76,36 +48,6 @@ const CPIModal = ({
76
48
  const result = row.cpi_data;
77
49
  return result;
78
50
  });
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
- };
109
51
 
110
52
  const sortingData = (column, newOrder) => {
111
53
  const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
@@ -116,32 +58,6 @@ const CPIModal = ({
116
58
  return sortedData;
117
59
  };
118
60
 
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
-
145
61
  const handleSortByColumn = (column, order) => {
146
62
  const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
147
63
  const newData = sortingData(column, newOrder);
@@ -150,47 +66,6 @@ const CPIModal = ({
150
66
  setSortOrder(newOrder);
151
67
  };
152
68
 
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
-
194
69
  const modalBody = {
195
70
  position: 'absolute',
196
71
  top: '5%',
@@ -230,7 +105,9 @@ const CPIModal = ({
230
105
  fontFamily: 'Nunito',
231
106
  fontSize: '16px',
232
107
  fontWeight: '400',
233
- borderTop: '1px solid #505050',
108
+ padding: '45px',
109
+ paddingLeft: '35px',
110
+ paddingRight: '20px',
234
111
  };
235
112
 
236
113
  const link = {
@@ -238,6 +115,9 @@ const CPIModal = ({
238
115
  fontFamily: 'Nunito',
239
116
  fontSize: '16px',
240
117
  fontWeight: '700',
118
+ position: 'relative',
119
+ top: '11.5px',
120
+ right: '39px',
241
121
  };
242
122
 
243
123
  const modalTitle = {
@@ -325,14 +205,6 @@ const CPIModal = ({
325
205
  <Table>
326
206
  <TableHead>
327
207
  <TableRow>
328
- <TableCell padding="checkbox">
329
- <span style={{ display: 'none' }}>Select all</span>
330
- <Checkbox
331
- color="primary"
332
- checked={selectAll}
333
- onChange={() => handleSelectAll()}
334
- />
335
- </TableCell>
336
208
  {
337
209
  displayColumns.map((column) => (
338
210
  <HeaderCell
@@ -346,18 +218,10 @@ const CPIModal = ({
346
218
  }
347
219
  </TableRow>
348
220
  </TableHead>
349
- <TableBody style={{ borderBottom: '3px solid rgb(147, 147, 147)' }}>
221
+ <TableBody>
350
222
  {
351
223
  data.map((currRow) => (
352
224
  <TableRow>
353
- <TableCell padding="checkbox">
354
- <Checkbox
355
- color="#2A6E93"
356
- checked={selectedIds.includes(currRow.p_id)}
357
- disabled={currRow.data_type === 'external'}
358
- onChange={() => handleSelect(currRow.p_id)}
359
- />
360
- </TableCell>
361
225
  {
362
226
  displayColumns.map((column) => (
363
227
  (
@@ -373,28 +237,11 @@ const CPIModal = ({
373
237
  </TableBody>
374
238
  </Table>
375
239
  </CustomTableContainer>
376
- <div style={buttonContainer}>
377
- <AddFileButtonView
378
- {...wrapperConfig.items[0]}
379
- buttonStyle={addAllFilesButton}
380
- rowID={row.id}
381
- />
382
- <AddFileButtonView
383
- {...wrapperConfig.items[1]}
384
- buttonStyle={addSelectedFilesButton}
385
- rowID={row.id}
386
- />
387
- <NavLink to="/fileCentricCart">
388
- <Button
389
- style={goToCartButton}
390
- >
391
- GO TO CART
392
- <img src={cartIcon} alt="cart" style={{ paddingLeft: '30px' }} />
393
- </Button>
394
- </NavLink>
395
- </div>
396
240
  <div className="footer" style={footer}>
397
- To learn more about CPI click&nbsp;
241
+ All CPI mappings for a given study can be found in the "synonyms"
242
+ tab of the downloadable manifest,
243
+ available under the "Studies" tab in the Explore Dashboard.
244
+ For more information about CPI, click&nbsp;
398
245
  <a style={link} href="https://participantindex-docs.ccdi.cancer.gov/" target="_blank" rel="noopener noreferrer">here</a>
399
246
  </div>
400
247
  </Box>
@@ -16,7 +16,6 @@ const CPIView = ({
16
16
  column,
17
17
  row,
18
18
  themeConfig,
19
- navigation,
20
19
  }) => {
21
20
  const useStyles = makeStyles(() => ({
22
21
  arrow: {
@@ -78,7 +77,6 @@ const CPIView = ({
78
77
  open={modalOpen}
79
78
  onClose={handleModalClose}
80
79
  themeConfig={themeConfig}
81
- navigation={navigation}
82
80
  />
83
81
  <Tooltip
84
82
  interactive
@@ -97,10 +95,7 @@ const CPIView = ({
97
95
  (externalData.length && internalData.length === 0
98
96
  ? (
99
97
  <div>
100
- All CPI mappings for a given study can be found
101
- in the "synonyms" tab of the downloadable manifest,
102
- available under the "Studies" tab in the Explore Dashboard.
103
- For more information about CPI, click
98
+ All mapped identifiers in the CCDI Participant Index (CPI) are available
104
99
  <span role="button" onClick={handleModalOpen} tabIndex={0} style={button}>here.</span>
105
100
  </div>
106
101
  )
@@ -111,10 +106,7 @@ const CPIView = ({
111
106
  <div>{`${e.associated_id}, ${e.repository_of_synonym_id}`}</div>
112
107
  ))}
113
108
  <p>
114
- All CPI mappings for a given study can be found
115
- in the "synonyms" tab of the downloadable manifest,
116
- available under the "Studies" tab in the Explore Dashboard.
117
- For more information about CPI, click
109
+ All mapped identifiers in the CCDI Participant Index (CPI) are available
118
110
  <span role="button" onClick={handleModalOpen} tabIndex={0} style={button}>here.</span>
119
111
  </p>
120
112
  </div>
@@ -12,7 +12,7 @@ const CustomLinkView = ({
12
12
  row,
13
13
  }) => {
14
14
  const { rootPath, pathParams } = column?.linkAttr;
15
- const url = pathParams.map((attr) => `${rootPath}/`.concat(row[attr]));
15
+ const url = pathParams.map((attr) => `#${rootPath}/`.concat(row[attr]));
16
16
  return (
17
17
  <Link href={url} className={cellTypes.LINK}>
18
18
  <Typography>
@@ -37,7 +37,6 @@ const CustomTableHeader = ({
37
37
  */
38
38
  // const rootClsName = getClsName(table.title, tableCls.HEADER);
39
39
  const themeConfig = createTheme({ overrides: { ...defaultTheme(), ...customTheme } });
40
-
41
40
  return (
42
41
  <ThemeProvider theme={themeConfig}>
43
42
  <TableHead>
@@ -67,11 +66,7 @@ const CustomTableHeader = ({
67
66
  sortBy={sortBy}
68
67
  sortOrder={sortOrder}
69
68
  toggleSort={() => sortByColumn(column.dataField, sortOrder)}
70
- style={{
71
- minWidth: column.dataField === 'participant_id' ? '230px' : '',
72
- width: column.dataField === 'study_name' ? '325px' : '',
73
- textWrapMode: 'nowrap',
74
- }}
69
+ style={column.dataField === 'participant_id' ? { minWidth: '230px' } : {}}
75
70
  />
76
71
  );
77
72
  })
@@ -41,7 +41,6 @@ const CustomPagination = ({
41
41
  onPageChange,
42
42
  onRowsPerPageChange,
43
43
  customTheme = {},
44
- hasExport = true,
45
44
  }) => (
46
45
  <ThemeProvider theme={createTheme({ overrides: { ...defaultTheme, ...customTheme } })}>
47
46
  <TablePagination
@@ -58,7 +57,6 @@ const CustomPagination = ({
58
57
  IconComponent: KeyboardArrowDownOutlinedIcon,
59
58
  inputProps: { 'aria-label': 'Selection dropdown for displaying the number of results per page' },
60
59
  }}
61
- style={!hasExport ? { position: 'relative', left: '50px' } : {}}
62
60
  />
63
61
  </ThemeProvider>
64
62
  );
@@ -1,3 +0,0 @@
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>
@@ -1,4 +0,0 @@
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>
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getQueryVariables = exports.getFilesID = void 0;
7
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
10
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
11
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
- /**
13
- * query varibales to fetch all the selected files id
14
- */
15
- const getQueryVariables = variables => {
16
- const queryVariables = _objectSpread({}, variables);
17
- queryVariables.first = 200000;
18
- return queryVariables;
19
- };
20
- exports.getQueryVariables = getQueryVariables;
21
- const getFilesID = _ref => {
22
- let {
23
- client,
24
- variables,
25
- query
26
- } = _ref;
27
- const queryVariables = getQueryVariables(variables);
28
- return async function getFileIDs() {
29
- const fetchResult = await client.query({
30
- query,
31
- variables: queryVariables
32
- }).then(response => response.data);
33
- return fetchResult;
34
- };
35
- };
36
- exports.getFilesID = getFilesID;
@@ -1,63 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.btnTypes = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _client = require("@apollo/client");
9
- var _CPIFilesView = _interopRequireDefault(require("./CPIFilesView/CPIFilesView"));
10
- var _Snackbar = _interopRequireDefault(require("./Snackbar/Snackbar"));
11
- var _AddToCartDialogAlertView = _interopRequireDefault(require("./AddToCartDialog/AddToCartDialogAlertView"));
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
- const btnTypes = {
17
- ADD_ALL_FILES: 'ADD_ALL_FILES',
18
- ADD_SELECTED_FILES: 'ADD_SELECTED_FILES',
19
- DOWNLOAD_MANIFEST: 'DOWNLOAD_MANIFEST'
20
- };
21
- /**
22
- * customize button based on configuration
23
- * refer config table (wrapper component config)
24
- */
25
- exports.btnTypes = btnTypes;
26
- const AddFilesView = props => {
27
- const {
28
- count,
29
- alertMessage,
30
- cartFiles,
31
- buttonStyle
32
- } = props;
33
- /**
34
- * snackbar state
35
- */
36
- const [openSnackbar, setOpenSnackbar] = (0, _react.useState)(false);
37
-
38
- /**
39
- * conditionally display max file Alter/Error dialog view
40
- */
41
- const [displayAlter, setAlterDisplay] = (0, _react.useState)(false);
42
- /**
43
- * acess bento app client via ApolloProvider
44
- */
45
- const client = (0, _client.useApolloClient)();
46
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CPIFilesView.default, _extends({}, props, {
47
- client: client,
48
- setAlterDisplay: setAlterDisplay,
49
- setOpenSnackbar: setOpenSnackbar,
50
- cartFiles: cartFiles,
51
- buttonStyle: buttonStyle
52
- })), /*#__PURE__*/_react.default.createElement(_Snackbar.default, {
53
- open: openSnackbar,
54
- count: count,
55
- onClose: () => setOpenSnackbar(false)
56
- }), displayAlter && /*#__PURE__*/_react.default.createElement(_AddToCartDialogAlertView.default, {
57
- alertMessage: alertMessage,
58
- open: displayAlter,
59
- onClose: () => setAlterDisplay(false)
60
- }));
61
- };
62
- var _default = AddFilesView;
63
- exports.default = _default;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _core = require("@material-ui/core");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- function AddToCartDialogAlertView(props) {
11
- const {
12
- open,
13
- onClose,
14
- alertMessage
15
- } = props;
16
- const closeAlertModelTimer = 4000;
17
- const AlertDialog = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.Dialog, {
18
- open: open,
19
- "aria-labelledby": "alert-dialog-title",
20
- "aria-describedby": "alert-dialog-description"
21
- }, /*#__PURE__*/_react.default.createElement(_core.DialogContent, {
22
- className: "alter-content"
23
- }, /*#__PURE__*/_react.default.createElement(_core.DialogContentText, {
24
- id: "alert-dialog-description"
25
- }, alertMessage))));
26
- if (open) {
27
- // close the Dialog after 3 seconds.
28
- setTimeout(() => {
29
- onClose();
30
- }, closeAlertModelTimer);
31
- }
32
- return AlertDialog;
33
- }
34
- var _default = AddToCartDialogAlertView;
35
- exports.default = _default;
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _AddToCartDialogView = _interopRequireDefault(require("./AddToCartDialogView"));
9
- var _AddToCartDialogAlertView = _interopRequireDefault(require("./AddToCartDialogAlertView"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- const AddToCartDialogController = props => {
12
- const [open, setOpen] = _react.default.useState(false);
13
- const handleClose = () => {
14
- setOpen(false);
15
- };
16
- const {
17
- cartWillFull = false,
18
- numberOfFilesSelected,
19
- onYesClick,
20
- onNoClick
21
- } = props;
22
- if (cartWillFull) {
23
- return /*#__PURE__*/_react.default.createElement(_AddToCartDialogAlertView.default, {
24
- open: open,
25
- onClose: handleClose
26
- });
27
- }
28
- return /*#__PURE__*/_react.default.createElement(_AddToCartDialogView.default, {
29
- open: open,
30
- numberOfFilesSelected: numberOfFilesSelected,
31
- onYesClick: onYesClick,
32
- onNoClick: onNoClick
33
- });
34
- };
35
- var _default = AddToCartDialogController;
36
- exports.default = _default;
@@ -1,43 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _core = require("@material-ui/core");
9
- var _AddToCartDialogAlertView = _interopRequireDefault(require("./AddToCartDialogAlertView"));
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
- function AddToCartDialogView(props) {
12
- const {
13
- open,
14
- numberOfFilesSelected,
15
- onYesClick,
16
- onNoClick,
17
- cartWillFull = false,
18
- alertMessage,
19
- dialogText
20
- } = props;
21
- if (cartWillFull) {
22
- return /*#__PURE__*/_react.default.createElement(_AddToCartDialogAlertView.default, {
23
- alertMessage: alertMessage,
24
- open: open,
25
- onClose: () => onNoClick()
26
- });
27
- }
28
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.Dialog, {
29
- open: open,
30
- "aria-labelledby": "alert-dialog-title",
31
- "aria-describedby": "alert-dialog-description"
32
- }, /*#__PURE__*/_react.default.createElement(_core.DialogContent, null, /*#__PURE__*/_react.default.createElement(_core.DialogContentText, {
33
- id: "alert-dialog-description"
34
- }, dialogText, ' ', numberOfFilesSelected, ' ', "to cart")), /*#__PURE__*/_react.default.createElement(_core.DialogActions, null, /*#__PURE__*/_react.default.createElement(_core.Button, {
35
- className: "yesBtn",
36
- onClick: () => onYesClick()
37
- }, "Yes"), /*#__PURE__*/_react.default.createElement(_core.Button, {
38
- className: "noBtn",
39
- onClick: () => onNoClick()
40
- }, "No"))));
41
- }
42
- var _default = AddToCartDialogView;
43
- exports.default = _default;