@bento-core/table 1.0.1-ccdihub.90 → 1.0.1-ccdihub.92
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/DefaultThemConfig.js +1 -1
- package/dist/ExtendedView.js +7 -5
- package/dist/TableView.js +11 -6
- package/dist/body/CustomTblBody.js +4 -2
- package/dist/body/DisplayBodyCell.js +8 -4
- package/dist/body/components/CPIModal.js +154 -7
- package/dist/body/components/CPIView.js +4 -2
- package/dist/body/components/assets/Cart_Icon.svg +3 -0
- package/dist/body/components/assets/Question_Icon.svg +4 -0
- package/dist/toolbar/DownloadButtonView.js +24 -14
- package/dist/toolbar/ManageColumnView.js +154 -41
- package/dist/toolbar/assets/Hidden_Column.svg +4 -0
- package/dist/toolbar/assets/View_Columns.svg +6 -0
- package/dist/wrapper/WrapperService.js +36 -0
- package/dist/wrapper/components/AddFiles.js +63 -0
- package/dist/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +35 -0
- package/dist/wrapper/components/AddToCartDialog/AddToCartDialogController.js +36 -0
- package/dist/wrapper/components/AddToCartDialog/AddToCartDialogView.js +43 -0
- package/dist/wrapper/components/CPIFilesView/CPIFilesView.js +178 -0
- package/dist/wrapper/components/ReduxAddFile.js +27 -0
- package/dist/wrapper/components/Snackbar/Snackbar.js +40 -0
- package/dist/wrapper/components/Snackbar/SnackbarRedux.js +16 -0
- package/dist/wrapper/components/Snackbar/SuccessOutlined.js +17 -0
- package/dist/wrapper/components/TextFieldView.js +37 -0
- package/dist/wrapper/components/TooltipView.js +40 -0
- package/package.json +8 -2
- package/src/DefaultThemConfig.js +1 -1
- package/src/ExtendedView.js +8 -6
- package/src/TableView.js +10 -5
- package/src/body/CustomTblBody.js +2 -0
- package/src/body/DisplayBodyCell.js +4 -0
- package/src/body/components/CPIModal.js +163 -1
- package/src/body/components/CPIView.js +2 -0
- package/src/body/components/assets/Cart_Icon.svg +3 -0
- package/src/body/components/assets/Question_Icon.svg +4 -0
- package/src/toolbar/DownloadButtonView.js +15 -12
- package/src/toolbar/ManageColumnView.js +163 -44
- package/src/toolbar/assets/Hidden_Column.svg +4 -0
- package/src/toolbar/assets/View_Columns.svg +6 -0
- package/src/wrapper/WrapperService.js +25 -0
- package/src/wrapper/components/AddFiles.js +62 -0
- package/src/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +37 -0
- package/src/wrapper/components/AddToCartDialog/AddToCartDialogController.js +32 -0
- package/src/wrapper/components/AddToCartDialog/AddToCartDialogView.js +57 -0
- package/src/wrapper/components/CPIFilesView/CPIFilesView.js +190 -0
- package/src/wrapper/components/ReduxAddFile.js +20 -0
- package/src/wrapper/components/Snackbar/Snackbar.js +43 -0
- package/src/wrapper/components/Snackbar/SnackbarRedux.js +11 -0
- package/src/wrapper/components/Snackbar/SuccessOutlined.js +10 -0
- package/src/wrapper/components/TextFieldView.js +32 -0
- package/src/wrapper/components/TooltipView.js +35 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _core = require("@material-ui/core");
|
|
9
|
+
var _SuccessOutlined = _interopRequireDefault(require("./SuccessOutlined"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const SnackbarView = props => {
|
|
12
|
+
const {
|
|
13
|
+
count,
|
|
14
|
+
open,
|
|
15
|
+
onClose
|
|
16
|
+
} = props;
|
|
17
|
+
if (open) {
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
onClose();
|
|
20
|
+
}, 3000);
|
|
21
|
+
}
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.Snackbar, {
|
|
23
|
+
className: "snackBar",
|
|
24
|
+
open: open,
|
|
25
|
+
autoHideDuration: 3000,
|
|
26
|
+
anchorOrigin: {
|
|
27
|
+
vertical: 'bottom',
|
|
28
|
+
horizontal: 'right'
|
|
29
|
+
},
|
|
30
|
+
message: /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
+
className: "snackBarMessage"
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
33
|
+
className: "snackBarMessageIcon"
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_SuccessOutlined.default, null), ' '), /*#__PURE__*/_react.default.createElement("span", {
|
|
35
|
+
className: "snackBarText"
|
|
36
|
+
}, count, ' ', "File(s) successfully added to your cart"))
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
var _default = SnackbarView;
|
|
40
|
+
exports.default = _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactRedux = require("react-redux");
|
|
9
|
+
var _Snackbar = _interopRequireDefault(require("./Snackbar"));
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const ReduxSnackbar = props => /*#__PURE__*/_react.default.createElement(_Snackbar.default, props);
|
|
12
|
+
const mapStateToProps = state => ({
|
|
13
|
+
count: state.cartReducer.count
|
|
14
|
+
});
|
|
15
|
+
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(ReduxSnackbar);
|
|
16
|
+
exports.default = _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _util = require("@bento-core/util");
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
/**
|
|
12
|
+
* @ignore - internal component.
|
|
13
|
+
*/
|
|
14
|
+
var _default = (0, _util.createSvgIcon)( /*#__PURE__*/React.createElement("path", {
|
|
15
|
+
d: "M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"
|
|
16
|
+
}), 'SuccessOutlined');
|
|
17
|
+
exports.default = _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _cart = require("@bento-core/cart");
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
const TextFieldView = _ref => {
|
|
12
|
+
let {
|
|
13
|
+
clsName,
|
|
14
|
+
placeholder
|
|
15
|
+
} = _ref;
|
|
16
|
+
const [text, setText] = (0, _react.useState)('');
|
|
17
|
+
const cartContext = (0, _react.useContext)(_cart.CartContext);
|
|
18
|
+
const {
|
|
19
|
+
context
|
|
20
|
+
} = cartContext;
|
|
21
|
+
const {
|
|
22
|
+
dispatch
|
|
23
|
+
} = context;
|
|
24
|
+
(0, _react.useEffect)(() => {
|
|
25
|
+
dispatch((0, _cart.onCommentChange)(text));
|
|
26
|
+
}, [text]);
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement("textarea", {
|
|
28
|
+
onChange: e => {
|
|
29
|
+
setText("".concat(e.target.value));
|
|
30
|
+
},
|
|
31
|
+
className: clsName,
|
|
32
|
+
placeholder: placeholder,
|
|
33
|
+
id: "multiline-user-coments"
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
var _default = TextFieldView;
|
|
37
|
+
exports.default = _default;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _toolTip = _interopRequireDefault(require("@bento-core/tool-tip"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
/**
|
|
11
|
+
* customize tooltips based on tooltipContent
|
|
12
|
+
* defined on dashboardTabData (tooltipContent)
|
|
13
|
+
*/
|
|
14
|
+
const ToolTipView = props => {
|
|
15
|
+
const {
|
|
16
|
+
section,
|
|
17
|
+
tooltipCofig,
|
|
18
|
+
classes
|
|
19
|
+
} = props;
|
|
20
|
+
const {
|
|
21
|
+
icon,
|
|
22
|
+
alt,
|
|
23
|
+
arrow = false,
|
|
24
|
+
clsName
|
|
25
|
+
} = tooltipCofig;
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_toolTip.default, {
|
|
27
|
+
title: tooltipCofig[section],
|
|
28
|
+
arrow: arrow,
|
|
29
|
+
classes: {
|
|
30
|
+
tooltip: classes.customTooltip,
|
|
31
|
+
arrow: classes.customArrow
|
|
32
|
+
}
|
|
33
|
+
}, icon && /*#__PURE__*/_react.default.createElement("img", {
|
|
34
|
+
src: icon,
|
|
35
|
+
alt: alt,
|
|
36
|
+
className: clsName
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
var _default = ToolTipView;
|
|
40
|
+
exports.default = _default;
|
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.92",
|
|
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",
|
|
@@ -29,7 +29,13 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/CBIIT/bento-frontend#readme",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@apollo/client": "^3.8.3"
|
|
32
|
+
"@apollo/client": "^3.8.3",
|
|
33
|
+
"@bento-core/cart": "^1.0.1-ccdihub.9",
|
|
34
|
+
"@bento-core/tool-tip": "^1.0.0",
|
|
35
|
+
"@bento-core/util": "^1.0.1-ccdihub.1",
|
|
36
|
+
"clsx": "^2.1.1",
|
|
37
|
+
"graphql-tag": "^2.12.6",
|
|
38
|
+
"react-router-dom": "^5.1.2"
|
|
33
39
|
},
|
|
34
40
|
"devDependencies": {},
|
|
35
41
|
"description": ""
|
package/src/DefaultThemConfig.js
CHANGED
package/src/ExtendedView.js
CHANGED
|
@@ -11,12 +11,13 @@ import DownloadButton from './toolbar/DownloadButtonView';
|
|
|
11
11
|
const downloadAreaStyle = {
|
|
12
12
|
display: 'flex',
|
|
13
13
|
borderTop: '1px solid #8A7F7C',
|
|
14
|
-
paddingRight: '
|
|
14
|
+
paddingRight: '48px',
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const ExtendedView = ({
|
|
18
18
|
table,
|
|
19
19
|
onColumnViewChange,
|
|
20
|
+
onAllColumnViewChange,
|
|
20
21
|
onRowsPerPageChange,
|
|
21
22
|
onPageChange,
|
|
22
23
|
customTheme,
|
|
@@ -56,15 +57,16 @@ const ExtendedView = ({
|
|
|
56
57
|
queryVariables={queryVariables}
|
|
57
58
|
table={table}
|
|
58
59
|
/>
|
|
59
|
-
<DownloadButton
|
|
60
|
-
count={table.totalRowCount || 0}
|
|
61
|
-
queryVariables={queryVariables}
|
|
62
|
-
table={table}
|
|
63
|
-
/>
|
|
64
60
|
<ManageColumnView
|
|
65
61
|
table={table}
|
|
66
62
|
manageViewColumns={manageViewColumns}
|
|
67
63
|
onColumnViewChange={onColumnViewChange}
|
|
64
|
+
onAllColumnViewChange={onAllColumnViewChange}
|
|
65
|
+
/>
|
|
66
|
+
<DownloadButton
|
|
67
|
+
count={table.totalRowCount || 0}
|
|
68
|
+
queryVariables={queryVariables}
|
|
69
|
+
table={table}
|
|
68
70
|
/>
|
|
69
71
|
</div>
|
|
70
72
|
)
|
package/src/TableView.js
CHANGED
|
@@ -62,8 +62,10 @@ const TableView = ({
|
|
|
62
62
|
totalRowCount,
|
|
63
63
|
onSortByColumn,
|
|
64
64
|
onColumnViewChange,
|
|
65
|
+
onAllColumnViewChange,
|
|
65
66
|
themeConfig = {},
|
|
66
67
|
queryVariables,
|
|
68
|
+
navigation,
|
|
67
69
|
}) => {
|
|
68
70
|
useEffect(() => {
|
|
69
71
|
const tableContainer = document.getElementById('tableContainer');
|
|
@@ -91,6 +93,7 @@ const TableView = ({
|
|
|
91
93
|
<ExtendedView
|
|
92
94
|
table={table}
|
|
93
95
|
onColumnViewChange={onColumnViewChange}
|
|
96
|
+
onAllColumnViewChange={onAllColumnViewChange}
|
|
94
97
|
onRowsPerPageChange={onRowsPerPageChange}
|
|
95
98
|
onPageChange={onPageChange}
|
|
96
99
|
numSelected={table?.selectedRows?.length || 0}
|
|
@@ -120,6 +123,7 @@ const TableView = ({
|
|
|
120
123
|
rows={tableRows}
|
|
121
124
|
table={table}
|
|
122
125
|
onRowSelectChange={onRowSelectChange}
|
|
126
|
+
navigation={navigation}
|
|
123
127
|
/>
|
|
124
128
|
</Table>
|
|
125
129
|
</CustomTableContainer>
|
|
@@ -143,15 +147,16 @@ const TableView = ({
|
|
|
143
147
|
onPageChange={onPageChange}
|
|
144
148
|
onRowsPerPageChange={onRowsPerPageChange}
|
|
145
149
|
/>
|
|
146
|
-
<DownloadButton
|
|
147
|
-
count={table.totalRowCount || 0}
|
|
148
|
-
queryVariables={queryVariables}
|
|
149
|
-
table={table}
|
|
150
|
-
/>
|
|
151
150
|
<ManageColumnView
|
|
152
151
|
table={table}
|
|
153
152
|
manageViewColumns={manageViewColumns}
|
|
154
153
|
onColumnViewChange={onColumnViewChange}
|
|
154
|
+
onAllColumnViewChange={onAllColumnViewChange}
|
|
155
|
+
/>
|
|
156
|
+
<DownloadButton
|
|
157
|
+
count={table.totalRowCount || 0}
|
|
158
|
+
queryVariables={queryVariables}
|
|
159
|
+
table={table}
|
|
155
160
|
/>
|
|
156
161
|
</div>
|
|
157
162
|
</>
|
|
@@ -22,6 +22,7 @@ const CustomTableBody = ({
|
|
|
22
22
|
table,
|
|
23
23
|
onRowSelectChange,
|
|
24
24
|
customTheme = {},
|
|
25
|
+
navigation,
|
|
25
26
|
}) => {
|
|
26
27
|
const { columns } = table;
|
|
27
28
|
const displayColunms = columns.filter((col) => col.display);
|
|
@@ -51,6 +52,7 @@ const CustomTableBody = ({
|
|
|
51
52
|
column={column}
|
|
52
53
|
row={row}
|
|
53
54
|
themeConfig={themeConfig}
|
|
55
|
+
navigation={navigation}
|
|
54
56
|
/>
|
|
55
57
|
);
|
|
56
58
|
})
|
|
@@ -31,6 +31,7 @@ const ViewCell = ({
|
|
|
31
31
|
column,
|
|
32
32
|
row,
|
|
33
33
|
themeConfig,
|
|
34
|
+
navigation,
|
|
34
35
|
}) => {
|
|
35
36
|
const { cellType } = column;
|
|
36
37
|
switch (cellType) {
|
|
@@ -61,6 +62,7 @@ const ViewCell = ({
|
|
|
61
62
|
row={row}
|
|
62
63
|
column={column}
|
|
63
64
|
themeConfig={themeConfig}
|
|
65
|
+
navigation={navigation}
|
|
64
66
|
/>
|
|
65
67
|
);
|
|
66
68
|
default:
|
|
@@ -76,12 +78,14 @@ const DisplayCell = ({
|
|
|
76
78
|
row,
|
|
77
79
|
column,
|
|
78
80
|
themeConfig,
|
|
81
|
+
navigation,
|
|
79
82
|
}) => (
|
|
80
83
|
<TableCell className={column.dataField}>
|
|
81
84
|
<ViewCell
|
|
82
85
|
row={row}
|
|
83
86
|
column={column}
|
|
84
87
|
themeConfig={themeConfig}
|
|
88
|
+
navigation={navigation}
|
|
85
89
|
/>
|
|
86
90
|
</TableCell>
|
|
87
91
|
);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
+
import { NavLink } from 'react-router-dom';
|
|
2
3
|
import {
|
|
3
4
|
Box,
|
|
5
|
+
Checkbox,
|
|
4
6
|
Modal,
|
|
5
7
|
Typography,
|
|
6
8
|
IconButton,
|
|
@@ -12,6 +14,7 @@ import {
|
|
|
12
14
|
TableRow,
|
|
13
15
|
TableCell,
|
|
14
16
|
TableBody,
|
|
17
|
+
Button,
|
|
15
18
|
} from '@material-ui/core';
|
|
16
19
|
// import CustomTableBody from '../../body/CustomTblBody';
|
|
17
20
|
import CloseIcon from '@material-ui/icons/Close';
|
|
@@ -19,6 +22,31 @@ import { withStyles } from '@material-ui/core/styles';
|
|
|
19
22
|
import styles from './ModalStyle';
|
|
20
23
|
// import TableHeader from '../../header/CustomTblHeader';
|
|
21
24
|
import HeaderCell from '../../header/CustomCell';
|
|
25
|
+
import AddFileButtonView from '../../wrapper/components/ReduxAddFile';
|
|
26
|
+
import questionIcon from './assets/Question_Icon.svg';
|
|
27
|
+
import cartIcon from './assets/Cart_Icon.svg';
|
|
28
|
+
|
|
29
|
+
const tooltipContentAddAll = {
|
|
30
|
+
tooltipText: 'Click button to add all Hub files associated with this participant to the cart.',
|
|
31
|
+
icon: questionIcon,
|
|
32
|
+
alt: 'tooltipIcon',
|
|
33
|
+
Participants: 'Click button to add all files associated with the filtered row(s).',
|
|
34
|
+
arrow: true,
|
|
35
|
+
styles: {
|
|
36
|
+
border: '#03A383 1px solid',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const tooltipContent = {
|
|
41
|
+
tooltipText: 'Click button to add all selected files associated with this participant to the cart.',
|
|
42
|
+
icon: questionIcon,
|
|
43
|
+
alt: 'tooltipIcon',
|
|
44
|
+
Participants: 'Click button to add files associated with the selected row(s).',
|
|
45
|
+
arrow: true,
|
|
46
|
+
styles: {
|
|
47
|
+
border: '#03A383 1px solid',
|
|
48
|
+
},
|
|
49
|
+
};
|
|
22
50
|
|
|
23
51
|
const CustomTableContainer = (props) => {
|
|
24
52
|
const { children, themeConfig, className } = props;
|
|
@@ -48,6 +76,36 @@ const CPIModal = ({
|
|
|
48
76
|
const result = row.cpi_data;
|
|
49
77
|
return result;
|
|
50
78
|
});
|
|
79
|
+
const [selectedIds, setIds] = useState([]);
|
|
80
|
+
const [selectAll, setSelectAll] = useState(false);
|
|
81
|
+
|
|
82
|
+
const wrapperConfig = {
|
|
83
|
+
container: 'buttons',
|
|
84
|
+
size: 'xl',
|
|
85
|
+
clsName: 'container_header',
|
|
86
|
+
items: [
|
|
87
|
+
{
|
|
88
|
+
participantIds: data,
|
|
89
|
+
title: 'ADD ALL FILES FOR PARTICIPANT',
|
|
90
|
+
clsName: 'add_all_button',
|
|
91
|
+
role: 'ADD_ALL_FILES',
|
|
92
|
+
btnType: 'ADD_ALL_FILES',
|
|
93
|
+
tooltipCofig: tooltipContentAddAll,
|
|
94
|
+
conditional: false,
|
|
95
|
+
alertMessage: 'The cart is limited to 200,000 files. Please narrow the search criteria or remove some files from the cart to add more.',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
participantIds: selectedIds,
|
|
99
|
+
title: 'ADD SELECTED FILES FOR PARTICIPANT',
|
|
100
|
+
clsName: 'add_selected_button',
|
|
101
|
+
role: 'ADD_SELECTED_FILES',
|
|
102
|
+
btnType: 'ADD_SELECTED_FILES',
|
|
103
|
+
tooltipCofig: tooltipContent,
|
|
104
|
+
conditional: true,
|
|
105
|
+
alertMessage: 'The cart is limited to 200,000 files. Please narrow the search criteria or remove some files from the cart to add more.',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
};
|
|
51
109
|
|
|
52
110
|
const sortingData = (column, newOrder) => {
|
|
53
111
|
const sortedData = data.sort((a, b) => a[column].localeCompare(b[column]));
|
|
@@ -58,6 +116,32 @@ const CPIModal = ({
|
|
|
58
116
|
return sortedData;
|
|
59
117
|
};
|
|
60
118
|
|
|
119
|
+
const handleSelectAll = () => {
|
|
120
|
+
if (selectAll) {
|
|
121
|
+
setSelectAll(false);
|
|
122
|
+
setIds([]);
|
|
123
|
+
} else {
|
|
124
|
+
setSelectAll(true);
|
|
125
|
+
let toAdd = [];
|
|
126
|
+
|
|
127
|
+
data.forEach((e) => {
|
|
128
|
+
if (e.data_type === 'internal' && e.p_id) {
|
|
129
|
+
toAdd = toAdd.concat(e.p_id);
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
setIds(toAdd);
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const handleSelect = (id) => {
|
|
137
|
+
if (selectedIds.indexOf(id) !== -1) {
|
|
138
|
+
setIds(selectedIds.filter((e) => e !== id));
|
|
139
|
+
} else {
|
|
140
|
+
const toAdd = selectedIds.concat(id);
|
|
141
|
+
setIds(toAdd);
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
|
|
61
145
|
const handleSortByColumn = (column, order) => {
|
|
62
146
|
const newOrder = (order === 'asc' && sortBy === column) ? 'desc' : 'asc';
|
|
63
147
|
const newData = sortingData(column, newOrder);
|
|
@@ -66,6 +150,47 @@ const CPIModal = ({
|
|
|
66
150
|
setSortOrder(newOrder);
|
|
67
151
|
};
|
|
68
152
|
|
|
153
|
+
const buttonContainer = {
|
|
154
|
+
display: 'flex',
|
|
155
|
+
justifyContent: 'center',
|
|
156
|
+
padding: '10px',
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
const addAllFilesButton = {
|
|
160
|
+
width: '174px',
|
|
161
|
+
height: '41px',
|
|
162
|
+
borderRadius: '5px',
|
|
163
|
+
backgroundColor: '#536D70',
|
|
164
|
+
fontFamily: 'Poppins',
|
|
165
|
+
fontWeight: '600',
|
|
166
|
+
fontSize: '12px',
|
|
167
|
+
color: 'white',
|
|
168
|
+
lineHeight: '14px',
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const addSelectedFilesButton = {
|
|
172
|
+
width: '174px',
|
|
173
|
+
height: '41px',
|
|
174
|
+
borderRadius: '5px',
|
|
175
|
+
backgroundColor: selectedIds.length ? '#2A6E93' : '#B3D6EA',
|
|
176
|
+
fontFamily: 'Poppins',
|
|
177
|
+
fontWeight: '600',
|
|
178
|
+
fontSize: '12px',
|
|
179
|
+
color: 'white',
|
|
180
|
+
lineHeight: '14px',
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const goToCartButton = {
|
|
184
|
+
width: '174px',
|
|
185
|
+
height: '41px',
|
|
186
|
+
borderRadius: '5px',
|
|
187
|
+
backgroundColor: '#5666BD',
|
|
188
|
+
fontFamily: 'Poppins',
|
|
189
|
+
fontWeight: '600',
|
|
190
|
+
fontSize: '12px',
|
|
191
|
+
color: 'white',
|
|
192
|
+
};
|
|
193
|
+
|
|
69
194
|
const modalBody = {
|
|
70
195
|
position: 'absolute',
|
|
71
196
|
top: '5%',
|
|
@@ -108,6 +233,7 @@ const CPIModal = ({
|
|
|
108
233
|
padding: '45px',
|
|
109
234
|
paddingLeft: '35px',
|
|
110
235
|
paddingRight: '20px',
|
|
236
|
+
borderTop: '1px solid #505050',
|
|
111
237
|
};
|
|
112
238
|
|
|
113
239
|
const link = {
|
|
@@ -205,6 +331,14 @@ const CPIModal = ({
|
|
|
205
331
|
<Table>
|
|
206
332
|
<TableHead>
|
|
207
333
|
<TableRow>
|
|
334
|
+
<TableCell padding="checkbox">
|
|
335
|
+
<span style={{ display: 'none' }}>Select all</span>
|
|
336
|
+
<Checkbox
|
|
337
|
+
color="primary"
|
|
338
|
+
checked={selectAll}
|
|
339
|
+
onChange={() => handleSelectAll()}
|
|
340
|
+
/>
|
|
341
|
+
</TableCell>
|
|
208
342
|
{
|
|
209
343
|
displayColumns.map((column) => (
|
|
210
344
|
<HeaderCell
|
|
@@ -218,10 +352,18 @@ const CPIModal = ({
|
|
|
218
352
|
}
|
|
219
353
|
</TableRow>
|
|
220
354
|
</TableHead>
|
|
221
|
-
<TableBody>
|
|
355
|
+
<TableBody style={{ borderBottom: '3px solid rgb(147, 147, 147)' }}>
|
|
222
356
|
{
|
|
223
357
|
data.map((currRow) => (
|
|
224
358
|
<TableRow>
|
|
359
|
+
<TableCell padding="checkbox">
|
|
360
|
+
<Checkbox
|
|
361
|
+
color="#2A6E93"
|
|
362
|
+
checked={selectedIds.includes(currRow.p_id)}
|
|
363
|
+
disabled={currRow.data_type === 'external'}
|
|
364
|
+
onChange={() => handleSelect(currRow.p_id)}
|
|
365
|
+
/>
|
|
366
|
+
</TableCell>
|
|
225
367
|
{
|
|
226
368
|
displayColumns.map((column) => (
|
|
227
369
|
(
|
|
@@ -237,6 +379,26 @@ const CPIModal = ({
|
|
|
237
379
|
</TableBody>
|
|
238
380
|
</Table>
|
|
239
381
|
</CustomTableContainer>
|
|
382
|
+
<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
|
+
/>
|
|
393
|
+
<NavLink to="/fileCentricCart">
|
|
394
|
+
<Button
|
|
395
|
+
style={goToCartButton}
|
|
396
|
+
>
|
|
397
|
+
GO TO CART
|
|
398
|
+
<img src={cartIcon} alt="cart" style={{ paddingLeft: '30px' }} />
|
|
399
|
+
</Button>
|
|
400
|
+
</NavLink>
|
|
401
|
+
</div>
|
|
240
402
|
<div className="footer" style={footer}>
|
|
241
403
|
All CPI mappings for a given study can be found in the "synonyms"
|
|
242
404
|
tab of the downloadable manifest,
|
|
@@ -16,6 +16,7 @@ const CPIView = ({
|
|
|
16
16
|
column,
|
|
17
17
|
row,
|
|
18
18
|
themeConfig,
|
|
19
|
+
navigation,
|
|
19
20
|
}) => {
|
|
20
21
|
const useStyles = makeStyles(() => ({
|
|
21
22
|
arrow: {
|
|
@@ -77,6 +78,7 @@ const CPIView = ({
|
|
|
77
78
|
open={modalOpen}
|
|
78
79
|
onClose={handleModalClose}
|
|
79
80
|
themeConfig={themeConfig}
|
|
81
|
+
navigation={navigation}
|
|
80
82
|
/>
|
|
81
83
|
<Tooltip
|
|
82
84
|
interactive
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="25" height="23" viewBox="0 0 25 23" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M0.833638 0C0.373152 0 0 0.376655 0 0.841463C0 1.30627 0.373152 1.68293 0.833638 1.68293H3.49086L6.35649 15.3307C6.47013 15.8446 6.80358 16.2718 7.22487 16.2688H21.1188C21.5595 16.2748 21.9644 15.8721 21.9644 15.4273C21.9644 14.9826 21.5595 14.5794 21.1188 14.5859H7.9022L7.54592 12.9029H22.2304C22.6035 12.9004 22.9563 12.6129 23.0377 12.2458L24.9829 3.83116C25.091 3.34281 24.6712 2.80939 24.1755 2.80538H5.43651L4.98496 0.666659C4.90557 0.292509 4.5468 0 4.16819 0H0.833638ZM5.78337 4.4878H10.1252L10.5421 7.01219H6.31283L5.78337 4.4878ZM11.8272 4.4878H17.0722L16.6554 7.01219H12.2441L11.8272 4.4878ZM18.7742 4.4878H23.125L22.543 7.01219H18.3574L18.7742 4.4878ZM6.66911 8.69512H10.8199L11.2368 11.2195H7.19857L6.66911 8.69512ZM12.5219 8.69512H16.3775L15.9607 11.2195H12.9388L12.5219 8.69512ZM18.0795 8.69512H22.152L21.5699 11.2195H17.6622L18.079 8.69512H18.0795ZM10.2815 17.3902C8.75668 17.3902 7.50275 18.6559 7.50275 20.1951C7.50275 21.7343 8.75668 23 10.2815 23C11.8064 23 13.0603 21.7343 13.0603 20.1951C13.0603 18.6559 11.8064 17.3902 10.2815 17.3902ZM18.0622 17.3902C16.5373 17.3902 15.2834 18.6559 15.2834 20.1951C15.2834 21.7343 16.5373 23 18.0622 23C19.587 23 20.841 21.7343 20.841 20.1951C20.841 18.6559 19.587 17.3902 18.0622 17.3902ZM10.2815 19.0732C10.9053 19.0732 11.3931 19.5655 11.3931 20.1951C11.3931 20.8247 10.9053 21.3171 10.2815 21.3171C9.6578 21.3171 9.17002 20.8247 9.17002 20.1951C9.17002 19.5655 9.6578 19.0732 10.2815 19.0732ZM18.0622 19.0732C18.6859 19.0732 19.1737 19.5655 19.1737 20.1951C19.1737 20.8247 18.6859 21.3171 18.0622 21.3171C17.4384 21.3171 16.9506 20.8247 16.9506 20.1951C16.9506 19.5655 17.4384 19.0732 18.0622 19.0732Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg width="13" height="13" viewBox="0 0 13 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<circle cx="6.5" cy="6.5" r="6.5" fill="#6A6A6A"/>
|
|
3
|
+
<path d="M4.293 3.602C4.414 3.492 4.546 3.38933 4.689 3.294C4.832 3.19867 4.986 3.11433 5.151 3.041C5.31967 2.96767 5.50117 2.91083 5.6955 2.8705C5.8935 2.8265 6.10617 2.8045 6.3335 2.8045C6.63783 2.8045 6.9165 2.8485 7.1695 2.9365C7.42617 3.02083 7.64617 3.14367 7.8295 3.305C8.0165 3.46267 8.16133 3.65517 8.264 3.8825C8.36667 4.10617 8.418 4.35733 8.418 4.636C8.418 4.91467 8.37767 5.15667 8.297 5.362C8.21633 5.56367 8.11367 5.73967 7.989 5.89C7.86433 6.04033 7.72867 6.17233 7.582 6.286C7.43533 6.396 7.296 6.5005 7.164 6.5995C7.03567 6.69483 6.92383 6.792 6.8285 6.891C6.73683 6.98633 6.68183 7.09267 6.6635 7.21L6.548 8.035H5.745L5.6625 7.1275C5.64417 6.95517 5.67167 6.80667 5.745 6.682C5.81833 6.55733 5.9155 6.44 6.0365 6.33C6.16117 6.22 6.29683 6.1155 6.4435 6.0165C6.59383 5.91383 6.73317 5.80017 6.8615 5.6755C6.98983 5.55083 7.098 5.4115 7.186 5.2575C7.274 5.1035 7.318 4.91833 7.318 4.702C7.318 4.559 7.2905 4.43067 7.2355 4.317C7.1805 4.19967 7.1035 4.10067 7.0045 4.02C6.9055 3.93933 6.79 3.877 6.658 3.833C6.526 3.789 6.383 3.767 6.229 3.767C6.01267 3.767 5.82933 3.79267 5.679 3.844C5.52867 3.89533 5.40033 3.95217 5.294 4.0145C5.18767 4.07317 5.09967 4.12817 5.03 4.1795C4.96033 4.22717 4.90167 4.251 4.854 4.251C4.74033 4.251 4.656 4.2015 4.601 4.1025L4.293 3.602ZM5.349 10.1305C5.349 10.0242 5.36733 9.92517 5.404 9.8335C5.44433 9.73817 5.4975 9.65567 5.5635 9.586C5.63317 9.51633 5.71383 9.46133 5.8055 9.421C5.90083 9.38067 6.00167 9.3605 6.108 9.3605C6.21433 9.3605 6.31333 9.38067 6.405 9.421C6.50033 9.46133 6.58283 9.51633 6.6525 9.586C6.72217 9.65567 6.77717 9.73817 6.8175 9.8335C6.85783 9.92517 6.878 10.0242 6.878 10.1305C6.878 10.2405 6.85783 10.3413 6.8175 10.433C6.77717 10.5247 6.72217 10.6053 6.6525 10.675C6.58283 10.7447 6.50033 10.7978 6.405 10.8345C6.31333 10.8748 6.21433 10.895 6.108 10.895C6.00167 10.895 5.90083 10.8748 5.8055 10.8345C5.71383 10.7978 5.63317 10.7447 5.5635 10.675C5.4975 10.6053 5.44433 10.5247 5.404 10.433C5.36733 10.3413 5.349 10.2405 5.349 10.1305Z" fill="white"/>
|
|
4
|
+
</svg>
|
|
@@ -120,24 +120,24 @@ const DownloadButton = ({
|
|
|
120
120
|
|
|
121
121
|
const useStyles = makeStyles({
|
|
122
122
|
dropdown: {
|
|
123
|
-
width: '
|
|
124
|
-
height: '
|
|
125
|
-
marginTop: '8px',
|
|
123
|
+
width: '48px',
|
|
124
|
+
height: '36px',
|
|
126
125
|
paddingLeft: '5px',
|
|
127
|
-
border: '0.75px solid #606060'
|
|
126
|
+
border: ` ${listDisplay === 'none' ? '0.75px solid #606060' : '1.5px solid #5666BD'}`,
|
|
128
127
|
borderRadius: '5px',
|
|
129
128
|
display: 'inline-block',
|
|
130
129
|
position: 'relative',
|
|
130
|
+
marginTop: '2px',
|
|
131
131
|
},
|
|
132
132
|
dropdownList: {
|
|
133
133
|
display: 'block',
|
|
134
134
|
position: 'absolute',
|
|
135
135
|
width: '60px',
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
top: '38px',
|
|
137
|
+
right: '0.5px',
|
|
138
138
|
overflow: 'auto',
|
|
139
139
|
zIndex: '5',
|
|
140
|
-
border: '1.5px solid #
|
|
140
|
+
border: '1.5px solid #5666BD',
|
|
141
141
|
borderRadius: '5px',
|
|
142
142
|
background: '#ffffff',
|
|
143
143
|
},
|
|
@@ -148,35 +148,38 @@ const DownloadButton = ({
|
|
|
148
148
|
fontWeight: 400,
|
|
149
149
|
lineHeight: '21px',
|
|
150
150
|
'&:hover': {
|
|
151
|
-
background: '#
|
|
151
|
+
background: '#C9CFF4',
|
|
152
152
|
cursor: 'pointer',
|
|
153
153
|
},
|
|
154
154
|
},
|
|
155
155
|
arrowdownIcon: {
|
|
156
|
-
marginLeft: '5px',
|
|
157
156
|
fill: '#606060',
|
|
157
|
+
marginTop: '2px',
|
|
158
158
|
},
|
|
159
159
|
arrowdownIconDisabled: {
|
|
160
160
|
marginLeft: '5px',
|
|
161
161
|
fill: '#00000042',
|
|
162
162
|
},
|
|
163
|
+
tooltip: {
|
|
164
|
+
marginTop: '5px',
|
|
165
|
+
},
|
|
163
166
|
});
|
|
164
167
|
|
|
165
168
|
const classes = useStyles();
|
|
166
169
|
|
|
167
170
|
return (
|
|
168
171
|
<div className={classes.dropdown}>
|
|
169
|
-
<Tooltip title="Download filtered results">
|
|
172
|
+
<Tooltip title="Download filtered results" className={classes.tooltip}>
|
|
170
173
|
{
|
|
171
174
|
count !== 0
|
|
172
175
|
? (
|
|
173
|
-
<IconButton onClick={handleClickButton}>
|
|
176
|
+
<IconButton onClick={handleClickButton} style={{ backgroundColor: 'transparent' }}>
|
|
174
177
|
<CloudDownload />
|
|
175
178
|
<KeyboardArrowDownOutlinedIcon className={classes.arrowdownIcon} />
|
|
176
179
|
</IconButton>
|
|
177
180
|
)
|
|
178
181
|
: (
|
|
179
|
-
<IconButton disabled>
|
|
182
|
+
<IconButton disabled style={{ backgroundColor: 'transparent' }}>
|
|
180
183
|
<CloudDownload />
|
|
181
184
|
<KeyboardArrowDownOutlinedIcon className={classes.arrowdownIconDisabled} />
|
|
182
185
|
</IconButton>
|