@bento-core/table 1.0.1-ccdihub.8 → 1.0.1-ccdihub.80
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 +23 -14
- package/dist/TableView.js +73 -6
- package/dist/body/CustomTblBody.js +2 -1
- package/dist/body/DisplayBodyCell.js +13 -3
- package/dist/body/components/CPIModal.js +187 -0
- package/dist/body/components/CPIView.js +115 -0
- package/dist/body/components/ModalStyle.js +107 -0
- package/dist/body/components/assets/CPI_icon.svg +22 -0
- package/dist/header/ActionHeaderCell.js +2 -1
- package/dist/header/CustomCell.js +8 -6
- package/dist/header/components/CheckBoxView.js +8 -3
- package/dist/index.js +6 -0
- package/dist/pagination/CustomPagination.js +11 -2
- package/dist/toolbar/DownloadButtonView.js +169 -7
- package/dist/toolbar/ManageColumnView.js +11 -3
- package/dist/util/Dataformat.js +41 -1
- package/dist/util/Types.js +22 -2
- package/dist/util/downloadTable.js +196 -0
- package/package.json +4 -1
- package/src/ExtendedView.js +34 -21
- package/src/TableView.js +119 -52
- package/src/body/CustomTblBody.js +1 -0
- package/src/body/DisplayBodyCell.js +12 -0
- package/src/body/components/CPIModal.js +227 -0
- package/src/body/components/CPIView.js +133 -0
- package/src/body/components/ModalStyle.js +101 -0
- package/src/body/components/assets/CPI_icon.svg +22 -0
- package/src/header/ActionHeaderCell.js +1 -1
- package/src/header/CustomCell.js +11 -1
- package/src/header/components/CheckBoxView.js +3 -1
- package/src/index.js +1 -0
- package/src/pagination/CustomPagination.js +4 -1
- package/src/toolbar/DownloadButtonView.js +178 -10
- package/src/toolbar/ManageColumnView.js +3 -3
- package/src/util/Dataformat.js +25 -0
- package/src/util/Types.js +15 -0
- package/src/util/downloadTable.js +138 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/table",
|
|
3
|
-
"version": "1.0.1-ccdihub.
|
|
3
|
+
"version": "1.0.1-ccdihub.80",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "npm run lint && cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
|
|
@@ -28,5 +28,8 @@
|
|
|
28
28
|
"url": "https://github.com/CBIIT/bento-frontend/issues"
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/CBIIT/bento-frontend#readme",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@apollo/client": "^3.8.3"
|
|
33
|
+
},
|
|
31
34
|
"description": ""
|
|
32
35
|
}
|
package/src/ExtendedView.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
ThemeProvider,
|
|
4
|
-
Toolbar,
|
|
5
4
|
createTheme,
|
|
6
5
|
} from '@material-ui/core';
|
|
7
6
|
import CustomPagination from './pagination/CustomPagination';
|
|
@@ -9,20 +8,25 @@ import ManageColumnView from './toolbar/ManageColumnView';
|
|
|
9
8
|
import defaultTheme from './DefaultThemConfig';
|
|
10
9
|
import DownloadButton from './toolbar/DownloadButtonView';
|
|
11
10
|
|
|
11
|
+
const downloadAreaStyle = {
|
|
12
|
+
display: 'flex',
|
|
13
|
+
borderTop: '1px solid #8A7F7C',
|
|
14
|
+
paddingRight: '41px',
|
|
15
|
+
};
|
|
16
|
+
|
|
12
17
|
const ExtendedView = ({
|
|
13
18
|
table,
|
|
14
19
|
onColumnViewChange,
|
|
15
20
|
onRowsPerPageChange,
|
|
16
21
|
onPageChange,
|
|
17
|
-
numSelected = 0,
|
|
18
22
|
customTheme,
|
|
23
|
+
queryVariables,
|
|
19
24
|
}) => {
|
|
20
25
|
const { extendedViewConfig } = table;
|
|
21
26
|
if (!extendedViewConfig) {
|
|
22
27
|
return null;
|
|
23
28
|
}
|
|
24
29
|
const {
|
|
25
|
-
download = false,
|
|
26
30
|
manageViewColumns = false,
|
|
27
31
|
pagination = false,
|
|
28
32
|
} = extendedViewConfig;
|
|
@@ -30,30 +34,39 @@ const ExtendedView = ({
|
|
|
30
34
|
const themeConfig = createTheme({ overrides: { ...defaultTheme(), ...customTheme } });
|
|
31
35
|
return (
|
|
32
36
|
<ThemeProvider theme={themeConfig}>
|
|
33
|
-
{(numSelected === 0 && (download || manageViewColumns)) && (
|
|
37
|
+
{/* {(numSelected === 0 && (download || manageViewColumns)) && (
|
|
34
38
|
<Toolbar className="downloadColumnView">
|
|
35
|
-
|
|
39
|
+
<DownloadButton
|
|
36
40
|
download={download}
|
|
37
41
|
/>
|
|
38
|
-
<ManageColumnView
|
|
39
|
-
table={table}
|
|
40
|
-
manageViewColumns={manageViewColumns}
|
|
41
|
-
onColumnViewChange={onColumnViewChange}
|
|
42
|
-
/>
|
|
43
42
|
</Toolbar>
|
|
44
|
-
)}
|
|
43
|
+
)} */}
|
|
45
44
|
{
|
|
46
45
|
(pagination) && (
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
<div className="downloadArea" style={downloadAreaStyle}>
|
|
47
|
+
<CustomPagination
|
|
48
|
+
customTheme={customTheme.tblTopPgn}
|
|
49
|
+
rowsPerPageOptions={[10, 25, 50, 100]}
|
|
50
|
+
component="div"
|
|
51
|
+
count={table.totalRowCount || 0}
|
|
52
|
+
rowsPerPage={table.rowsPerPage || 10}
|
|
53
|
+
page={table.page || 0}
|
|
54
|
+
onPageChange={onPageChange}
|
|
55
|
+
onRowsPerPageChange={onRowsPerPageChange}
|
|
56
|
+
queryVariables={queryVariables}
|
|
57
|
+
table={table}
|
|
58
|
+
/>
|
|
59
|
+
<DownloadButton
|
|
60
|
+
count={table.totalRowCount || 0}
|
|
61
|
+
queryVariables={queryVariables}
|
|
62
|
+
table={table}
|
|
63
|
+
/>
|
|
64
|
+
<ManageColumnView
|
|
65
|
+
table={table}
|
|
66
|
+
manageViewColumns={manageViewColumns}
|
|
67
|
+
onColumnViewChange={onColumnViewChange}
|
|
68
|
+
/>
|
|
69
|
+
</div>
|
|
57
70
|
)
|
|
58
71
|
}
|
|
59
72
|
</ThemeProvider>
|
package/src/TableView.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Paper,
|
|
4
4
|
Table,
|
|
@@ -12,19 +12,46 @@ import CustomTableBody from './body/CustomTblBody';
|
|
|
12
12
|
import CustomToolbar from './toolbar/CustomToolbar';
|
|
13
13
|
import DisplayErrMsg from './errMsg/DisplayErrMsg';
|
|
14
14
|
import ExtendedView from './ExtendedView';
|
|
15
|
+
import DownloadButton from './toolbar/DownloadButtonView';
|
|
16
|
+
import ManageColumnView from './toolbar/ManageColumnView';
|
|
15
17
|
|
|
16
18
|
const CustomTableContainer = (props) => {
|
|
17
19
|
const { children, customTheme } = props;
|
|
18
20
|
const themeConfig = createTheme({ overrides: { ...customTheme } });
|
|
19
21
|
return (
|
|
20
22
|
<ThemeProvider theme={themeConfig}>
|
|
21
|
-
<TableContainer component={Paper}>
|
|
23
|
+
<TableContainer id="tableContainer" component={Paper}>
|
|
22
24
|
{children}
|
|
23
25
|
</TableContainer>
|
|
24
26
|
</ThemeProvider>
|
|
25
27
|
);
|
|
26
28
|
};
|
|
27
29
|
|
|
30
|
+
const downloadAreaStyle = {
|
|
31
|
+
display: 'flex',
|
|
32
|
+
borderTop: '1px solid #8A7F7C',
|
|
33
|
+
borderBottom: '1px solid #8A7F7C',
|
|
34
|
+
paddingRight: '41px',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const cartDownloadAreaStyle = {
|
|
38
|
+
display: 'flex',
|
|
39
|
+
borderTop: '5px solid #e7e5e5',
|
|
40
|
+
borderBottom: '3px solid #e7e5e5',
|
|
41
|
+
paddingRight: '40px',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const addScrollContainerStyle = {
|
|
45
|
+
overflowX: 'auto',
|
|
46
|
+
overflowY: 'hidden',
|
|
47
|
+
width: '100%',
|
|
48
|
+
height: '14px',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const addScrollStyle = {
|
|
52
|
+
height: '14px',
|
|
53
|
+
};
|
|
54
|
+
|
|
28
55
|
const TableView = ({
|
|
29
56
|
tableRows = [],
|
|
30
57
|
table,
|
|
@@ -36,59 +63,99 @@ const TableView = ({
|
|
|
36
63
|
onSortByColumn,
|
|
37
64
|
onColumnViewChange,
|
|
38
65
|
themeConfig = {},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
66
|
+
queryVariables,
|
|
67
|
+
}) => {
|
|
68
|
+
useEffect(() => {
|
|
69
|
+
const tableContainer = document.getElementById('tableContainer');
|
|
70
|
+
const addScrollContainer = document.getElementById('addScrollContainer');
|
|
71
|
+
const targetTable = tableContainer.firstChild;
|
|
72
|
+
const addScroll = addScrollContainer.firstChild;
|
|
73
|
+
const tableWidth = targetTable.clientWidth;
|
|
74
|
+
addScroll.style.width = `${tableWidth}px`;
|
|
75
|
+
tableContainer.onscroll = () => {
|
|
76
|
+
addScrollContainer.scrollLeft = tableContainer.scrollLeft;
|
|
77
|
+
};
|
|
78
|
+
addScrollContainer.onscroll = () => {
|
|
79
|
+
tableContainer.scrollLeft = addScrollContainer.scrollLeft;
|
|
80
|
+
};
|
|
81
|
+
if (!(tableWidth > tableContainer.clientWidth)) {
|
|
82
|
+
addScrollContainer.style.height = '0px';
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const { extendedViewConfig } = table;
|
|
86
|
+
const {
|
|
87
|
+
manageViewColumns = false,
|
|
88
|
+
} = extendedViewConfig;
|
|
89
|
+
return (
|
|
90
|
+
<>
|
|
91
|
+
<ExtendedView
|
|
92
|
+
table={table}
|
|
93
|
+
onColumnViewChange={onColumnViewChange}
|
|
94
|
+
onRowsPerPageChange={onRowsPerPageChange}
|
|
95
|
+
onPageChange={onPageChange}
|
|
96
|
+
numSelected={table?.selectedRows?.length || 0}
|
|
97
|
+
customTheme={themeConfig.extendedView}
|
|
98
|
+
queryVariables={queryVariables}
|
|
99
|
+
/>
|
|
100
|
+
<CustomToolbar
|
|
101
|
+
numSelected={table?.selectedRows?.length || 0}
|
|
102
|
+
table={table}
|
|
103
|
+
onColumnViewChange={onColumnViewChange}
|
|
104
|
+
customTheme={themeConfig.toolbar}
|
|
105
|
+
/>
|
|
106
|
+
<CustomTableContainer
|
|
107
|
+
customTheme={themeConfig.tblContainer || {}}
|
|
108
|
+
>
|
|
109
|
+
<Table>
|
|
110
|
+
<TableHeader
|
|
111
|
+
customTheme={themeConfig.tblHeader}
|
|
112
|
+
table={table}
|
|
113
|
+
rows={tableRows}
|
|
114
|
+
count={totalRowCount}
|
|
115
|
+
toggleSelectAll={onToggleSelectAll}
|
|
116
|
+
sortByColumn={onSortByColumn}
|
|
117
|
+
/>
|
|
118
|
+
<CustomTableBody
|
|
119
|
+
customTheme={themeConfig.tblBody}
|
|
120
|
+
rows={tableRows}
|
|
121
|
+
table={table}
|
|
122
|
+
onRowSelectChange={onRowSelectChange}
|
|
123
|
+
/>
|
|
124
|
+
</Table>
|
|
125
|
+
</CustomTableContainer>
|
|
126
|
+
<div id="addScrollContainer" style={addScrollContainerStyle}>
|
|
127
|
+
<div style={addScrollStyle} />
|
|
128
|
+
</div>
|
|
129
|
+
{tableRows.length === 0 && (
|
|
130
|
+
<DisplayErrMsg
|
|
131
|
+
customTheme={themeConfig.displayErr}
|
|
61
132
|
table={table}
|
|
62
|
-
rows={tableRows}
|
|
63
|
-
count={totalRowCount}
|
|
64
|
-
toggleSelectAll={onToggleSelectAll}
|
|
65
|
-
sortByColumn={onSortByColumn}
|
|
66
133
|
/>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
134
|
+
)}
|
|
135
|
+
<div className="downloadArea" style={table.paginationAPIField === 'filesInList' ? cartDownloadAreaStyle : downloadAreaStyle}>
|
|
136
|
+
<CustomPagination
|
|
137
|
+
customTheme={themeConfig.tblPgn}
|
|
138
|
+
rowsPerPageOptions={[10, 25, 50, 100]}
|
|
139
|
+
component="div"
|
|
140
|
+
count={table.totalRowCount || 0}
|
|
141
|
+
rowsPerPage={table.rowsPerPage || 10}
|
|
142
|
+
page={table.page || 0}
|
|
143
|
+
onPageChange={onPageChange}
|
|
144
|
+
onRowsPerPageChange={onRowsPerPageChange}
|
|
145
|
+
/>
|
|
146
|
+
<DownloadButton
|
|
147
|
+
count={table.totalRowCount || 0}
|
|
148
|
+
queryVariables={queryVariables}
|
|
70
149
|
table={table}
|
|
71
|
-
onRowSelectChange={onRowSelectChange}
|
|
72
150
|
/>
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
customTheme={themeConfig.tblPgn}
|
|
83
|
-
rowsPerPageOptions={[10, 25, 50, 100]}
|
|
84
|
-
component="div"
|
|
85
|
-
count={table.totalRowCount || 0}
|
|
86
|
-
rowsPerPage={table.rowsPerPage || 10}
|
|
87
|
-
page={table.page || 0}
|
|
88
|
-
onPageChange={onPageChange}
|
|
89
|
-
onRowsPerPageChange={onRowsPerPageChange}
|
|
90
|
-
/>
|
|
91
|
-
</>
|
|
92
|
-
);
|
|
151
|
+
<ManageColumnView
|
|
152
|
+
table={table}
|
|
153
|
+
manageViewColumns={manageViewColumns}
|
|
154
|
+
onColumnViewChange={onColumnViewChange}
|
|
155
|
+
/>
|
|
156
|
+
</div>
|
|
157
|
+
</>
|
|
158
|
+
);
|
|
159
|
+
};
|
|
93
160
|
|
|
94
161
|
export default TableView;
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import { cellTypes } from '../util/Types';
|
|
7
7
|
import CustomLinkView from './components/CustomLinkView';
|
|
8
8
|
import DataFormatView from './components/DataFormatView';
|
|
9
|
+
import CPIView from './components/CPIView';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* Custom Column reneder
|
|
@@ -29,6 +30,7 @@ const CustomComponent = ({
|
|
|
29
30
|
const ViewCell = ({
|
|
30
31
|
column,
|
|
31
32
|
row,
|
|
33
|
+
themeConfig,
|
|
32
34
|
}) => {
|
|
33
35
|
const { cellType } = column;
|
|
34
36
|
switch (cellType) {
|
|
@@ -53,6 +55,14 @@ const ViewCell = ({
|
|
|
53
55
|
column={column}
|
|
54
56
|
/>
|
|
55
57
|
);
|
|
58
|
+
case cellTypes.CPI:
|
|
59
|
+
return (
|
|
60
|
+
<CPIView
|
|
61
|
+
row={row}
|
|
62
|
+
column={column}
|
|
63
|
+
themeConfig={themeConfig}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
56
66
|
default:
|
|
57
67
|
return (
|
|
58
68
|
<Typography>
|
|
@@ -65,11 +75,13 @@ const ViewCell = ({
|
|
|
65
75
|
const DisplayCell = ({
|
|
66
76
|
row,
|
|
67
77
|
column,
|
|
78
|
+
themeConfig,
|
|
68
79
|
}) => (
|
|
69
80
|
<TableCell className={column.dataField}>
|
|
70
81
|
<ViewCell
|
|
71
82
|
row={row}
|
|
72
83
|
column={column}
|
|
84
|
+
themeConfig={themeConfig}
|
|
73
85
|
/>
|
|
74
86
|
</TableCell>
|
|
75
87
|
);
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Box,
|
|
4
|
+
Modal,
|
|
5
|
+
Typography,
|
|
6
|
+
IconButton,
|
|
7
|
+
Paper,
|
|
8
|
+
Table,
|
|
9
|
+
TableContainer,
|
|
10
|
+
ThemeProvider,
|
|
11
|
+
createTheme,
|
|
12
|
+
TableHead,
|
|
13
|
+
TableRow,
|
|
14
|
+
TableCell,
|
|
15
|
+
TableBody,
|
|
16
|
+
} from '@material-ui/core';
|
|
17
|
+
// import CustomTableBody from '../../body/CustomTblBody';
|
|
18
|
+
import CloseIcon from '@material-ui/icons/Close';
|
|
19
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
20
|
+
import styles from './ModalStyle';
|
|
21
|
+
// import TableHeader from '../../header/CustomTblHeader';
|
|
22
|
+
import HeaderCell from '../../header/CustomCell';
|
|
23
|
+
|
|
24
|
+
const CustomTableContainer = (props) => {
|
|
25
|
+
const { children, customTheme } = props;
|
|
26
|
+
const themeConfig = createTheme({ overrides: { ...customTheme } });
|
|
27
|
+
return (
|
|
28
|
+
<ThemeProvider theme={themeConfig}>
|
|
29
|
+
<TableContainer id="tableContainer" component={Paper}>
|
|
30
|
+
{children}
|
|
31
|
+
</TableContainer>
|
|
32
|
+
</ThemeProvider>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const CPIModal = ({
|
|
37
|
+
open,
|
|
38
|
+
onClose,
|
|
39
|
+
row,
|
|
40
|
+
themeConfig = {},
|
|
41
|
+
}) => {
|
|
42
|
+
const [sortBy, setSortBy] = useState('associated_id');
|
|
43
|
+
const [sortOrder, setSortOrder] = useState('asc');
|
|
44
|
+
const [data, setData] = useState(() => {
|
|
45
|
+
const result = row.cpi_data;
|
|
46
|
+
return result;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const sortingData = (column, newOrder) => {
|
|
50
|
+
const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
|
|
51
|
+
|
|
52
|
+
if (newOrder === 'desc') {
|
|
53
|
+
return sortedData.reverse();
|
|
54
|
+
}
|
|
55
|
+
return sortedData;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const handleSortByColumn = (column, order) => {
|
|
59
|
+
const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
|
|
60
|
+
const newData = sortingData(column, newOrder);
|
|
61
|
+
setData(newData);
|
|
62
|
+
setSortBy(column);
|
|
63
|
+
setSortOrder(newOrder);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const modalBody = {
|
|
67
|
+
position: 'absolute',
|
|
68
|
+
top: '5%',
|
|
69
|
+
left: '25%',
|
|
70
|
+
width: '836px',
|
|
71
|
+
height: '671px',
|
|
72
|
+
background: '#FFFFFF',
|
|
73
|
+
border: '1px solid #505050',
|
|
74
|
+
borderRadius: '40px',
|
|
75
|
+
overflow: 'hidden',
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const header = {
|
|
79
|
+
display: 'flex',
|
|
80
|
+
justifyContent: 'center',
|
|
81
|
+
alignItems: 'center',
|
|
82
|
+
height: '55px',
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const footer = {
|
|
86
|
+
display: 'flex',
|
|
87
|
+
justifyContent: 'center',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
height: '55px',
|
|
90
|
+
color: '#7D267E',
|
|
91
|
+
fontFamily: 'Nunito',
|
|
92
|
+
fontSize: '16px',
|
|
93
|
+
fontWeight: '400',
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const link = {
|
|
97
|
+
color: '#7D267E',
|
|
98
|
+
fontFamily: 'Nunito',
|
|
99
|
+
fontSize: '16px',
|
|
100
|
+
fontWeight: '700',
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const modalTitle = {
|
|
104
|
+
fontFamily: 'Poppins',
|
|
105
|
+
fontSize: '19px',
|
|
106
|
+
fontWeight: '400',
|
|
107
|
+
lineHeight: '21px',
|
|
108
|
+
letterSpacing: '0.02em',
|
|
109
|
+
textAlign: 'center',
|
|
110
|
+
color: '#000000',
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const closeButton = {
|
|
114
|
+
marginLeft: '769px',
|
|
115
|
+
position: 'absolute',
|
|
116
|
+
backgroundColor: 'transparent',
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const countContainer = {
|
|
120
|
+
display: 'flex',
|
|
121
|
+
justifyContent: 'left',
|
|
122
|
+
alignItems: 'center',
|
|
123
|
+
borderTop: '3px solid #939393',
|
|
124
|
+
borderBottom: '3px solid #939393',
|
|
125
|
+
height: '51px',
|
|
126
|
+
paddingLeft: '16px',
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const participantId = row.participant_id;
|
|
130
|
+
const displayColumns = [
|
|
131
|
+
{
|
|
132
|
+
dataField: 'associated_id',
|
|
133
|
+
header: 'Participant ID',
|
|
134
|
+
tooltipText: 'sort',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
dataField: 'repository_of_synonym_id',
|
|
138
|
+
header: 'Name',
|
|
139
|
+
tooltipText: 'sort',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
dataField: 'domain_description',
|
|
143
|
+
header: 'Description',
|
|
144
|
+
tooltipText: 'sort',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
dataField: 'domain_category',
|
|
148
|
+
header: 'Category',
|
|
149
|
+
tooltipText: 'sort',
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
dataField: 'data_location',
|
|
153
|
+
header: 'Location',
|
|
154
|
+
tooltipText: 'sort',
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<Modal
|
|
160
|
+
open={open}
|
|
161
|
+
onClose={onClose}
|
|
162
|
+
aria-labelledby={`${row.id}-modal`}
|
|
163
|
+
>
|
|
164
|
+
<Box className="modalBody" style={modalBody}>
|
|
165
|
+
<div className="header" style={header}>
|
|
166
|
+
<Typography id="modal-modal-title" className="modalTitle" style={modalTitle}>
|
|
167
|
+
{`Participant ID ${participantId} : CPI Mappings`}
|
|
168
|
+
</Typography>
|
|
169
|
+
<IconButton
|
|
170
|
+
aria-label="close"
|
|
171
|
+
onClick={onClose}
|
|
172
|
+
className="closeButton"
|
|
173
|
+
style={closeButton}
|
|
174
|
+
>
|
|
175
|
+
<CloseIcon fontSize="small" />
|
|
176
|
+
</IconButton>
|
|
177
|
+
</div>
|
|
178
|
+
<div className="container" style={countContainer}>
|
|
179
|
+
{`${data.length} mapped identifiers`}
|
|
180
|
+
</div>
|
|
181
|
+
<CustomTableContainer
|
|
182
|
+
customTheme={themeConfig.tblContainer || {}}
|
|
183
|
+
>
|
|
184
|
+
<Table>
|
|
185
|
+
<TableHead>
|
|
186
|
+
<TableRow>
|
|
187
|
+
{
|
|
188
|
+
displayColumns.map((column) => (
|
|
189
|
+
<HeaderCell
|
|
190
|
+
column={column}
|
|
191
|
+
sortBy={sortBy}
|
|
192
|
+
sortOrder={sortOrder}
|
|
193
|
+
toggleSort={() => handleSortByColumn(column.dataField, sortOrder)}
|
|
194
|
+
/>
|
|
195
|
+
))
|
|
196
|
+
}
|
|
197
|
+
</TableRow>
|
|
198
|
+
</TableHead>
|
|
199
|
+
<TableBody>
|
|
200
|
+
{
|
|
201
|
+
data.map((currRow) => (
|
|
202
|
+
<TableRow>
|
|
203
|
+
{
|
|
204
|
+
displayColumns.map((column) => (
|
|
205
|
+
(
|
|
206
|
+
column.dataField !== 'data_location'
|
|
207
|
+
? <TableCell>{currRow[column.dataField]}</TableCell>
|
|
208
|
+
: <TableCell><a href={currRow[column.dataField]} target="_blank" rel="noopener noreferrer">{currRow[column.dataField]}</a></TableCell>
|
|
209
|
+
)
|
|
210
|
+
))
|
|
211
|
+
}
|
|
212
|
+
</TableRow>
|
|
213
|
+
))
|
|
214
|
+
}
|
|
215
|
+
</TableBody>
|
|
216
|
+
</Table>
|
|
217
|
+
</CustomTableContainer>
|
|
218
|
+
<div className="footer" style={footer}>
|
|
219
|
+
To learn more about CPI click
|
|
220
|
+
<a style={link} href="https://participantindex-docs.ccdi.cancer.gov/" target="_blank" rel="noopener noreferrer">here</a>
|
|
221
|
+
</div>
|
|
222
|
+
</Box>
|
|
223
|
+
</Modal>
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export default withStyles(styles)(CPIModal);
|