@bento-core/table 1.0.1-ccdihub.89 → 1.0.1-ccdihub.90

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 (47) hide show
  1. package/dist/ExtendedView.js +2 -8
  2. package/dist/TableView.js +5 -9
  3. package/dist/body/CustomTblBody.js +2 -4
  4. package/dist/body/DisplayBodyCell.js +4 -8
  5. package/dist/body/components/CPIModal.js +15 -156
  6. package/dist/body/components/CPIView.js +4 -6
  7. package/dist/body/components/CustomLinkView.js +1 -1
  8. package/dist/header/CustomTblHeader.js +3 -5
  9. package/dist/pagination/CustomPagination.js +2 -7
  10. package/package.json +2 -8
  11. package/src/ExtendedView.js +6 -15
  12. package/src/TableView.js +5 -11
  13. package/src/body/CustomTblBody.js +0 -2
  14. package/src/body/DisplayBodyCell.js +0 -4
  15. package/src/body/components/CPIModal.js +12 -165
  16. package/src/body/components/CPIView.js +2 -10
  17. package/src/body/components/CustomLinkView.js +1 -1
  18. package/src/header/CustomTblHeader.js +1 -6
  19. package/src/pagination/CustomPagination.js +0 -2
  20. package/dist/body/components/assets/Cart_Icon.svg +0 -3
  21. package/dist/body/components/assets/Question_Icon.svg +0 -4
  22. package/dist/wrapper/WrapperService.js +0 -36
  23. package/dist/wrapper/components/AddFiles.js +0 -63
  24. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +0 -35
  25. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogController.js +0 -36
  26. package/dist/wrapper/components/AddToCartDialog/AddToCartDialogView.js +0 -43
  27. package/dist/wrapper/components/CPIFilesView/CPIFilesView.js +0 -178
  28. package/dist/wrapper/components/ReduxAddFile.js +0 -27
  29. package/dist/wrapper/components/Snackbar/Snackbar.js +0 -40
  30. package/dist/wrapper/components/Snackbar/SnackbarRedux.js +0 -16
  31. package/dist/wrapper/components/Snackbar/SuccessOutlined.js +0 -17
  32. package/dist/wrapper/components/TextFieldView.js +0 -37
  33. package/dist/wrapper/components/TooltipView.js +0 -40
  34. package/src/body/components/assets/Cart_Icon.svg +0 -3
  35. package/src/body/components/assets/Question_Icon.svg +0 -4
  36. package/src/wrapper/WrapperService.js +0 -25
  37. package/src/wrapper/components/AddFiles.js +0 -62
  38. package/src/wrapper/components/AddToCartDialog/AddToCartDialogAlertView.js +0 -37
  39. package/src/wrapper/components/AddToCartDialog/AddToCartDialogController.js +0 -32
  40. package/src/wrapper/components/AddToCartDialog/AddToCartDialogView.js +0 -57
  41. package/src/wrapper/components/CPIFilesView/CPIFilesView.js +0 -190
  42. package/src/wrapper/components/ReduxAddFile.js +0 -20
  43. package/src/wrapper/components/Snackbar/Snackbar.js +0 -43
  44. package/src/wrapper/components/Snackbar/SnackbarRedux.js +0 -11
  45. package/src/wrapper/components/Snackbar/SuccessOutlined.js +0 -10
  46. package/src/wrapper/components/TextFieldView.js +0 -32
  47. package/src/wrapper/components/TooltipView.js +0 -35
