@bento-core/paginated-table 1.0.1-ccdiintegrated.6 → 1.0.1-ccdiintegrated.8

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.
@@ -129,7 +129,7 @@ const AddAllFilesComponent = props => {
129
129
  setIsDataloading(false);
130
130
  if (cartCount + newIds.length <= upperLimit) {
131
131
  setOpen(true);
132
- setAddFilesId(newIds);
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;
@@ -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
- }, count, ' ', "File(s) successfully added to your cart"))
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/paginated-table",
3
- "version": "1.0.1-ccdiintegrated.6",
3
+ "version": "1.0.1-ccdiintegrated.8",
4
4
  "homepage": "https://github.com/CBIIT/bento-frontend#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/CBIIT/bento-frontend/issues"
@@ -19,8 +19,8 @@
19
19
  "lint": "eslint src"
20
20
  },
21
21
  "dependencies": {
22
- "@bento-core/cart": "1.0.1-ccdiintegrated.1",
23
- "@bento-core/table": "1.0.1-ccdiintegrated.5",
22
+ "@bento-core/cart": "1.0.1-ccdiintegrated.2",
23
+ "@bento-core/table": "1.0.1-ccdiintegrated.7",
24
24
  "@bento-core/tool-tip": "1.0.1-ccdiintegrated.1",
25
25
  "@bento-core/util": "1.0.1-ccdiintegrated.1"
26
26
  },
@@ -123,7 +123,7 @@ const AddAllFilesComponent = (props) => {
123
123
  setIsDataloading(false);
124
124
  if (cartCount + newIds.length <= upperLimit) {
125
125
  setOpen(true);
126
- setAddFilesId(newIds);
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;
@@ -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);