@bento-core/table 1.0.1-ccdihub.99 → 1.0.1-ccdiintegrated.1

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 (55) hide show
  1. package/dist/ExtendedView.js +134 -7
  2. package/dist/TableView.js +23 -7
  3. package/dist/body/CustomTblBody.js +2 -1
  4. package/dist/body/DisplayBodyCell.js +18 -0
  5. package/dist/body/components/CPIMappingView.js +221 -0
  6. package/dist/body/components/CPIModal.js +434 -93
  7. package/dist/body/components/CPIView.js +64 -10
  8. package/dist/body/components/StudiesDataAvailabilityView.js +125 -0
  9. package/dist/body/components/assets/CPI_Icon_Dataset.svg +6 -0
  10. package/dist/body/components/assets/CPI_Icon_Multi.svg +6 -0
  11. package/dist/body/components/assets/CPI_Icon_Single.svg +4 -0
  12. package/dist/body/components/assets/CPI_Icon_Study.svg +11 -0
  13. package/dist/body/components/assets/Participant_Files.svg +17 -0
  14. package/dist/body/components/assets/Publications.svg +15 -0
  15. package/dist/body/components/assets/Sample_Files.svg +16 -0
  16. package/dist/body/components/assets/Study_Files.svg +21 -0
  17. package/dist/body/components/assets/download.svg +3 -0
  18. package/dist/header/CustomCell.js +4 -3
  19. package/dist/header/CustomTblHeader.js +16 -3
  20. package/dist/index.js +7 -0
  21. package/dist/toolbar/DownloadButtonView.js +30 -4
  22. package/dist/toolbar/SearchBar.js +92 -0
  23. package/dist/toolbar/assets/Search_Icon.svg +3 -0
  24. package/dist/util/Types.js +16 -4
  25. package/dist/wrapper/components/AddToCart/AddToCartView.js +126 -0
  26. package/dist/wrapper/components/AddToCart/ReduxAddToCart.js +27 -0
  27. package/dist/wrapper/components/Snackbar/Snackbar.js +5 -0
  28. package/package.json +25 -24
  29. package/src/ExtendedView.js +146 -7
  30. package/src/TableView.js +27 -8
  31. package/src/body/CustomTblBody.js +2 -1
  32. package/src/body/DisplayBodyCell.js +22 -0
  33. package/src/body/components/CPIMappingView.js +260 -0
  34. package/src/body/components/CPIModal.js +464 -101
  35. package/src/body/components/CPIView.js +75 -22
  36. package/src/body/components/StudiesDataAvailabilityView.js +121 -0
  37. package/src/body/components/assets/CPI_Icon_Dataset.svg +6 -0
  38. package/src/body/components/assets/CPI_Icon_Multi.svg +6 -0
  39. package/src/body/components/assets/CPI_Icon_Single.svg +4 -0
  40. package/src/body/components/assets/CPI_Icon_Study.svg +11 -0
  41. package/src/body/components/assets/Participant_Files.svg +17 -0
  42. package/src/body/components/assets/Publications.svg +15 -0
  43. package/src/body/components/assets/Sample_Files.svg +16 -0
  44. package/src/body/components/assets/Study_Files.svg +21 -0
  45. package/src/body/components/assets/download.svg +3 -0
  46. package/src/header/CustomCell.js +4 -3
  47. package/src/header/CustomTblHeader.js +13 -1
  48. package/src/index.js +1 -0
  49. package/src/toolbar/DownloadButtonView.js +20 -4
  50. package/src/toolbar/SearchBar.js +90 -0
  51. package/src/toolbar/assets/Search_Icon.svg +3 -0
  52. package/src/util/Types.js +10 -1
  53. package/src/wrapper/components/AddToCart/AddToCartView.js +132 -0
  54. package/src/wrapper/components/AddToCart/ReduxAddToCart.js +20 -0
  55. package/src/wrapper/components/Snackbar/Snackbar.js +1 -0
@@ -7,48 +7,204 @@ exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _core = require("@material-ui/core");
9
9
  var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
10
+ var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
11
+ var _ExpandLess = _interopRequireDefault(require("@material-ui/icons/ExpandLess"));
10
12
  var _styles = require("@material-ui/core/styles");
