@bento-core/table 1.0.1-ccdihub.98 → 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 +436 -95
  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 +467 -103
  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
@@ -1,60 +1,217 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useEffect, useRef } from 'react';
2
2
  import {
3
3
  Box,
4
4
  Checkbox,
5
+ Button,
5
6
  Modal,
6
7
  Typography,
7
8
  IconButton,
8
9
  Paper,
9
10
  Table,
10
11
  TableContainer,
11
- ThemeProvider,
12
12
  TableHead,
13
13
  TableRow,
14
14
  TableCell,
15
15
  TableBody,
16
- Button,
16
+ ThemeProvider,
17
+ Tooltip,
17
18
  } from '@material-ui/core';
18
19
  // import CustomTableBody from '../../body/CustomTblBody';
19
20
  import CloseIcon from '@material-ui/icons/Close';
20
- import { withStyles } from '@material-ui/core/styles';
21
+ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
22
+ import ExpandLessIcon from '@material-ui/icons/ExpandLess';
23
+ import { withStyles, makeStyles, createTheme } from '@material-ui/core/styles';
21
24
  import styles from './ModalStyle';
22
25
  // import TableHeader from '../../header/CustomTblHeader';
23
26
  import HeaderCell from '../../header/CustomCell';
24
27
  import AddFileButtonView from '../../wrapper/components/ReduxAddFile';
25
28
  import questionIcon from './assets/Question_Icon.svg';
26
- import cartIcon from './assets/Cart_Icon.svg';
27
-
28
- const tooltipContentAddAll = {
29
- tooltipText: 'Click button to add all Hub files associated with this participant to the cart.',
30
- icon: questionIcon,
31
- alt: 'tooltipIcon',
32
- Participants: 'Click button to add all files associated with the filtered row(s).',
33
- arrow: true,
34
- styles: {
35
- border: '#03A383 1px solid',
36
- },
37
- };
29
+ import downloadIcon from './assets/download.svg';
38
30
 
