@bento-core/paginated-table 1.0.1-ccdiintegrated.1 → 1.0.1-ccdiintegrated.10
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/wrapper/components/AddAllFiles/AddAllView.js +3 -3
- package/dist/wrapper/components/AddFiles.js +2 -0
- package/dist/wrapper/components/ReduxAddFile.js +1 -0
- package/dist/wrapper/components/Snackbar/Snackbar.js +5 -3
- package/dist/wrapper/components/Snackbar/SnackbarRedux.js +2 -1
- package/package.json +5 -5
- package/src/wrapper/components/AddAllFiles/AddAllView.js +3 -3
- package/src/wrapper/components/AddFiles.js +2 -0
- package/src/wrapper/components/ReduxAddFile.js +1 -0
- package/src/wrapper/components/Snackbar/Snackbar.js +4 -4
- package/src/wrapper/components/Snackbar/SnackbarRedux.js +1 -0
|
@@ -122,14 +122,14 @@ const AddAllFilesComponent = props => {
|
|
|
122
122
|
const ids = [...new Set(idsInitial)];
|
|
123
123
|
if (cartCount + ids.length <= upperLimit) {
|
|
124
124
|
setIsDataloading(false);
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
addFiles(ids);
|
|
126
|
+
setOpenSnackbar(true);
|
|
127
127
|
} else {
|
|
128
128
|
const newIds = checkDuplicate(cartFilesDict, ids);
|
|
129
129
|
setIsDataloading(false);
|
|
130
130
|
if (cartCount + newIds.length <= upperLimit) {
|
|
131
131
|
setOpen(true);
|
|
132
|
-
setAddFilesId(
|
|
132
|
+
setAddFilesId(ids);
|
|
133
133
|
} else {
|
|
134
134
|
setAlterDisplay(true);
|
|
135
135
|
}
|
|
@@ -28,6 +28,7 @@ const AddFilesView = props => {
|
|
|
28
28
|
const {
|
|
29
29
|
btnType,
|
|
30
30
|
count,
|
|
31
|
+
alreadyInCartCount,
|
|
31
32
|
alertMessage,
|
|
32
33
|
cartFiles
|
|
33
34
|
} = props;
|
|
@@ -57,6 +58,7 @@ const AddFilesView = props => {
|
|
|
57
58
|
})), /*#__PURE__*/_react.default.createElement(_Snackbar.default, {
|
|
58
59
|
open: openSnackbar,
|
|
59
60
|
count: count,
|
|
61
|
+
alreadyInCartCount: alreadyInCartCount,
|
|
60
62
|
onClose: () => setOpenSnackbar(false)
|
|
61
63
|
}), displayAlter && /*#__PURE__*/_react.default.createElement(_AddToCartDialogAlertView.default, {
|
|
62
64
|
alertMessage: alertMessage,
|
|
@@ -16,6 +16,7 @@ const AddFilesRedux = props => /*#__PURE__*/_react.default.createElement(_AddFil
|
|
|
16
16
|
*/
|
|
17
17
|
const mapStateToProps = state => ({
|
|
18
18
|
count: state.cartReducer && state.cartReducer.count,
|
|
19
|
+
alreadyInCartCount: state.cartReducer && state.cartReducer.alreadyInCartCount,
|
|
19
20
|
cartFiles: state.cartReducer && state.cartReducer.filesId
|
|
20
21
|
});
|
|
21
22
|
const mapDispatchToProps = dispatch => ({
|
|
@@ -6,11 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _core = require("@material-ui/core");
|
|
9
|
+
var _cart = require("@bento-core/cart");
|
|
9
10
|
var _SuccessOutlined = _interopRequireDefault(require("./SuccessOutlined"));
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
const SnackbarView = props => {
|
|
12
13
|
const {
|
|
13
14
|
count,
|
|
15
|
+
alreadyInCartCount = 0,
|
|
14
16
|
open,
|
|
15
17
|
onClose
|
|
16
18
|
} = props;
|
|
@@ -24,8 +26,8 @@ const SnackbarView = props => {
|
|
|
24
26
|
open: open,
|
|
25
27
|
autoHideDuration: 3000,
|
|
26
28
|
anchorOrigin: {
|
|
27
|
-
vertical: '
|
|
28
|
-
horizontal: '
|
|
29
|
+
vertical: 'top',
|
|
30
|
+
horizontal: 'center'
|
|
29
31
|
},
|
|
30
32
|
message: /*#__PURE__*/_react.default.createElement("div", {
|
|
31
33
|
className: "snackBarMessage"
|
|
@@ -33,7 +35,7 @@ const SnackbarView = props => {
|
|
|
33
35
|
className: "snackBarMessageIcon"
|
|
34
36
|
}, /*#__PURE__*/_react.default.createElement(_SuccessOutlined.default, null), ' '), /*#__PURE__*/_react.default.createElement("span", {
|
|
35
37
|
className: "snackBarText"
|
|
36
|
-
},
|
|
38
|
+
}, (0, _cart.formatCartAddMessage)(count, alreadyInCartCount)))
|
|
37
39
|
}));
|
|
38
40
|
};
|
|
39
41
|
var _default = SnackbarView;
|
|
@@ -10,7 +10,8 @@ var _Snackbar = _interopRequireDefault(require("./Snackbar"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
const ReduxSnackbar = props => /*#__PURE__*/_react.default.createElement(_Snackbar.default, props);
|
|
12
12
|
const mapStateToProps = state => ({
|
|
13
|
-
count: state.cartReducer.count
|
|
13
|
+
count: state.cartReducer.count,
|
|
14
|
+
alreadyInCartCount: state.cartReducer.alreadyInCartCount
|
|
14
15
|
});
|
|
15
16
|
var _default = (0, _reactRedux.connect)(mapStateToProps, null)(ReduxSnackbar);
|
|
16
17
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/paginated-table",
|
|
3
|
-
"version": "1.0.1-ccdiintegrated.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.1-ccdiintegrated.10",
|
|
5
4
|
"homepage": "https://github.com/CBIIT/bento-frontend#readme",
|
|
6
5
|
"bugs": {
|
|
7
6
|
"url": "https://github.com/CBIIT/bento-frontend/issues"
|
|
@@ -20,8 +19,8 @@
|
|
|
20
19
|
"lint": "eslint src"
|
|
21
20
|
},
|
|
22
21
|
"dependencies": {
|
|
23
|
-
"@bento-core/cart": "1.0.1-ccdiintegrated.
|
|
24
|
-
"@bento-core/table": "1.0.1-ccdiintegrated.
|
|
22
|
+
"@bento-core/cart": "1.0.1-ccdiintegrated.2",
|
|
23
|
+
"@bento-core/table": "1.0.1-ccdiintegrated.8",
|
|
25
24
|
"@bento-core/tool-tip": "1.0.1-ccdiintegrated.1",
|
|
26
25
|
"@bento-core/util": "1.0.1-ccdiintegrated.1"
|
|
27
26
|
},
|
|
@@ -36,5 +35,6 @@
|
|
|
36
35
|
},
|
|
37
36
|
"publishConfig": {
|
|
38
37
|
"access": "public"
|
|
39
|
-
}
|
|
38
|
+
},
|
|
39
|
+
"description": ""
|
|
40
40
|
}
|
|
@@ -116,14 +116,14 @@ const AddAllFilesComponent = (props) => {
|
|
|
116
116
|
const ids = [...new Set(idsInitial)];
|
|
117
117
|
if (cartCount + ids.length <= upperLimit) {
|
|
118
118
|
setIsDataloading(false);
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
addFiles(ids);
|
|
120
|
+
setOpenSnackbar(true);
|
|
121
121
|
} else {
|
|
122
122
|
const newIds = checkDuplicate(cartFilesDict, ids);
|
|
123
123
|
setIsDataloading(false);
|
|
124
124
|
if (cartCount + newIds.length <= upperLimit) {
|
|
125
125
|
setOpen(true);
|
|
126
|
-
setAddFilesId(
|
|
126
|
+
setAddFilesId(ids);
|
|
127
127
|
} else {
|
|
128
128
|
setAlterDisplay(true);
|
|
129
129
|
}
|
|
@@ -18,6 +18,7 @@ const AddFilesView = (props) => {
|
|
|
18
18
|
const {
|
|
19
19
|
btnType,
|
|
20
20
|
count,
|
|
21
|
+
alreadyInCartCount,
|
|
21
22
|
alertMessage,
|
|
22
23
|
cartFiles,
|
|
23
24
|
} = props;
|
|
@@ -62,6 +63,7 @@ const AddFilesView = (props) => {
|
|
|
62
63
|
<SnackbarView
|
|
63
64
|
open={openSnackbar}
|
|
64
65
|
count={count}
|
|
66
|
+
alreadyInCartCount={alreadyInCartCount}
|
|
65
67
|
onClose={() => setOpenSnackbar(false)}
|
|
66
68
|
/>
|
|
67
69
|
{(displayAlter) && (
|
|
@@ -10,6 +10,7 @@ const AddFilesRedux = (props) => <AddFiles {...props} />;
|
|
|
10
10
|
*/
|
|
11
11
|
const mapStateToProps = (state) => ({
|
|
12
12
|
count: state.cartReducer && state.cartReducer.count,
|
|
13
|
+
alreadyInCartCount: state.cartReducer && state.cartReducer.alreadyInCartCount,
|
|
13
14
|
cartFiles: state.cartReducer && state.cartReducer.filesId,
|
|
14
15
|
});
|
|
15
16
|
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Snackbar } from '@material-ui/core';
|
|
3
|
+
import { formatCartAddMessage } from '@bento-core/cart';
|
|
3
4
|
import SuccessOutlinedIcon from './SuccessOutlined';
|
|
4
5
|
|
|
5
6
|
const SnackbarView = (props) => {
|
|
6
7
|
const {
|
|
7
8
|
count,
|
|
9
|
+
alreadyInCartCount = 0,
|
|
8
10
|
open,
|
|
9
11
|
onClose,
|
|
10
12
|
} = props;
|
|
@@ -21,7 +23,7 @@ const SnackbarView = (props) => {
|
|
|
21
23
|
className="snackBar"
|
|
22
24
|
open={open}
|
|
23
25
|
autoHideDuration={3000}
|
|
24
|
-
anchorOrigin={{ vertical: '
|
|
26
|
+
anchorOrigin={{ vertical: 'top', horizontal: 'center' }}
|
|
25
27
|
message={(
|
|
26
28
|
<div className="snackBarMessage">
|
|
27
29
|
<span className="snackBarMessageIcon">
|
|
@@ -29,9 +31,7 @@ const SnackbarView = (props) => {
|
|
|
29
31
|
{' '}
|
|
30
32
|
</span>
|
|
31
33
|
<span className="snackBarText">
|
|
32
|
-
{count}
|
|
33
|
-
{' '}
|
|
34
|
-
File(s) successfully added to your cart
|
|
34
|
+
{formatCartAddMessage(count, alreadyInCartCount)}
|
|
35
35
|
</span>
|
|
36
36
|
</div>
|
|
37
37
|
)}
|
|
@@ -6,6 +6,7 @@ const ReduxSnackbar = ((props) => <SnackbarView {...props} />);
|
|
|
6
6
|
|
|
7
7
|
const mapStateToProps = (state) => ({
|
|
8
8
|
count: state.cartReducer.count,
|
|
9
|
+
alreadyInCartCount: state.cartReducer.alreadyInCartCount,
|
|
9
10
|
});
|
|
10
11
|
|
|
11
12
|
export default connect(mapStateToProps, null)(ReduxSnackbar);
|