@bento-core/table 1.0.1-ccdihub.99 → 1.0.1-ccdiintegrated.2
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.
- package/dist/ExtendedView.js +134 -7
- package/dist/TableView.js +23 -7
- package/dist/body/CustomTblBody.js +2 -1
- package/dist/body/DisplayBodyCell.js +18 -0
- package/dist/body/components/CPIMappingView.js +221 -0
- package/dist/body/components/CPIModal.js +434 -93
- package/dist/body/components/CPIView.js +64 -10
- package/dist/body/components/StudiesDataAvailabilityView.js +125 -0
- package/dist/body/components/assets/CPI_Icon_Dataset.svg +6 -0
- package/dist/body/components/assets/CPI_Icon_Multi.svg +6 -0
- package/dist/body/components/assets/CPI_Icon_Single.svg +4 -0
- package/dist/body/components/assets/CPI_Icon_Study.svg +11 -0
- package/dist/body/components/assets/Participant_Files.svg +17 -0
- package/dist/body/components/assets/Publications.svg +15 -0
- package/dist/body/components/assets/Sample_Files.svg +16 -0
- package/dist/body/components/assets/Study_Files.svg +21 -0
- package/dist/body/components/assets/download.svg +3 -0
- package/dist/header/CustomCell.js +4 -3
- package/dist/header/CustomTblHeader.js +16 -3
- package/dist/index.js +7 -0
- package/dist/toolbar/DownloadButtonView.js +30 -4
- package/dist/toolbar/SearchBar.js +92 -0
- package/dist/toolbar/assets/Search_Icon.svg +3 -0
- package/dist/util/Types.js +16 -4
- package/dist/util/downloadTable.js +36 -1
- package/dist/wrapper/components/AddToCart/AddToCartView.js +126 -0
- package/dist/wrapper/components/AddToCart/ReduxAddToCart.js +27 -0
- package/dist/wrapper/components/Snackbar/Snackbar.js +5 -0
- package/package.json +23 -22
- package/src/ExtendedView.js +146 -7
- package/src/TableView.js +27 -8
- package/src/body/CustomTblBody.js +2 -1
- package/src/body/DisplayBodyCell.js +22 -0
- package/src/body/components/CPIMappingView.js +260 -0
- package/src/body/components/CPIModal.js +464 -101
- package/src/body/components/CPIView.js +75 -22
- package/src/body/components/StudiesDataAvailabilityView.js +121 -0
- package/src/body/components/assets/CPI_Icon_Dataset.svg +6 -0
- package/src/body/components/assets/CPI_Icon_Multi.svg +6 -0
- package/src/body/components/assets/CPI_Icon_Single.svg +4 -0
- package/src/body/components/assets/CPI_Icon_Study.svg +11 -0
- package/src/body/components/assets/Participant_Files.svg +17 -0
- package/src/body/components/assets/Publications.svg +15 -0
- package/src/body/components/assets/Sample_Files.svg +16 -0
- package/src/body/components/assets/Study_Files.svg +21 -0
- package/src/body/components/assets/download.svg +3 -0
- package/src/header/CustomCell.js +4 -3
- package/src/header/CustomTblHeader.js +13 -1
- package/src/index.js +1 -0
- package/src/toolbar/DownloadButtonView.js +20 -4
- package/src/toolbar/SearchBar.js +90 -0
- package/src/toolbar/assets/Search_Icon.svg +3 -0
- package/src/util/Types.js +10 -1
- package/src/util/downloadTable.js +37 -1
- package/src/wrapper/components/AddToCart/AddToCartView.js +132 -0
- package/src/wrapper/components/AddToCart/ReduxAddToCart.js +20 -0
- package/src/wrapper/components/Snackbar/Snackbar.js +1 -0
|
@@ -1,60 +1,217 @@
|
|
|
1
|
-
import React, { useState, useEffect } 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
|
-
|
|
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
|
|
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
|
|
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
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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,
|
|
207
|
+
const { children, className } = props;
|
|
52
208
|
const tableStyle = {
|
|
53
|
-
height: '
|
|
209
|
+
height: '450px',
|
|
54
210
|
overflowX: 'hidden',
|
|
55
211
|
};
|
|
212
|
+
const defaultTheme = createTheme();
|
|
56
213
|
return (
|
|
57
|
-
<ThemeProvider theme={
|
|
214
|
+
<ThemeProvider theme={defaultTheme}>
|
|
58
215
|
<TableContainer className={className} id="tableContainer" component={Paper} style={tableStyle}>
|
|
59
216
|
{children}
|
|
60
217
|
</TableContainer>
|
|
@@ -63,22 +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
|
|
74
|
-
const [
|
|
228
|
+
const classes = useStyles();
|
|
229
|
+
// const [sortBy, setSortBy] = useState('associated_id');
|
|
230
|
+
// const [sortOrder, setSortOrder] = useState('asc');
|
|
75
231
|
const [data, setData] = useState(row.cpi_data);
|
|
76
232
|
const [selectedIds, setIds] = useState([]);
|
|
77
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;
|
|
78
239
|
|
|
79
240
|
useEffect(() => {
|
|
80
|
-
|
|
81
|
-
|
|
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
|
+
};
|
|
82
319
|
|
|
83
320
|
const wrapperConfig = {
|
|
84
321
|
container: 'buttons',
|
|
@@ -91,7 +328,6 @@ const CPIModal = ({
|
|
|
91
328
|
clsName: 'add_all_button',
|
|
92
329
|
role: 'ADD_ALL_FILES',
|
|
93
330
|
btnType: 'ADD_ALL_FILES',
|
|
94
|
-
tooltipCofig: tooltipContentAddAll,
|
|
95
331
|
conditional: false,
|
|
96
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.',
|
|
97
333
|
},
|
|
@@ -101,21 +337,21 @@ const CPIModal = ({
|
|
|
101
337
|
clsName: 'add_selected_button',
|
|
102
338
|
role: 'ADD_SELECTED_FILES',
|
|
103
339
|
btnType: 'ADD_SELECTED_FILES',
|
|
104
|
-
tooltipCofig: tooltipContent,
|
|
105
340
|
conditional: true,
|
|
341
|
+
disabled: selectedIds.length === 0,
|
|
106
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.',
|
|
107
343
|
},
|
|
108
344
|
],
|
|
109
345
|
};
|
|
110
346
|
|
|
111
|
-
const sortingData = (column, newOrder) => {
|
|
347
|
+
/* const sortingData = (column, newOrder) => {
|
|
112
348
|
const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
|
|
113
349
|
|
|
114
350
|
if (newOrder === 'desc') {
|
|
115
351
|
return sortedData.reverse();
|
|
116
352
|
}
|
|
117
353
|
return sortedData;
|
|
118
|
-
};
|
|
354
|
+
}; */
|
|
119
355
|
|
|
120
356
|
const handleSelectAll = () => {
|
|
121
357
|
if (selectAll) {
|
|
@@ -143,18 +379,20 @@ const CPIModal = ({
|
|
|
143
379
|
}
|
|
144
380
|
};
|
|
145
381
|
|
|
146
|
-
const handleSortByColumn = (column, order) => {
|
|
382
|
+
/* const handleSortByColumn = (column, order) => {
|
|
147
383
|
const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
|
|
148
384
|
const newData = sortingData(column, newOrder);
|
|
149
385
|
setData(newData);
|
|
150
386
|
setSortBy(column);
|
|
151
387
|
setSortOrder(newOrder);
|
|
152
|
-
};
|
|
388
|
+
}; */
|
|
153
389
|
|
|
154
390
|
const buttonContainer = {
|
|
155
391
|
display: 'flex',
|
|
156
392
|
justifyContent: 'center',
|
|
393
|
+
alignItems: 'center',
|
|
157
394
|
padding: '10px',
|
|
395
|
+
gap: '20px',
|
|
158
396
|
};
|
|
159
397
|
|
|
160
398
|
const addAllFilesButton = {
|
|
@@ -177,8 +415,10 @@ const CPIModal = ({
|
|
|
177
415
|
fontFamily: 'Poppins',
|
|
178
416
|
fontWeight: '600',
|
|
179
417
|
fontSize: '12px',
|
|
180
|
-
color: 'white',
|
|
418
|
+
color: selectedIds.length ? 'white' : '#666666',
|
|
181
419
|
lineHeight: '14px',
|
|
420
|
+
opacity: selectedIds.length ? 1 : 0.6,
|
|
421
|
+
cursor: selectedIds.length ? 'pointer' : 'not-allowed',
|
|
182
422
|
};
|
|
183
423
|
|
|
184
424
|
const goToCartButton = {
|
|
@@ -192,16 +432,42 @@ const CPIModal = ({
|
|
|
192
432
|
color: 'white',
|
|
193
433
|
};
|
|
194
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
|
+
|
|
195
461
|
const modalBody = {
|
|
196
462
|
position: 'absolute',
|
|
197
463
|
top: '5%',
|
|
198
464
|
left: '25%',
|
|
199
|
-
width: '
|
|
465
|
+
width: '880px',
|
|
200
466
|
height: '671px',
|
|
201
467
|
background: '#FFFFFF',
|
|
202
468
|
border: '1px solid #505050',
|
|
203
469
|
borderRadius: '40px',
|
|
204
|
-
overflow: '
|
|
470
|
+
overflow: 'visible',
|
|
205
471
|
};
|
|
206
472
|
|
|
207
473
|
const header = {
|
|
@@ -226,15 +492,15 @@ const CPIModal = ({
|
|
|
226
492
|
display: 'flex',
|
|
227
493
|
justifyContent: 'center',
|
|
228
494
|
alignItems: 'center',
|
|
229
|
-
height: '
|
|
495
|
+
height: '50px',
|
|
230
496
|
color: '#7D267E',
|
|
231
497
|
fontFamily: 'Nunito',
|
|
232
498
|
fontSize: '16px',
|
|
233
499
|
fontWeight: '400',
|
|
234
|
-
padding: '
|
|
235
|
-
paddingLeft: '35px',
|
|
236
|
-
paddingRight: '20px',
|
|
500
|
+
padding: '0 25px',
|
|
237
501
|
borderTop: '1px solid #505050',
|
|
502
|
+
textAlign: 'center',
|
|
503
|
+
lineHeight: '30px',
|
|
238
504
|
};
|
|
239
505
|
|
|
240
506
|
const link = {
|
|
@@ -242,9 +508,7 @@ const CPIModal = ({
|
|
|
242
508
|
fontFamily: 'Nunito',
|
|
243
509
|
fontSize: '16px',
|
|
244
510
|
fontWeight: '700',
|
|
245
|
-
|
|
246
|
-
top: '11.5px',
|
|
247
|
-
right: '39px',
|
|
511
|
+
textDecoration: 'underline',
|
|
248
512
|
};
|
|
249
513
|
|
|
250
514
|
const modalTitle = {
|
|
@@ -273,34 +537,20 @@ const CPIModal = ({
|
|
|
273
537
|
paddingLeft: '16px',
|
|
274
538
|
};
|
|
275
539
|
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
dataField: 'repository_of_synonym_id',
|
|
285
|
-
header: 'Name',
|
|
286
|
-
tooltipText: 'sort',
|
|
287
|
-
},
|
|
288
|
-
{
|
|
289
|
-
dataField: 'domain_description',
|
|
290
|
-
header: 'Description',
|
|
291
|
-
tooltipText: 'sort',
|
|
540
|
+
const tableContainer = {
|
|
541
|
+
'&::-webkit-scrollbar': {
|
|
542
|
+
width: '6px',
|
|
543
|
+
borderWidth: '0px 1px 1px 1px',
|
|
544
|
+
borderStyle: 'solid',
|
|
545
|
+
borderColor: '#B0B0B0',
|
|
292
546
|
},
|
|
293
|
-
{
|
|
294
|
-
|
|
295
|
-
header: 'Category',
|
|
296
|
-
tooltipText: 'sort',
|
|
547
|
+
'&::-webkit-scrollbar-track': {
|
|
548
|
+
backgroundColor: '#CECECE',
|
|
297
549
|
},
|
|
298
|
-
{
|
|
299
|
-
|
|
300
|
-
header: 'Location',
|
|
301
|
-
tooltipText: 'sort',
|
|
550
|
+
'&::-webkit-scrollbar-thumb': {
|
|
551
|
+
backgroundColor: '#003F74',
|
|
302
552
|
},
|
|
303
|
-
|
|
553
|
+
};
|
|
304
554
|
|
|
305
555
|
return (
|
|
306
556
|
<Modal
|
|
@@ -308,10 +558,10 @@ const CPIModal = ({
|
|
|
308
558
|
onClose={onClose}
|
|
309
559
|
aria-labelledby={`${row.id}-modal`}
|
|
310
560
|
>
|
|
311
|
-
<Box
|
|
561
|
+
<Box style={modalBody}>
|
|
312
562
|
<div className="header" style={header}>
|
|
313
563
|
<Typography id="modal-modal-title" className="modalTitle" style={modalTitle}>
|
|
314
|
-
{`Participant
|
|
564
|
+
{`Alternative Identifiers for Participant ${participantId} in ${studyId}`}
|
|
315
565
|
</Typography>
|
|
316
566
|
<IconButton
|
|
317
567
|
aria-label="close"
|
|
@@ -326,8 +576,7 @@ const CPIModal = ({
|
|
|
326
576
|
{`${data.length} mapped identifiers`}
|
|
327
577
|
</div>
|
|
328
578
|
<CustomTableContainer
|
|
329
|
-
|
|
330
|
-
themeConfig={themeConfig}
|
|
579
|
+
style={tableContainer}
|
|
331
580
|
>
|
|
332
581
|
<Table>
|
|
333
582
|
<TableHead>
|
|
@@ -344,9 +593,9 @@ const CPIModal = ({
|
|
|
344
593
|
displayColumns.map((column) => (
|
|
345
594
|
<HeaderCell
|
|
346
595
|
column={column}
|
|
347
|
-
sortBy={sortBy}
|
|
348
|
-
sortOrder={sortOrder}
|
|
349
|
-
toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
|
|
596
|
+
// sortBy={sortBy}
|
|
597
|
+
// sortOrder={sortOrder}
|
|
598
|
+
// toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
|
|
350
599
|
style={{ paddingLeft: '3px', paddingRight: '3px', fontWeight: '700' }}
|
|
351
600
|
/>
|
|
352
601
|
))
|
|
@@ -381,30 +630,144 @@ const CPIModal = ({
|
|
|
381
630
|
</Table>
|
|
382
631
|
</CustomTableContainer>
|
|
383
632
|
<div style={buttonContainer}>
|
|
384
|
-
<
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
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
|
+
|
|
394
686
|
<Button
|
|
395
|
-
style={
|
|
396
|
-
onClick={() =>
|
|
687
|
+
style={viewInExploreButton}
|
|
688
|
+
onClick={() => {
|
|
689
|
+
onClose();
|
|
690
|
+
navigation(`/explore?p_id=${participantId}&dbgap_accession=${studyId}`);
|
|
691
|
+
}}
|
|
692
|
+
disableRipple
|
|
397
693
|
>
|
|
398
|
-
|
|
399
|
-
<img src={cartIcon} alt="cart" style={{ paddingLeft: '30px' }} />
|
|
694
|
+
VIEW IN EXPLORE
|
|
400
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>
|
|
401
756
|
</div>
|
|
402
757
|
<div className="footer" style={footer}>
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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>
|
|
408
771
|
</div>
|
|
409
772
|
</Box>
|
|
410
773
|
</Modal>
|