39
- const tooltipContent = {
40
- tooltipText: 'Click button to add all selected files associated with this participant to the cart.',
41
- icon: questionIcon,
42
- alt: 'tooltipIcon',
43
- Participants: 'Click button to add files associated with the selected row(s).',
44
- arrow: true,
45
- styles: {
46
- border: '#03A383 1px solid',
31
+ const useStyles = makeStyles(() => ({
32
+ button: {
33
+ width: '189px',
34
+ height: '41px',
35
+ alignSelf: 'end',
36
+ color: '#FFFFFF',
37
+ backgroundColor: '#2A6E93',
38
+ borderColor: '#2A6E93',
39
+ fontFamily: 'Poppins',
40
+ fontWeight: '600',
41
+ fontSize: '12px',
42
+ lineHeight: '13px',
43
+ display: 'flex',
44
+ justifyContent: 'flex-start',
45
+ alignItems: 'center',
46
+ padding: '0 12px',
47
+ borderRadius: '5px',
48
+ transition: 'border-radius 0.2s ease-in-out',
49
+ textAlign: 'left',
50
+ '&:hover': {
51
+ backgroundColor: '#245A7A',
52
+ },
53
+ '& .MuiButton-label': {
54
+ display: 'flex',
55
+ justifyContent: 'space-between',
56
+ alignItems: 'center',
57
+ width: '100%',
58
+ },
47
59
  },
48
- };
60
+ buttonOpen: {
61
+ borderBottomLeftRadius: '0',
62
+ borderBottomRightRadius: '0',
63
+ },
64
+ dropdownContainer: {
65
+ position: 'relative',
66
+ display: 'flex',
67
+ flexDirection: 'column',
68
+ alignItems: 'flex-end',
69
+ },
70
+ dropdown: {
71
+ position: 'absolute',
72
+ top: '100%',
73
+ right: 0,
74
+ zIndex: 10000,
75
+ marginTop: '-1px',
76
+ backgroundColor: 'white',
77
+ border: '1px solid #07679C',
78
+ borderTop: 'none',
79
+ borderRadius: '0 0 5px 5px',
80
+ boxShadow: '0px 4px 12px rgba(0, 0, 0, 0.15)',
81
+ minWidth: '189px',
82
+ width: '189px',
83
+ transformOrigin: 'top',
84
+ animation: '$slideDown 0.2s ease-out',
85
+ },
86
+ '@keyframes slideDown': {
87
+ '0%': {
88
+ opacity: 0,
89
+ transform: 'translateY(-10px)',
90
+ },
91
+ '100%': {
92
+ opacity: 1,
93
+ transform: 'translateY(0)',
94
+ },
95
+ },
96
+ dropdownList: {
97
+ padding: 0,
98
+ margin: 0,
99
+ },
100
+ dropdownItem: {
101
+ borderBottom: '1px solid #07679C',
102
+ padding: '0',
103
+ height: '41px',
104
+ minHeight: '41px',
105
+ display: 'flex',
106
+ alignItems: 'center',
107
+ '&:first-child': {
108
+ borderTop: '1px solid #07679C',
109
+ },
110
+ '&:last-child': {
111
+ borderBottom: 'none',
112
+ },
113
+ '&:hover': {
114
+ backgroundColor: '#DEE4EC',
115
+ },
116
+ '&:active': {
117
+ backgroundColor: '#e9ecef',
118
+ },
119
+ '&:not(:last-child)': {
120
+ borderBottom: '1px solid #07679C',
121
+ },
122
+ '& > div': {
123
+ width: '100%',
124
+ display: 'flex',
125
+ alignItems: 'center',
126
+ height: '100%',
127
+ },
128
+ '& button': {
129
+ width: '100% !important',
130
+ height: '41px !important',
131
+ borderRadius: '0 !important',
132
+ backgroundColor: 'transparent !important',
133
+ color: '#343434 !important',
134
+ fontFamily: 'Poppins !important',
135
+ fontWeight: '500 !important',
136
+ fontStyle: 'Medium !important',
137
+ fontSize: '12px !important',
138
+ lineHeight: '13px !important',
139
+ letterSpacing: '-0.02em !important',
140
+ textTransform: 'uppercase !important',
141
+ textAlign: 'left !important',
142
+ justifyContent: 'flex-start !important',
143
+ padding: '0 12px !important',
144
+ border: 'none !important',
145
+ boxShadow: 'none !important',
146
+ display: 'flex !important',
147
+ alignItems: 'center !important',
148
+ verticalAlign: 'middle !important',
149
+ '&:hover': {
150
+ backgroundColor: 'transparent !important',
151
+ },
152
+ },
153
+ },
154
+ dropdownItemText: {
155
+ '& .MuiListItemText-primary': {
156
+ fontFamily: 'Poppins',
157
+ fontWeight: '600',
158
+ fontSize: '12px',
159
+ color: '#07679C',
160
+ textTransform: 'uppercase',
161
+ letterSpacing: '0.5px',
162
+ },
163
+ },
164
+ questionIcon: {
165
+ width: '10px',
166
+ height: '10px',
167
+ position: 'absolute',
168
+ top: '3px',
169
+ right: '-12px',
170
+ cursor: 'pointer',
171
+ zIndex: 1,
172
+ },
173
+ tooltipContent: {
174
+ fontFamily: 'Poppins',
175
+ fontWeight: 400,
176
+ fontStyle: 'Regular',
177
+ fontSize: '13px',
178
+ lineHeight: '17.5px',
179
+ letterSpacing: '-0.01em',
180
+ color: '#000000',
181
+ backgroundColor: '#FFFFFF',
182
+ border: '0.5px solid #000000',
183
+ borderRadius: '4px',
184
+ padding: '12px',
185
+ maxWidth: '400px',
186
+ },
187
+ tooltipIcon: {
188
+ width: '16px',
189
+ height: '11px',
190
+ marginRight: '8px',
191
+ verticalAlign: 'middle',
192
+ },
193
+ customTooltip: {
194
+ backgroundColor: '#FFFFFF !important',
195
+ color: '#000000 !important',
196
+ border: '0.5px solid #000000 !important',
197
+ borderRadius: '4px !important',
198
+ padding: '0 !important',
199
+ boxShadow: 'none !important',
200
+ '& .MuiTooltip-arrow': {
201
+ color: '#000000 !important',
202
+ },
203
+ },
204
+ }));
49
205
 
50
206
  const CustomTableContainer = (props) => {
51
- const { children, themeConfig, className } = props;
207
+ const { children, className } = props;
52
208
  const tableStyle = {
53
- height: '425px',
209
+ height: '450px',
54
210
  overflowX: 'hidden',
55
211
  };
212
+ const defaultTheme = createTheme();
56
213
  return (
57
- <ThemeProvider theme={themeConfig}>
214
+ <ThemeProvider theme={defaultTheme}>
58
215
  <TableContainer className={className} id="tableContainer" component={Paper} style={tableStyle}>
59
216
  {children}
60
217
  </TableContainer>
@@ -63,21 +220,102 @@ const CustomTableContainer = (props) => {
63
220
  };
64
221
 
65
222
  const CPIModal = ({
66
- classes,
67
223
  open,
68
224
  onClose,
69
225
  row,
70
- themeConfig = {},
71
226
  navigation,
72
227
  }) => {
73
- const [sortBy, setSortBy] = useState('associated_id');
74
- const [sortOrder, setSortOrder] = useState('asc');
75
- const [data, setData] = useState(() => {
76
- const result = row.cpi_data;
77
- return result;
78
- });
228
+ const classes = useStyles();
229
+ // const [sortBy, setSortBy] = useState('associated_id');
230
+ // const [sortOrder, setSortOrder] = useState('asc');
231
+ const [data, setData] = useState(row.cpi_data);
79
232
  const [selectedIds, setIds] = useState([]);
80
233
  const [selectAll, setSelectAll] = useState(false);
234
+ const [dropdownOpen, setDropdownOpen] = useState(false);
235
+ const dropdownRef = useRef(null);
236
+
237
+ const participantId = row.participant_id;
238
+ const studyId = row.study_id;
239
+
240
+ useEffect(() => {
241
+ // Reset all state when row or open status changes
242
+ setData(row.cpi_data || []);
243
+ setIds([]);
244
+ setSelectAll(false);
245
+ setDropdownOpen(false);
246
+ }, [row, open]);
247
+
248
+ const handleDropdownToggle = () => {
249
+ setDropdownOpen(!dropdownOpen);
250
+ };
251
+
252
+ const displayColumns = [
253
+ {
254
+ dataField: 'associated_id',
255
+ header: 'Participant ID',
256
+ // tooltipText: 'sort',
257
+ sortable: false,
258
+ },
259
+ {
260
+ dataField: 'repository_of_synonym_id',
261
+ header: 'Name',
262
+ // tooltipText: 'sort',
263
+ sortable: false,
264
+ },
265
+ {
266
+ dataField: 'domain_description',
267
+ header: 'Description',
268
+ // tooltipText: 'sort',
269
+ sortable: false,
270
+ },
271
+ {
272
+ dataField: 'domain_category',
273
+ header: 'Category',
274
+ // tooltipText: 'sort',
275
+ sortable: false,
276
+ },
277
+ {
278
+ dataField: 'data_location',
279
+ header: 'Location',
280
+ // tooltipText: 'sort',
281
+ sortable: false,
282
+ },
283
+ ];
284
+
285
+ const handleDownloadCSV = () => {
286
+ // Use the same column order and headers as the table display
287
+ const csvColumnOrder = displayColumns;
288
+
289
+ // Get the table data using the same column order as table
290
+ const csvData = data.map((dataRow) => csvColumnOrder.map((column) => {
291
+ const value = dataRow[column.dataField];
292
+ // Escape commas and quotes in CSV
293
+ if (typeof value === 'string' && (value.includes(',') || value.includes('"') || value.includes('\n'))) {
294
+ return `"${value.replace(/"/g, '""')}"`;
295
+ }
296
+ return value || '';
297
+ }));
298
+
299
+ // Create CSV headers using the same headers as table
300
+ const headers = csvColumnOrder.map((column) => column.header).join(',');
301
+
302
+ // Create CSV content
303
+ const csvContent = [
304
+ headers,
305
+ ...csvData.map((csvRow) => csvRow.join(',')),
306
+ ].join('\n');
307
+
308
+ // Create and download the file
309
+ const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });
310
+ const link = document.createElement('a');
311
+ const url = URL.createObjectURL(blob);
312
+ link.setAttribute('href', url);
313
+ link.setAttribute('download', `alternative_identifiers_${participantId}_${studyId}.csv`);
314
+ link.style.visibility = 'hidden';
315
+ document.body.appendChild(link);
316
+ link.click();
317
+ document.body.removeChild(link);
318
+ };
81
319
 
82
320
  const wrapperConfig = {
83
321
  container: 'buttons',
@@ -90,7 +328,6 @@ const CPIModal = ({
90
328
  clsName: 'add_all_button',
91
329
  role: 'ADD_ALL_FILES',
92
330
  btnType: 'ADD_ALL_FILES',
93
- tooltipCofig: tooltipContentAddAll,
94
331
  conditional: false,
95
332
  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
333
  },
@@ -100,21 +337,21 @@ const CPIModal = ({
100
337
  clsName: 'add_selected_button',
101
338
  role: 'ADD_SELECTED_FILES',
102
339
  btnType: 'ADD_SELECTED_FILES',
103
- tooltipCofig: tooltipContent,
104
340
  conditional: true,
341
+ disabled: selectedIds.length === 0,
105
342
  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
343
  },
107
344
  ],
108
345
  };
109
346
 
110
- const sortingData = (column, newOrder) => {
347
+ /* const sortingData = (column, newOrder) => {
111
348
  const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
112
349
 
113
350
  if (newOrder === 'desc') {
114
351
  return sortedData.reverse();
115
352
  }
116
353
  return sortedData;
117
- };
354
+ }; */
118
355
 
119
356
  const handleSelectAll = () => {
120
357
  if (selectAll) {
@@ -142,18 +379,20 @@ const CPIModal = ({
142
379
  }
143
380
  };
144
381
 
145
- const handleSortByColumn = (column, order) => {
382
+ /* const handleSortByColumn = (column, order) => {
146
383
  const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
147
384
  const newData = sortingData(column, newOrder);
148
385
  setData(newData);
149
386
  setSortBy(column);
150
387
  setSortOrder(newOrder);
151
- };
388
+ }; */
152
389
 
153
390
  const buttonContainer = {
154
391
  display: 'flex',
155
392
  justifyContent: 'center',
393
+ alignItems: 'center',
156
394
  padding: '10px',
395
+ gap: '20px',
157
396
  };
158
397
 
159
398
  const addAllFilesButton = {
@@ -176,8 +415,10 @@ const CPIModal = ({
176
415
  fontFamily: 'Poppins',
177
416
  fontWeight: '600',
178
417
  fontSize: '12px',
179
- color: 'white',
418
+ color: selectedIds.length ? 'white' : '#666666',
180
419
  lineHeight: '14px',
420
+ opacity: selectedIds.length ? 1 : 0.6,
421
+ cursor: selectedIds.length ? 'pointer' : 'not-allowed',
181
422
  };
182
423
 
183
424
  const goToCartButton = {
@@ -191,16 +432,42 @@ const CPIModal = ({
191
432
  color: 'white',
192
433
  };
193
434
 
435
+ const downloadAltIdsButton = {
436
+ width: '189px',
437
+ height: '41px',
438
+ borderRadius: '5px',
439
+ backgroundColor: '#5A7C84',
440
+ fontFamily: 'Poppins',
441
+ fontWeight: '600',
442
+ fontSize: '12px',
443
+ color: 'white',
444
+ textTransform: 'uppercase',
445
+ border: 'none',
446
+ };
447
+
448
+ const viewInExploreButton = {
449
+ width: '189px',
450
+ height: '41px',
451
+ borderRadius: '5px',
452
+ backgroundColor: '#2A5C75',
453
+ fontFamily: 'Poppins',
454
+ fontWeight: '600',
455
+ fontSize: '12px',
456
+ color: 'white',
457
+ textTransform: 'uppercase',
458
+ border: 'none',
459
+ };
460
+
194
461
  const modalBody = {
195
462
  position: 'absolute',
196
463
  top: '5%',
197
464
  left: '25%',
198
- width: '840px',
465
+ width: '880px',
199
466
  height: '671px',
200
467
  background: '#FFFFFF',
201
468
  border: '1px solid #505050',
202
469
  borderRadius: '40px',
203
- overflow: 'hidden',
470
+ overflow: 'visible',
204
471
  };
205
472
 
206
473
  const header = {
@@ -225,15 +492,15 @@ const CPIModal = ({
225
492
  display: 'flex',
226
493
  justifyContent: 'center',
227
494
  alignItems: 'center',
228
- height: '55px',
495
+ height: '50px',
229
496
  color: '#7D267E',
230
497
  fontFamily: 'Nunito',
231
498
  fontSize: '16px',
232
499
  fontWeight: '400',
233
- padding: '40px',
234
- paddingLeft: '35px',
235
- paddingRight: '20px',
500
+ padding: '0 25px',
236
501
  borderTop: '1px solid #505050',
502
+ textAlign: 'center',
503
+ lineHeight: '30px',
237
504
  };
238
505
 
239
506
  const link = {
@@ -241,9 +508,7 @@ const CPIModal = ({
241
508
  fontFamily: 'Nunito',
242
509
  fontSize: '16px',
243
510
  fontWeight: '700',
244
- position: 'relative',
245
- top: '11.5px',
246
- right: '39px',
511
+ textDecoration: 'underline',
247
512
  };
248
513
 
249
514
  const modalTitle = {
@@ -272,34 +537,20 @@ const CPIModal = ({
272
537
  paddingLeft: '16px',
273
538
  };
274
539
 
275
- const participantId = row.participant_id;
276
- const displayColumns = [
277
- {
278
- dataField: 'associated_id',
279
- header: 'Participant ID',
280
- tooltipText: 'sort',
540
+ const tableContainer = {
541
+ '&::-webkit-scrollbar': {
542
+ width: '6px',
543
+ borderWidth: '0px 1px 1px 1px',
544
+ borderStyle: 'solid',
545
+ borderColor: '#B0B0B0',
281
546
  },
282
- {
283
- dataField: 'repository_of_synonym_id',
284
- header: 'Name',
285
- tooltipText: 'sort',
547
+ '&::-webkit-scrollbar-track': {
548
+ backgroundColor: '#CECECE',
286
549
  },
287
- {
288
- dataField: 'domain_description',
289
- header: 'Description',
290
- tooltipText: 'sort',
550
+ '&::-webkit-scrollbar-thumb': {
551
+ backgroundColor: '#003F74',
291
552
  },
292
- {
293
- dataField: 'domain_category',
294
- header: 'Category',
295
- tooltipText: 'sort',
296
- },
297
- {
298
- dataField: 'data_location',
299
- header: 'Location',
300
- tooltipText: 'sort',
301
- },
302
- ];
553
+ };
303
554
 
304
555
  return (
305
556
  <Modal
@@ -307,10 +558,10 @@ const CPIModal = ({
307
558
  onClose={onClose}
308
559
  aria-labelledby={`${row.id}-modal`}
309
560
  >
310
- <Box className={classes.modalBody} style={modalBody}>
561
+ <Box style={modalBody}>
311
562
  <div className="header" style={header}>
312
563
  <Typography id="modal-modal-title" className="modalTitle" style={modalTitle}>
313
- {`Participant ID ${participantId} : CPI Mappings`}
564
+ {`Alternative Identifiers for Participant ${participantId} in ${studyId}`}
314
565
  </Typography>
315
566
  <IconButton
316
567
  aria-label="close"
@@ -325,8 +576,7 @@ const CPIModal = ({
325
576
  {`${data.length} mapped identifiers`}
326
577
  </div>
327
578
  <CustomTableContainer
328
- className={classes.tableContainer}
329
- themeConfig={themeConfig}
579
+ style={tableContainer}
330
580
  >
331
581
  <Table>
332
582
  <TableHead>
@@ -343,9 +593,9 @@ const CPIModal = ({
343
593
  displayColumns.map((column) => (
344
594
  <HeaderCell
345
595
  column={column}
346
- sortBy={sortBy}
347
- sortOrder={sortOrder}
348
- toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
596
+ // sortBy={sortBy}
597
+ // sortOrder={sortOrder}
598
+ // toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
349
599
  style={{ paddingLeft: '3px', paddingRight: '3px', fontWeight: '700' }}
350
600
  />
351
601
  ))
@@ -380,30 +630,144 @@ const CPIModal = ({
380
630
  </Table>
381
631
  </CustomTableContainer>
382
632
  <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
- />
633
+ <div style={{ display: 'flex', alignItems: 'center', position: 'relative' }}>
634
+ <Button
635
+ style={downloadAltIdsButton}
636
+ onClick={handleDownloadCSV}
637
+ disableRipple
638
+ >
639
+ <div style={{ textAlign: 'center', lineHeight: '1.2' }}>
640
+ <div>DOWNLOAD</div>
641
+ <div>ALTERNATIVE IDS</div>
642
+ </div>
643
+ </Button>
644
+ <Tooltip
645
+ title={(
646
+ <div className={classes.tooltipContent}>
647
+ <div style={{ marginBottom: '8px' }}>
648
+ Clicking on DOWNLOAD ALTERNATIVE IDS will download the available
649
+ alternative identifiers for this Participant.
650
+ </div>
651
+ <div style={{ marginBottom: '8px' }}>
652
+ CPI mappings are also available for each study as part of the downloadable
653
+ study manifest. Follow these steps to download all alternative identifiers
654
+ for a study:
655
+ </div>
656
+ <div style={{ paddingLeft: '16px' }}>
657
+ <div style={{ marginBottom: '4px' }}>1. Go to the Explore Dashboard</div>
658
+ <div style={{ marginBottom: '4px' }}>2. Go to the Studies Tab of the Table</div>
659
+ <div style={{ marginBottom: '4px' }}>
660
+ 3. Click on the icon
661
+ {' '}
662
+ <img
663
+ src={downloadIcon}
664
+ alt="Download"
665
+ style={{
666
+ width: '12px', height: '8px', margin: '0 4px', verticalAlign: 'middle',
667
+ }}
668
+ />
669
+ {' '}
670
+ in the Manifest column to download the Manifest.
671
+ </div>
672
+ <div>
673
+ 4. Open the downloaded Manifest and go to the "alternative identifiers" tab
674
+ </div>
675
+ </div>
676
+ </div>
677
+ )}
678
+ placement="top"
679
+ arrow
680
+ classes={{ tooltip: classes.customTooltip }}
681
+ >
682
+ <img src={questionIcon} alt="Help" className={classes.questionIcon} />
683
+ </Tooltip>
684
+ </div>
685
+
393
686
  <Button
394
- style={goToCartButton}
395
- onClick={() => navigation('/fileCentricCart')}
687
+ style={viewInExploreButton}
688
+ onClick={() => {
689
+ onClose();
690
+ navigation(`/explore?p_id=${participantId}&dbgap_accession=${studyId}`);
691
+ }}
692
+ disableRipple
396
693
  >
397
- GO TO CART
398
- <img src={cartIcon} alt="cart" style={{ paddingLeft: '30px' }} />
694
+ VIEW IN EXPLORE
399
695
  </Button>
696
+
697
+ <div className={classes.dropdownContainer} ref={dropdownRef}>
698
+ <Button
699
+ variant="outlined"
700
+ className={`${classes.button} ${dropdownOpen ? classes.buttonOpen : ''}`}
701
+ onClick={handleDropdownToggle}
702
+ disableRipple
703
+ >
704
+ <span>ADD TO OR GO TO CART</span>
705
+ {dropdownOpen ? <ExpandLessIcon /> : <ExpandMoreIcon />}
706
+ </Button>
707
+
708
+ {dropdownOpen && (
709
+ <>
710
+ <div
711
+ style={{
712
+ position: 'fixed',
713
+ top: 0,
714
+ left: 0,
715
+ right: 0,
716
+ bottom: 0,
717
+ zIndex: 9998,
718
+ }}
719
+ onClick={() => setDropdownOpen(false)}
720
+ />
721
+ <div className={classes.dropdown}>
722
+ <div className={classes.dropdownList}>
723
+ <div className={classes.dropdownItem}>
724
+ <AddFileButtonView
725
+ {...wrapperConfig.items[0]}
726
+ buttonStyle={addAllFilesButton}
727
+ rowID={row.id}
728
+ />
729
+ </div>
730
+ <div className={classes.dropdownItem}>
731
+ <AddFileButtonView
732
+ {...wrapperConfig.items[1]}
733
+ buttonStyle={addSelectedFilesButton}
734
+ rowID={row.id}
735
+ disabled={selectedIds.length === 0}
736
+ />
737
+ </div>
738
+ <div className={classes.dropdownItem}>
739
+ <Button
740
+ style={goToCartButton}
741
+ onClick={() => {
742
+ onClose();
743
+ setDropdownOpen(false);
744
+ navigation('/fileCentricCart');
745
+ }}
746
+ disableRipple
747
+ >
748
+ GO TO CART
749
+ </Button>
750
+ </div>
751
+ </div>
752
+ </div>
753
+ </>
754
+ )}
755
+ </div>
400
756
  </div>
401
757
  <div className="footer" style={footer}>
402
- All CPI mappings for a given study can be found in the "synonyms"
403
- tab of the downloadable manifest,
404
- available under the "Studies" tab in the Explore Dashboard.
405
- For more information about CPI, click&nbsp;
406
- <a style={link} href="https://participantindex-docs.ccdi.cancer.gov/" target="_blank" rel="noopener noreferrer">here</a>
758
+ <span>
759
+ For more information about CPI, click
760
+ {' '}
761
+ <a
762
+ style={link}
763
+ href="https://participantindex-docs.ccdi.cancer.gov/"
764
+ target="_blank"
765
+ rel="noopener noreferrer"
766
+ >
767
+ here
768
+ </a>
769
+ .
770
+ </span>
407
771
  </div>
408
772
  </Box>
409
773
  </Modal>