11
13
  var _ModalStyle = _interopRequireDefault(require("./ModalStyle"));
12
14
  var _CustomCell = _interopRequireDefault(require("../../header/CustomCell"));
13
15
  var _ReduxAddFile = _interopRequireDefault(require("../../wrapper/components/ReduxAddFile"));
14
16
  var _Question_Icon = _interopRequireDefault(require("./assets/Question_Icon.svg"));
15
- var _Cart_Icon = _interopRequireDefault(require("./assets/Cart_Icon.svg"));
17
+ var _download = _interopRequireDefault(require("./assets/download.svg"));
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
  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); }
18
20
  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; }
19
21
  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); }
20
- const tooltipContentAddAll = {
21
- tooltipText: 'Click button to add all Hub files associated with this participant to the cart.',
22
- icon: _Question_Icon.default,
23
- alt: 'tooltipIcon',
24
- Participants: 'Click button to add all files associated with the filtered row(s).',
25
- arrow: true,
26
- styles: {
27
- border: '#03A383 1px solid'
28
- }
29
- };
30
- const tooltipContent = {
31
- tooltipText: 'Click button to add all selected files associated with this participant to the cart.',
32
- icon: _Question_Icon.default,
33
- alt: 'tooltipIcon',
34
- Participants: 'Click button to add files associated with the selected row(s).',
35
- arrow: true,
36
- styles: {
37
- border: '#03A383 1px solid'
22
+ const useStyles = (0, _styles.makeStyles)(() => ({
23
+ button: {
24
+ width: '189px',
25
+ height: '41px',
26
+ alignSelf: 'end',
27
+ color: '#FFFFFF',
28
+ backgroundColor: '#2A6E93',
29
+ borderColor: '#2A6E93',
30
+ fontFamily: 'Poppins',
31
+ fontWeight: '600',
32
+ fontSize: '12px',
33
+ lineHeight: '13px',
34
+ display: 'flex',
35
+ justifyContent: 'flex-start',
36
+ alignItems: 'center',
37
+ padding: '0 12px',
38
+ borderRadius: '5px',
39
+ transition: 'border-radius 0.2s ease-in-out',
40
+ textAlign: 'left',
41
+ '&:hover': {
42
+ backgroundColor: '#245A7A'
43
+ },
44
+ '& .MuiButton-label': {
45
+ display: 'flex',
46
+ justifyContent: 'space-between',
47
+ alignItems: 'center',
48
+ width: '100%'
49
+ }
50
+ },
51
+ buttonOpen: {
52
+ borderBottomLeftRadius: '0',
53
+ borderBottomRightRadius: '0'
54
+ },
55
+ dropdownContainer: {
56
+ position: 'relative',
57
+ display: 'flex',
58
+ flexDirection: 'column',
59
+ alignItems: 'flex-end'
60
+ },
61
+ dropdown: {
62
+ position: 'absolute',
63
+ top: '100%',
64
+ right: 0,
65
+ zIndex: 10000,
66
+ marginTop: '-1px',
67
+ backgroundColor: 'white',
68
+ border: '1px solid #07679C',
69
+ borderTop: 'none',
70
+ borderRadius: '0 0 5px 5px',
71
+ boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.15)',
72
+ minWidth: '189px',
73
+ width: '189px',
74
+ transformOrigin: 'top',
75
+ animation: '$slideDown 0.2s ease-out'
76
+ },
77
+ '@keyframes slideDown': {
78
+ '0%': {
79
+ opacity: 0,
80
+ transform: 'translateY(-10px)'
81
+ },
82
+ '100%': {
83
+ opacity: 1,
84
+ transform: 'translateY(0)'
85
+ }
86
+ },
87
+ dropdownList: {
88
+ padding: 0,
89
+ margin: 0
90
+ },
91
+ dropdownItem: {
92
+ borderBottom: '1px solid #07679C',
93
+ padding: '0',
94
+ height: '41px',
95
+ minHeight: '41px',
96
+ display: 'flex',
97
+ alignItems: 'center',
98
+ '&:first-child': {
99
+ borderTop: '1px solid #07679C'
100
+ },
101
+ '&:last-child': {
102
+ borderBottom: 'none'
103
+ },
104
+ '&:hover': {
105
+ backgroundColor: '#DEE4EC'
106
+ },
107
+ '&:active': {
108
+ backgroundColor: '#e9ecef'
109
+ },
110
+ '&:not(:last-child)': {
111
+ borderBottom: '1px solid #07679C'
112
+ },
113
+ '& > div': {
114
+ width: '100%',
115
+ display: 'flex',
116
+ alignItems: 'center',
117
+ height: '100%'
118
+ },
119
+ '& button': {
120
+ width: '100% !important',
121
+ height: '41px !important',
122
+ borderRadius: '0 !important',
123
+ backgroundColor: 'transparent !important',
124
+ color: '#343434 !important',
125
+ fontFamily: 'Poppins !important',
126
+ fontWeight: '500 !important',
127
+ fontStyle: 'Medium !important',
128
+ fontSize: '12px !important',
129
+ lineHeight: '13px !important',
130
+ letterSpacing: '-0.02em !important',
131
+ textTransform: 'uppercase !important',
132
+ textAlign: 'left !important',
133
+ justifyContent: 'flex-start !important',
134
+ padding: '0 12px !important',
135
+ border: 'none !important',
136
+ boxShadow: 'none !important',
137
+ display: 'flex !important',
138
+ alignItems: 'center !important',
139
+ verticalAlign: 'middle !important',
140
+ '&:hover': {
141
+ backgroundColor: 'transparent !important'
142
+ }
143
+ }
144
+ },
145
+ dropdownItemText: {
146
+ '& .MuiListItemText-primary': {
147
+ fontFamily: 'Poppins',
148
+ fontWeight: '600',
149
+ fontSize: '12px',
150
+ color: '#07679C',
151
+ textTransform: 'uppercase',
152
+ letterSpacing: '0.5px'
153
+ }
154
+ },
155
+ questionIcon: {
156
+ width: '10px',
157
+ height: '10px',
158
+ position: 'absolute',
159
+ top: '3px',
160
+ right: '-12px',
161
+ cursor: 'pointer',
162
+ zIndex: 1
163
+ },
164
+ tooltipContent: {
165
+ fontFamily: 'Poppins',
166
+ fontWeight: 400,
167
+ fontStyle: 'Regular',
168
+ fontSize: '13px',
169
+ lineHeight: '17.5px',
170
+ letterSpacing: '-0.01em',
171
+ color: '#000000',
172
+ backgroundColor: '#FFFFFF',
173
+ border: '0.5px solid #000000',
174
+ borderRadius: '4px',
175
+ padding: '12px',
176
+ maxWidth: '400px'
177
+ },
178
+ tooltipIcon: {
179
+ width: '16px',
180
+ height: '11px',
181
+ marginRight: '8px',
182
+ verticalAlign: 'middle'
183
+ },
184
+ customTooltip: {
185
+ backgroundColor: '#FFFFFF !important',
186
+ color: '#000000 !important',
187
+ border: '0.5px solid #000000 !important',
188
+ borderRadius: '4px !important',
189
+ padding: '0 !important',
190
+ boxShadow: 'none !important',
191
+ '& .MuiTooltip-arrow': {
192
+ color: '#000000 !important'
193
+ }
38
194
  }
39
- };
195
+ }));
40
196
  const CustomTableContainer = props => {
41
197
  const {
42
198
  children,
43
- themeConfig,
44
199
  className
45
200
  } = props;
46
201
  const tableStyle = {
47
- height: '425px',
202
+ height: '450px',
48
203
  overflowX: 'hidden'
49
204
  };
205
+ const defaultTheme = (0, _styles.createTheme)();
50
206
  return /*#__PURE__*/_react.default.createElement(_core.ThemeProvider, {
51
- theme: themeConfig
207
+ theme: defaultTheme
52
208
  }, /*#__PURE__*/_react.default.createElement(_core.TableContainer, {
53
209
  className: className,
54
210
  id: "tableContainer",
@@ -58,21 +214,90 @@ const CustomTableContainer = props => {
58
214
  };
59
215
  const CPIModal = _ref => {
60
216
  let {
61
- classes,
62
217
  open,
63
218
  onClose,
64
219
  row,
65
- themeConfig = {},
66
220
  navigation
67
221
  } = _ref;
68
- const [sortBy, setSortBy] = (0, _react.useState)('associated_id');
69
- const [sortOrder, setSortOrder] = (0, _react.useState)('asc');
222
+ const classes = useStyles();
223
+ // const [sortBy, setSortBy] = useState('associated_id');
224
+ // const [sortOrder, setSortOrder] = useState('asc');
70
225
  const [data, setData] = (0, _react.useState)(row.cpi_data);
71
226
  const [selectedIds, setIds] = (0, _react.useState)([]);
72
227
  const [selectAll, setSelectAll] = (0, _react.useState)(false);
228
+ const [dropdownOpen, setDropdownOpen] = (0, _react.useState)(false);
229
+ const dropdownRef = (0, _react.useRef)(null);
230
+ const participantId = row.participant_id;
231
+ const studyId = row.study_id;
73
232
  (0, _react.useEffect)(() => {
74
- setData(row.cpi_data);
75
- }, [row]);
233
+ // Reset all state when row or open status changes
234
+ setData(row.cpi_data || []);
235
+ setIds([]);
236
+ setSelectAll(false);
237
+ setDropdownOpen(false);
238
+ }, [row, open]);
239
+ const handleDropdownToggle = () => {
240
+ setDropdownOpen(!dropdownOpen);
241
+ };
242
+ const displayColumns = [{
243
+ dataField: 'associated_id',
244
+ header: 'Participant ID',
245
+ // tooltipText: 'sort',
246
+ sortable: false
247
+ }, {
248
+ dataField: 'repository_of_synonym_id',
249
+ header: 'Name',
250
+ // tooltipText: 'sort',
251
+ sortable: false
252
+ }, {
253
+ dataField: 'domain_description',
254
+ header: 'Description',
255
+ // tooltipText: 'sort',
256
+ sortable: false
257
+ }, {
258
+ dataField: 'domain_category',
259
+ header: 'Category',
260
+ // tooltipText: 'sort',
261
+ sortable: false
262
+ }, {
263
+ dataField: 'data_location',
264
+ header: 'Location',
265
+ // tooltipText: 'sort',
266
+ sortable: false
267
+ }];
268
+ const handleDownloadCSV = () => {
269
+ // Use the same column order and headers as the table display
270
+ const csvColumnOrder = displayColumns;
271
+
272
+ // Get the table data using the same column order as table
273
+ const csvData = data.map(dataRow => csvColumnOrder.map(column => {
274
+ const value = dataRow[column.dataField];
275
+ // Escape commas and quotes in CSV
276
+ if (typeof value === 'string' && (value.includes(',') || value.includes('"') || value.includes('\n'))) {
277
+ return "\"".concat(value.replace(/"/g, '""'), "\"");
278
+ }
279
+ return value || '';
280
+ }));
281
+
282
+ // Create CSV headers using the same headers as table
283
+ const headers = csvColumnOrder.map(column => column.header).join(',');
284
+
285
+ // Create CSV content
286
+ const csvContent = [headers, ...csvData.map(csvRow => csvRow.join(','))].join('\n');
287
+
288
+ // Create and download the file
289
+ const blob = new Blob([csvContent], {
290
+ type: 'text/csv;charset=utf-8;'
291
+ });
292
+ const link = document.createElement('a');
293
+ const url = URL.createObjectURL(blob);
294
+ link.setAttribute('href', url);
295
+ link.setAttribute('download', "alternative_identifiers_".concat(participantId, "_").concat(studyId, ".csv"));
296
+ link.style.visibility = 'hidden';
297
+ document.body.appendChild(link);
298
+ link.click();
299
+ document.body.removeChild(link);
300
+ };
76
301
  const wrapperConfig = {
77
302
  container: 'buttons',
78
303
  size: 'xl',
@@ -83,7 +308,6 @@ const CPIModal = _ref => {
83
308
  clsName: 'add_all_button',
84
309
  role: 'ADD_ALL_FILES',
85
310
  btnType: 'ADD_ALL_FILES',
86
- tooltipCofig: tooltipContentAddAll,
87
311
  conditional: false,
88
312
  alertMessage: 'The cart is limited to 200,000 files. Please narrow the search criteria or remove some files from the cart to add more.'
89
313
  }, {
@@ -92,18 +316,20 @@ const CPIModal = _ref => {
92
316
  clsName: 'add_selected_button',
93
317
  role: 'ADD_SELECTED_FILES',
94
318
  btnType: 'ADD_SELECTED_FILES',
95
- tooltipCofig: tooltipContent,
96
319
  conditional: true,
320
+ disabled: selectedIds.length === 0,
97
321
  alertMessage: 'The cart is limited to 200,000 files. Please narrow the search criteria or remove some files from the cart to add more.'
98
322
  }]
99
323
  };
100
- const sortingData = (column, newOrder) => {
324
+
325
+ /* const sortingData = (column, newOrder) => {
101
326
  const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
102
- if (newOrder === 'desc') {
327
+ if (newOrder === 'desc') {
103
328
  return sortedData.reverse();
104
329
  }
105
330
  return sortedData;
106
- };
331
+ }; */
332
+
107
333
  const handleSelectAll = () => {
108
334
  if (selectAll) {
109
335
  setSelectAll(false);
@@ -127,17 +353,21 @@ const CPIModal = _ref => {
127
353
  setIds(toAdd);
128
354
  }
129
355
  };
130
- const handleSortByColumn = (column, order) => {
131
- const newOrder = order === 'asc' && sortBy === column ? 'desc' : 'asc';
356
+
357
+ /* const handleSortByColumn = (column, order) => {
358
+ const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
132
359
  const newData = sortingData(column, newOrder);
133
360
  setData(newData);
134
361
  setSortBy(column);
135
362
  setSortOrder(newOrder);
136
- };
363
+ }; */
364
+
137
365
  const buttonContainer = {
138
366
  display: 'flex',
139
367
  justifyContent: 'center',
140
- padding: '10px'
368
+ alignItems: 'center',
369
+ padding: '10px',
370
+ gap: '20px'
141
371
  };
142
372
  const addAllFilesButton = {
143
373
  width: '174px',
@@ -158,8 +388,10 @@ const CPIModal = _ref => {
158
388
  fontFamily: 'Poppins',
159
389
  fontWeight: '600',
160
390
  fontSize: '12px',
161
- color: 'white',
162
- lineHeight: '14px'
391
+ color: selectedIds.length ? 'white' : '#666666',
392
+ lineHeight: '14px',
393
+ opacity: selectedIds.length ? 1 : 0.6,
394
+ cursor: selectedIds.length ? 'pointer' : 'not-allowed'
163
395
  };
164
396
  const goToCartButton = {
165
397
  width: '174px',
@@ -171,16 +403,40 @@ const CPIModal = _ref => {
171
403
  fontSize: '12px',
172
404
  color: 'white'
173
405
  };
406
+ const downloadAltIdsButton = {
407
+ width: '189px',
408
+ height: '41px',
409
+ borderRadius: '5px',
410
+ backgroundColor: '#5A7C84',
411
+ fontFamily: 'Poppins',
412
+ fontWeight: '600',
413
+ fontSize: '12px',
414
+ color: 'white',
415
+ textTransform: 'uppercase',
416
+ border: 'none'
417
+ };
418
+ const viewInExploreButton = {
419
+ width: '189px',
420
+ height: '41px',
421
+ borderRadius: '5px',
422
+ backgroundColor: '#2A5C75',
423
+ fontFamily: 'Poppins',
424
+ fontWeight: '600',
425
+ fontSize: '12px',
426
+ color: 'white',
427
+ textTransform: 'uppercase',
428
+ border: 'none'
429
+ };
174
430
  const modalBody = {
175
431
  position: 'absolute',
176
432
  top: '5%',
177
433
  left: '25%',
178
- width: '840px',
434
+ width: '880px',
179
435
  height: '671px',
180
436
  background: '#FFFFFF',
181
437
  border: '1px solid #505050',
182
438
  borderRadius: '40px',
183
- overflow: 'hidden'
439
+ overflow: 'visible'
184
440
  };
185
441
  const header = {
186
442
  display: 'flex',
@@ -201,24 +457,22 @@ const CPIModal = _ref => {
201
457
  display: 'flex',
202
458
  justifyContent: 'center',
203
459
  alignItems: 'center',
204
- height: '55px',
460
+ height: '50px',
205
461
  color: '#7D267E',
206
462
  fontFamily: 'Nunito',
207
463
  fontSize: '16px',
208
464
  fontWeight: '400',
209
- padding: '40px',
210
- paddingLeft: '35px',
211
- paddingRight: '20px',
212
- borderTop: '1px solid #505050'
465
+ padding: '0 25px',
466
+ borderTop: '1px solid #505050',
467
+ textAlign: 'center',
468
+ lineHeight: '30px'
213
469
  };
214
470
  const link = {
215
471
  color: '#7D267E',
216
472
  fontFamily: 'Nunito',
217
473
  fontSize: '16px',
218
474
  fontWeight: '700',
219
- position: 'relative',
220
- top: '11.5px',
221
- right: '39px'
475
+ textDecoration: 'underline'
222
476
  };
223
477
  const modalTitle = {
224
478
  fontFamily: 'Poppins',
@@ -243,34 +497,25 @@ const CPIModal = _ref => {
243
497
  height: '51px',
244
498
  paddingLeft: '16px'
245
499
  };
246
- const participantId = row.participant_id;
247
- const displayColumns = [{
248
- dataField: 'associated_id',
249
- header: 'Participant ID',
250
- tooltipText: 'sort'
251
- }, {
252
- dataField: 'repository_of_synonym_id',
253
- header: 'Name',
254
- tooltipText: 'sort'
255
- }, {
256
- dataField: 'domain_description',
257
- header: 'Description',
258
- tooltipText: 'sort'
259
- }, {
260
- dataField: 'domain_category',
261
- header: 'Category',
262
- tooltipText: 'sort'
263
- }, {
264
- dataField: 'data_location',
265
- header: 'Location',
266
- tooltipText: 'sort'
267
- }];
500
+ const tableContainer = {
501
+ '&::-webkit-scrollbar': {
502
+ width: '6px',
503
+ borderWidth: '0px 1px 1px 1px',
504
+ borderStyle: 'solid',
505
+ borderColor: '#B0B0B0'
506
+ },
507
+ '&::-webkit-scrollbar-track': {
508
+ backgroundColor: '#CECECE'
509
+ },
510
+ '&::-webkit-scrollbar-thumb': {
511
+ backgroundColor: '#003F74'
512
+ }
513
+ };
268
514
  return /*#__PURE__*/_react.default.createElement(_core.Modal, {
269
515
  open: open,
270
516
  onClose: onClose,
271
517
  "aria-labelledby": "".concat(row.id, "-modal")
272
518
  }, /*#__PURE__*/_react.default.createElement(_core.Box, {
273
- className: classes.modalBody,
274
519
  style: modalBody
275
520
  }, /*#__PURE__*/_react.default.createElement("div", {
276
521
  className: "header",
@@ -279,7 +524,7 @@ const CPIModal = _ref => {
279
524
  id: "modal-modal-title",
280
525
  className: "modalTitle",
281
526
  style: modalTitle
282
- }, "Participant ID ".concat(participantId, " : CPI Mappings")), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
527
+ }, "Alternative Identifiers for Participant ".concat(participantId, " in ").concat(studyId)), /*#__PURE__*/_react.default.createElement(_core.IconButton, {
283
528
  "aria-label": "close",
284
529
  onClick: onClose,
285
530
  className: "closeButton",
@@ -290,8 +535,7 @@ const CPIModal = _ref => {
290
535
  className: "container",
291
536
  style: countContainer
292
537
  }, "".concat(data.length, " mapped identifiers")), /*#__PURE__*/_react.default.createElement(CustomTableContainer, {
293
- className: classes.tableContainer,
294
- themeConfig: themeConfig
538
+ style: tableContainer
295
539
  }, /*#__PURE__*/_react.default.createElement(_core.Table, null, /*#__PURE__*/_react.default.createElement(_core.TableHead, null, /*#__PURE__*/_react.default.createElement(_core.TableRow, null, /*#__PURE__*/_react.default.createElement(_core.TableCell, {
296
540
  padding: "checkbox"
297
541
  }, /*#__PURE__*/_react.default.createElement("span", {
@@ -303,10 +547,11 @@ const CPIModal = _ref => {
303
547
  checked: selectAll,
304
548
  onChange: () => handleSelectAll()
305
549
  })), displayColumns.map(column => /*#__PURE__*/_react.default.createElement(_CustomCell.default, {
306
- column: column,
307
- sortBy: sortBy,
308
- sortOrder: sortOrder,
309
- toggleSort: () => handleSortByColumn(column.dataField, sortOrder),
550
+ column: column
551
+ // sortBy={sortBy}
552
+ // sortOrder={sortOrder}
553
+ // toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
554
+ ,
310
555
  style: {
311
556
  paddingLeft: '3px',
312
557
  paddingRight: '3px',
@@ -333,30 +578,126 @@ const CPIModal = _ref => {
333
578
  rel: "noopener noreferrer"
334
579
  }, currRow[column.dataField])))))))), /*#__PURE__*/_react.default.createElement("div", {
335
580
  style: buttonContainer
581
+ }, /*#__PURE__*/_react.default.createElement("div", {
582
+ style: {
583
+ display: 'flex',
584
+ alignItems: 'center',
585
+ position: 'relative'
586
+ }
587
+ }, /*#__PURE__*/_react.default.createElement(_core.Button, {
588
+ style: downloadAltIdsButton,
589
+ onClick: handleDownloadCSV,
590
+ disableRipple: true
591
+ }, /*#__PURE__*/_react.default.createElement("div", {
592
+ style: {
593
+ textAlign: 'center',
594
+ lineHeight: '1.2'
595
+ }
596
+ }, /*#__PURE__*/_react.default.createElement("div", null, "DOWNLOAD"), /*#__PURE__*/_react.default.createElement("div", null, "ALTERNATIVE IDS"))), /*#__PURE__*/_react.default.createElement(_core.Tooltip, {
597
+ title: /*#__PURE__*/_react.default.createElement("div", {
598
+ className: classes.tooltipContent
599
+ }, /*#__PURE__*/_react.default.createElement("div", {
600
+ style: {
601
+ marginBottom: '8px'
602
+ }
603
+ }, "Clicking on DOWNLOAD ALTERNATIVE IDS will download the available alternative identifiers for this Participant."), /*#__PURE__*/_react.default.createElement("div", {
604
+ style: {
605
+ marginBottom: '8px'
606
+ }
607
+ }, "CPI mappings are also available for each study as part of the downloadable study manifest. Follow these steps to download all alternative identifiers for a study:"), /*#__PURE__*/_react.default.createElement("div", {
608
+ style: {
609
+ paddingLeft: '16px'
610
+ }
611
+ }, /*#__PURE__*/_react.default.createElement("div", {
612
+ style: {
613
+ marginBottom: '4px'
614
+ }
615
+ }, "1. Go to the Explore Dashboard"), /*#__PURE__*/_react.default.createElement("div", {
616
+ style: {
617
+ marginBottom: '4px'
618
+ }
619
+ }, "2. Go to the Studies Tab of the Table"), /*#__PURE__*/_react.default.createElement("div", {
620
+ style: {
621
+ marginBottom: '4px'
622
+ }
623
+ }, "3. Click on the icon", ' ', /*#__PURE__*/_react.default.createElement("img", {
624
+ src: _download.default,
625
+ alt: "Download",
626
+ style: {
627
+ width: '12px',
628
+ height: '8px',
629
+ margin: '0 4px',
630
+ verticalAlign: 'middle'
631
+ }
632
+ }), ' ', "in the Manifest column to download the Manifest."), /*#__PURE__*/_react.default.createElement("div", null, "4. Open the downloaded Manifest and go to the \"alternative identifiers\" tab"))),
633
+ placement: "top",
634
+ arrow: true,
635
+ classes: {
636
+ tooltip: classes.customTooltip
637
+ }
638
+ }, /*#__PURE__*/_react.default.createElement("img", {
639
+ src: _Question_Icon.default,
640
+ alt: "Help",
641
+ className: classes.questionIcon
642
+ }))), /*#__PURE__*/_react.default.createElement(_core.Button, {
643
+ style: viewInExploreButton,
644
+ onClick: () => {
645
+ onClose();
646
+ navigation("/explore?p_id=".concat(participantId, "&dbgap_accession=").concat(studyId));
647
+ },
648
+ disableRipple: true
649
+ }, "VIEW IN EXPLORE"), /*#__PURE__*/_react.default.createElement("div", {
650
+ className: classes.dropdownContainer,
651
+ ref: dropdownRef
652
+ }, /*#__PURE__*/_react.default.createElement(_core.Button, {
653
+ variant: "outlined",
654
+ className: "".concat(classes.button, " ").concat(dropdownOpen ? classes.buttonOpen : ''),
655
+ onClick: handleDropdownToggle,
656
+ disableRipple: true
657
+ }, /*#__PURE__*/_react.default.createElement("span", null, "ADD TO OR GO TO CART"), dropdownOpen ? /*#__PURE__*/_react.default.createElement(_ExpandLess.default, null) : /*#__PURE__*/_react.default.createElement(_ExpandMore.default, null)), dropdownOpen && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
658
+ style: {
659
+ position: 'fixed',
660
+ top: 0,
661
+ left: 0,
662
+ right: 0,
663
+ bottom: 0,
664
+ zIndex: 9998
665
+ },
666
+ onClick: () => setDropdownOpen(false)
667
+ }), /*#__PURE__*/_react.default.createElement("div", {
668
+ className: classes.dropdown
669
+ }, /*#__PURE__*/_react.default.createElement("div", {
670
+ className: classes.dropdownList
671
+ }, /*#__PURE__*/_react.default.createElement("div", {
672
+ className: classes.dropdownItem
336
673
  }, /*#__PURE__*/_react.default.createElement(_ReduxAddFile.default, _extends({}, wrapperConfig.items[0], {
337
674
  buttonStyle: addAllFilesButton,
338
675
  rowID: row.id
339
- })), /*#__PURE__*/_react.default.createElement(_ReduxAddFile.default, _extends({}, wrapperConfig.items[1], {
676
+ }))), /*#__PURE__*/_react.default.createElement("div", {
677
+ className: classes.dropdownItem
678
+ }, /*#__PURE__*/_react.default.createElement(_ReduxAddFile.default, _extends({}, wrapperConfig.items[1], {
340
679
  buttonStyle: addSelectedFilesButton,
341
- rowID: row.id
342
- })), /*#__PURE__*/_react.default.createElement(_core.Button, {
343
- style: goToCartButton,
344
- onClick: () => navigation('/fileCentricCart')
345
- }, "GO TO CART", /*#__PURE__*/_react.default.createElement("img", {
346
- src: _Cart_Icon.default,
347
- alt: "cart",
348
- style: {
349
- paddingLeft: '30px'
350
- }
680
+ rowID: row.id,
681
+ disabled: selectedIds.length === 0
351
682
  }))), /*#__PURE__*/_react.default.createElement("div", {
683
+ className: classes.dropdownItem
684
+ }, /*#__PURE__*/_react.default.createElement(_core.Button, {
685
+ style: goToCartButton,
686
+ onClick: () => {
687
+ onClose();
688
+ setDropdownOpen(false);
689
+ navigation('/fileCentricCart');
690
+ },
691
+ disableRipple: true
692
+ }, "GO TO CART"))))))), /*#__PURE__*/_react.default.createElement("div", {
352
693
  className: "footer",
353
694
  style: footer
354
- }, "All CPI mappings for a given study can be found in the \"synonyms\" tab of the downloadable manifest, available under the \"Studies\" tab in the Explore Dashboard. For more information about CPI, click\xA0", /*#__PURE__*/_react.default.createElement("a", {
695
+ }, /*#__PURE__*/_react.default.createElement("span", null, "For more information about CPI, click", ' ', /*#__PURE__*/_react.default.createElement("a", {
355
696
  style: link,
356
697
  href: "https://participantindex-docs.ccdi.cancer.gov/",
357
698
  target: "_blank",
358
699
  rel: "noopener noreferrer"
359
- }, "here"))));
700
+ }, "here"), "."))));
360
701
  };
361
702
  var _default = (0, _styles.withStyles)(_ModalStyle.default)(CPIModal);
362
703
  exports.default = _default;