@desynova-digital/components 9.1.33 → 9.1.35

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.
@@ -525,6 +525,21 @@ var Table = /*#__PURE__*/function (_Component) {
525
525
  * )
526
526
  */
527
527
  });
528
+ (0, _defineProperty2["default"])(_this, "applyRowChecked", function (a, b) {
529
+ var checkedIds = new Set(a.filter(function (item) {
530
+ return item.rowChecked;
531
+ }).map(function (item) {
532
+ return item.ingest_db_id;
533
+ }));
534
+ return b.map(function (item) {
535
+ if (checkedIds.has(item.ingest_db_id)) {
536
+ return _objectSpread(_objectSpread({}, item), {}, {
537
+ rowChecked: true
538
+ });
539
+ }
540
+ return item;
541
+ });
542
+ });
528
543
  (0, _defineProperty2["default"])(_this, "getActionArrayOfString", function (jsonObj) {
529
544
  var arrObj = [];
530
545
  Object.keys(jsonObj).forEach(function (k) {
@@ -687,11 +702,12 @@ var Table = /*#__PURE__*/function (_Component) {
687
702
  });
688
703
  this.columns = this.getColumns(newProps);
689
704
  var spiltColumns = this.spiltColumns();
705
+ var updatedData = this.applyRowChecked(this.state.items, newProps.items);
690
706
  this.setState({
691
707
  defaultShowColumns: spiltColumns.defaultShowColumns,
692
708
  extraColumns: spiltColumns.extraColumns,
693
709
  nestedTable: spiltColumns.nestedTable,
694
- items: newProps.tableTitle == 'Archive History' ? this.getDisplayedItems(this.columns, this.state.items) : this.getDisplayedItems(this.columns, newProps.items),
710
+ items: this.props.bulkRestoreAllowed && this.state.selectedRows.length > 1 ? this.getDisplayedItems(this.columns, updatedData) : this.getDisplayedItems(this.columns, newProps.items),
695
711
  showColumnArr: this.getFieldArr(spiltColumns.defaultShowColumns)
696
712
  /*
697
713
  * ...(newProps.tableTitle !== this.props.tableTitle
@@ -1365,7 +1381,7 @@ var Table = /*#__PURE__*/function (_Component) {
1365
1381
  }));
1366
1382
  switch (item) {
1367
1383
  case 'restore':
1368
- _this4.state.ingestedDbIdArray.length > 1 ? _this4.props.actionClickHandler('restoreCommon', _this4.state.ingestedDbIdArray) : null;
1384
+ _this4.props.actionClickHandler('restoreCommon', _this4.state.ingestedDbIdArray);
1369
1385
  break;
1370
1386
  default:
1371
1387
  _this4.props.commonActionClickHandler(item, e, _this4.state.ingestedDbIdArray, "common-action");
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@desynova-digital/components",
3
- "version": "9.1.33",
3
+ "version": "9.1.35",
4
4
  "description": "Components for Desynova Digital",
5
5
  "main": "index.js",
6
6
  "author": "desynova-digital",
7
7
  "license": "MIT",
8
8
  "repository": "desynova-digital",
9
9
  "dependencies": {
10
- "@desynova-digital/tokens": "9.1.33",
10
+ "@desynova-digital/tokens": "9.1.35",
11
11
  "prop-types": "^15.7.2",
12
12
  "styled-components": "^4.3.2"
13
13
  },