@@ -1,178 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = exports.ToolTipView = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _toolTip = _interopRequireDefault(require("@bento-core/tool-tip"));
9
- var _core = require("@material-ui/core");
10
- var _clsx = _interopRequireDefault(require("clsx"));
11
- var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
12
- var _WrapperService = require("../../WrapperService");
13
- var _AddToCartDialogView = _interopRequireDefault(require("../AddToCartDialog/AddToCartDialogView"));
14
- var _templateObject;
15
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
- 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); }
17
- 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; }
18
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
19
- const customTooltip = {
20
- border: '#03A383 1px solid'
21
- };
22
- const customArrow = {
23
- '&::before': {
24
- border: '#03A383 1px solid'
25
- }
26
- };
27
- const iconStyle = {
28
- paddingRight: '20px',
29
- paddingBottom: '20px',
30
- paddingLeft: '5px'
31
- };
32
- const ToolTipView = props => {
33
- const {
34
- section,
35
- tooltipCofig
36
- } = props;
37
- const {
38
- icon,
39
- src,
40
- alt,
41
- arrow = false,
42
- tooltipText
43
- } = tooltipCofig;
44
- return /*#__PURE__*/_react.default.createElement(_toolTip.default, {
45
- placement: "top",
46
- title: tooltipText || "".concat(tooltipCofig[section]),
47
- arrow: arrow,
48
- classes: {
49
- tooltip: customTooltip,
50
- arrow: customArrow
51
- }
52
- }, /*#__PURE__*/_react.default.createElement("img", {
53
- src: icon || src,
54
- alt: alt,
55
- style: iconStyle
56
- }));
57
- };
58
-
59
- // const checkDuplicate = (cartFiles, ids) => {
60
- // const newIds = [];
61
- // for (let i = 0; i < ids.length; i += 1) {
62
- // if (!cartFiles.includes(ids[i])) {
63
- // newIds.push(ids[i]);
64
- // }
65
- // }
66
- // return newIds;
67
- // };
68
- exports.ToolTipView = ToolTipView;
69
- const checkDuplicate = (cartFiles, ids) => ids.filter(id => !cartFiles[id]);
70
- const addFileQuery = (0, _graphqlTag.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\nquery search ( \n $participant_ids: [String],\n){\n fileIDsFromList ( \n participant_ids: $participant_ids,\n ) \n}\n "])));
71
- const CPIFilesComponent = props => {
72
- const {
73
- title,
74
- btnType,
75
- clsName,
76
- section,
77
- addFiles,
78
- setAlterDisplay,
79
- setOpenSnackbar,
80
- client,
81
- tooltipCofig,
82
- cartFiles,
83
- participantIds,
84
- buttonStyle,
85
- rowID
86
- } = props;
87
- /**
88
- * conditionally display dialog view
89
- */
90
- const [openAddDialog, setOpen] = (0, _react.useState)(false);
91
- const toggleOpen = () => setOpen(!openAddDialog);
92
- const [addFilesId, setAddFilesId] = (0, _react.useState)([]);
93
- // const [isDataloading, setIsDataloading] = useState(false);
94
- const responseKeys = ['fileIDsFromList'];
95
- const cartFilesDict = {};
96
- cartFiles.forEach(file => {
97
- cartFilesDict[file] = true;
98
- });
99
-
100
- // const backdropCls = {
101
- // width: '100%',
102
- // zIndex: 99999,
103
- // background: 'rgba(0, 0, 0, 0.1)',
104
- // };
105
- /**
106
- * verify and set file ids
107
- */
108
- const addAllFiles = () => {
109
- let toAdd = [];
110
- if (btnType === 'ADD_ALL_FILES') {
111
- participantIds.forEach(e => {
112
- if (e.data_type === 'internal' && e.p_id) {
113
- toAdd = toAdd.concat(e.p_id);
114
- }
115
- toAdd = toAdd.concat(rowID);
116
- });
117
- } else {
118
- toAdd = participantIds.concat(rowID);
119
- }
120
- const fileIds = (0, _WrapperService.getFilesID)({
121
- client,
122
- variables: {
123
- participant_ids: toAdd
124
- },
125
- query: addFileQuery
126
- });
127
- const upperLimit = 200000;
128
- const cartCount = cartFiles.length;
129
- if (cartCount < upperLimit) {
130
- fileIds().then(response => {
131
- const idsInitial = response[responseKeys[0]] || [];
132
- const ids = [...new Set(idsInitial)];
133
- const fileCount = ids.length;
134
- if (fileCount <= upperLimit && cartCount < upperLimit) {
135
- if (cartCount + ids.length <= upperLimit) {
136
- setOpen(true);
137
- setAddFilesId(ids);
138
- } else {
139
- const newIds = checkDuplicate(cartFiles, ids);
140
- if (cartCount + newIds.length <= upperLimit) {
141
- setOpen(true);
142
- setAddFilesId(newIds);
143
- } else {
144
- setAlterDisplay(true);
145
- }
146
- }
147
- } else {
148
- setAlterDisplay(true);
149
- }
150
- });
151
- } else {
152
- setAlterDisplay(true);
153
- }
154
- };
155
-
156
- /**
157
- * use wrapper service to add files to cart
158
- */
159
- const addFilesToCart = () => {
160
- addFiles(addFilesId);
161
- toggleOpen();
162
- setOpenSnackbar(true);
163
- };
164
- return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_core.Button, {
165
- onClick: addAllFiles,
166
- className: (0, _clsx.default)(clsName, "".concat(clsName, "_").concat(section)),
167
- disableRipple: true,
168
- style: buttonStyle,
169
- disabled: btnType === 'ADD_SELECTED_FILES' && participantIds.length === 0
170
- }, title), tooltipCofig && /*#__PURE__*/_react.default.createElement(ToolTipView, props), /*#__PURE__*/_react.default.createElement(_AddToCartDialogView.default, {
171
- open: openAddDialog,
172
- onYesClick: addFilesToCart,
173
- onNoClick: toggleOpen,
174
- dialogText: btnType === 'ADD_SELECTED_FILES' ? 'Are you sure to add selected files' : 'Are you sure to add All Files'
175
- }));
176
- };
177
- var _default = CPIFilesComponent;
178
- exports.default = _default;
@@ -1,27 +0,0 @@
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 _cart = require("@bento-core/cart");
10
- var _AddFiles = _interopRequireDefault(require("./AddFiles"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- const AddFilesRedux = props => /*#__PURE__*/_react.default.createElement(_AddFiles.default, props);
13
-
14
- /**
15
- * create query variable with actie filters
16
- */
17
- const mapStateToProps = state => ({
18
- count: state.cartReducer && state.cartReducer.count,
19
- cartFiles: state.cartReducer && state.cartReducer.filesId
20
- });
21
- const mapDispatchToProps = dispatch => ({
22
- addFiles: files => {
23
- dispatch((0, _cart.onAddCartFiles)(files));
24
- }
25
- });
26
- var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(AddFilesRedux);
27
- exports.default = _default;
@@ -1,40 +0,0 @@
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;
@@ -1,16 +0,0 @@
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;
@@ -1,17 +0,0 @@
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;
@@ -1,37 +0,0 @@
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;
@@ -1,40 +0,0 @@
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;
@@ -1,3 +0,0 @@
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>
@@ -1,4 +0,0 @@
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>
@@ -1,25 +0,0 @@
1
- /**
2
- * query varibales to fetch all the selected files id
3
- */
4
- export const getQueryVariables = (variables) => {
5
- const queryVariables = { ...variables };
6
- queryVariables.first = 200000;
7
- return queryVariables;
8
- };
9
-
10
- export const getFilesID = ({
11
- client,
12
- variables,
13
- query,
14
- }) => {
15
- const queryVariables = getQueryVariables(variables);
16
- return async function getFileIDs() {
17
- const fetchResult = await client
18
- .query({
19
- query,
20
- variables: queryVariables,
21
- })
22
- .then((response) => response.data);
23
- return fetchResult;
24
- };
25
- };
@@ -1,62 +0,0 @@
1
- import React, { useState } from 'react';
2
- import { useApolloClient } from '@apollo/client';
3
- import CPIFilesView from './CPIFilesView/CPIFilesView';
4
- import SnackbarView from './Snackbar/Snackbar';
5
- import AlertView from './AddToCartDialog/AddToCartDialogAlertView';
6
-
7
- export const btnTypes = {
8
- ADD_ALL_FILES: 'ADD_ALL_FILES',
9
- ADD_SELECTED_FILES: 'ADD_SELECTED_FILES',
10
- DOWNLOAD_MANIFEST: 'DOWNLOAD_MANIFEST',
11
- };
12
- /**
13
- * customize button based on configuration
14
- * refer config table (wrapper component config)
15
- */
16
- const AddFilesView = (props) => {
17
- const {
18
- count,
19
- alertMessage,
20
- cartFiles,
21
- buttonStyle,
22
- } = props;
23
- /**
24
- * snackbar state
25
- */
26
- const [openSnackbar, setOpenSnackbar] = useState(false);
27
-
28
- /**
29
- * conditionally display max file Alter/Error dialog view
30
- */
31
- const [displayAlter, setAlterDisplay] = useState(false);
32
- /**
33
- * acess bento app client via ApolloProvider
34
- */
35
- const client = useApolloClient();
36
- return (
37
- <>
38
- <CPIFilesView
39
- {...props}
40
- client={client}
41
- setAlterDisplay={setAlterDisplay}
42
- setOpenSnackbar={setOpenSnackbar}
43
- cartFiles={cartFiles}
44
- buttonStyle={buttonStyle}
45
- />
46
- <SnackbarView
47
- open={openSnackbar}
48
- count={count}
49
- onClose={() => setOpenSnackbar(false)}
50
- />
51
- {(displayAlter) && (
52
- <AlertView
53
- alertMessage={alertMessage}
54
- open={displayAlter}
55
- onClose={() => setAlterDisplay(false)}
56
- />
57
- )}
58
- </>
59
- );
60
- };
61
-
62
- export default AddFilesView;
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import {
3
- Dialog, DialogContent, DialogContentText,
4
- } from '@material-ui/core';
5
-
6
- function AddToCartDialogAlertView(props) {
7
- const {
8
- open,
9
- onClose,
10
- alertMessage,
11
- } = props;
12
- const closeAlertModelTimer = 4000;
13
-
14
- const AlertDialog = (
15
- <>
16
- <Dialog
17
- open={open}
18
- aria-labelledby="alert-dialog-title"
19
- aria-describedby="alert-dialog-description"
20
- >
21
- <DialogContent className="alter-content">
22
- <DialogContentText id="alert-dialog-description">
23
- {alertMessage}
24
- </DialogContentText>
25
- </DialogContent>
26
- </Dialog>
27
- </>
28
- );
29
-
30
- if (open) {
31
- // close the Dialog after 3 seconds.
32
- setTimeout(() => { onClose(); }, closeAlertModelTimer);
33
- }
34
- return AlertDialog;
35
- }
36
-
37
- export default AddToCartDialogAlertView;
@@ -1,32 +0,0 @@
1
- import React from 'react';
2
- import Dialog from './AddToCartDialogView';
3
- import Alert from './AddToCartDialogAlertView';
4
-
5
- const AddToCartDialogController = (props) => {
6
- const [open, setOpen] = React.useState(false);
7
-
8
- const handleClose = () => {
9
- setOpen(false);
10
- };
11
-
12
- const {
13
- cartWillFull = false,
14
- numberOfFilesSelected,
15
- onYesClick,
16
- onNoClick,
17
- } = props;
18
-
19
- if (cartWillFull) {
20
- return <Alert open={open} onClose={handleClose} />;
21
- }
22
- return (
23
- <Dialog
24
- open={open}
25
- numberOfFilesSelected={numberOfFilesSelected}
26
- onYesClick={onYesClick}
27
- onNoClick={onNoClick}
28
- />
29
- );
30
- };
31
-
32
- export default AddToCartDialogController;
@@ -1,57 +0,0 @@
1
- import React from 'react';
2
- import {
3
- Dialog, DialogActions, DialogContent, DialogContentText, Button,
4
- } from '@material-ui/core';
5
- import Alert from './AddToCartDialogAlertView';
6
-
7
- function AddToCartDialogView(props) {
8
- const {
9
- open,
10
- numberOfFilesSelected,
11
- onYesClick,
12
- onNoClick,
13
- cartWillFull = false,
14
- alertMessage,
15
- dialogText,
16
- } = props;
17
-
18
- if (cartWillFull) {
19
- return (
20
- <Alert
21
- alertMessage={alertMessage}
22
- open={open}
23
- onClose={() => onNoClick()}
24
- />
25
- );
26
- }
27
-
28
- return (
29
- <>
30
- <Dialog
31
- open={open}
32
- aria-labelledby="alert-dialog-title"
33
- aria-describedby="alert-dialog-description"
34
- >
35
- <DialogContent>
36
- <DialogContentText id="alert-dialog-description">
37
- {dialogText}
38
- {' '}
39
- {numberOfFilesSelected}
40
- {' '}
41
- to cart
42
- </DialogContentText>
43
- </DialogContent>
44
- <DialogActions>
45
- <Button className="yesBtn" onClick={() => onYesClick()}>
46
- Yes
47
- </Button>
48
- <Button className="noBtn" onClick={() => onNoClick()}>
49
- No
50
- </Button>
51
- </DialogActions>
52
- </Dialog>
53
- </>
54
- );
55
- }
56
-
57
- export default AddToCartDialogView;