@bento-core/paginated-table 1.0.1-ccdihub.50 → 1.0.1-ccdihub.52

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.
@@ -55,7 +55,6 @@ const AddAllFilesComponent = props => {
55
55
  client,
56
56
  tooltipCofig,
57
57
  fileCount,
58
- cartCount,
59
58
  cartFiles
60
59
  } = props;
61
60
  /**
@@ -74,12 +73,13 @@ const AddAllFilesComponent = props => {
74
73
  variables: activeFilters,
75
74
  query: addFileQuery
76
75
  });
77
- if (fileCount <= 6000) {
78
- console.log('!!!!!!!cartCount:', cartCount);
79
- console.log('!!!!!!!!cartFiles:', cartFiles);
80
- if (cartCount + fileCount <= 6000) {
81
- fileIds().then(response => {
82
- const data = response[responseKeys[0]];
76
+ const cartCount = cartFiles.length;
77
+ console.log('!!!!!cartCount:', cartCount);
78
+ console.log('!!!!!cartFiles:', cartFiles);
79
+ if (fileCount <= 6000 && cartCount < 6000) {
80
+ fileIds().then(response => {
81
+ const data = response[responseKeys[0]];
82
+ if (data && data.length > 0) {
83
83
  const isArray = Array.isArray(data[0][responseKeys[1]]);
84
84
  const ids = data.reduce((acc, id) => {
85
85
  if (id && id[responseKeys[1]]) {
@@ -89,11 +89,16 @@ const AddAllFilesComponent = props => {
89
89
  }
90
90
  return acc;
91
91
  }, []);
92
- setOpen(true);
93
- setAddFilesId(ids);
94
- return [];
95
- });
96
- }
92
+ console.log('!!!!!!ids:', ids);
93
+ if (cartCount + fileCount <= 6000) {
94
+ setAddFilesId(ids);
95
+ } else {
96
+ setAlterDisplay(true);
97
+ }
98
+ }
99
+ setOpen(true);
100
+ return [];
101
+ });
97
102
  } else {
98
103
  setAlterDisplay(true);
99
104
  }
@@ -52,7 +52,6 @@ const AddFilesView = props => {
52
52
  client: client,
53
53
  setAlterDisplay: setAlterDisplay,
54
54
  setOpenSnackbar: setOpenSnackbar,
55
- cartCount: count,
56
55
  cartFiles: cartFiles
57
56
  })), /*#__PURE__*/_react.default.createElement(_Snackbar.default, {
58
57
  open: openSnackbar,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/paginated-table",
3
- "version": "1.0.1-ccdihub.50",
3
+ "version": "1.0.1-ccdihub.52",
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",
@@ -48,7 +48,6 @@ const AddAllFilesComponent = (props) => {
48
48
  client,
49
49
  tooltipCofig,
50
50
  fileCount,
51
- cartCount,
52
51
  cartFiles,
53
52
  } = props;
54
53
  /**
@@ -67,12 +66,13 @@ const AddAllFilesComponent = (props) => {
67
66
  variables: activeFilters,
68
67
  query: addFileQuery,
69
68
  });
70
- if (fileCount <= 6000) {
71
- console.log('!!!!!!!cartCount:', cartCount);
72
- console.log('!!!!!!!!cartFiles:', cartFiles);
73
- if (cartCount + fileCount <= 6000) {
74
- fileIds().then((response) => {
75
- const data = response[responseKeys[0]];
69
+ const cartCount = cartFiles.length;
70
+ console.log('!!!!!cartCount:', cartCount);
71
+ console.log('!!!!!cartFiles:', cartFiles);
72
+ if (fileCount <= 6000 && cartCount < 6000) {
73
+ fileIds().then((response) => {
74
+ const data = response[responseKeys[0]];
75
+ if (data && data.length > 0) {
76
76
  const isArray = Array.isArray(data[0][responseKeys[1]]);
77
77
  const ids = data.reduce((acc, id) => {
78
78
  if (id && id[responseKeys[1]]) {
@@ -82,11 +82,16 @@ const AddAllFilesComponent = (props) => {
82
82
  }
83
83
  return acc;
84
84
  }, []);
85
- setOpen(true);
86
- setAddFilesId(ids);
87
- return [];
88
- });
89
- }
85
+ console.log('!!!!!!ids:', ids);
86
+ if (cartCount + fileCount <= 6000) {
87
+ setAddFilesId(ids);
88
+ } else {
89
+ setAlterDisplay(true);
90
+ }
91
+ }
92
+ setOpen(true);
93
+ return [];
94
+ });
90
95
  } else {
91
96
  setAlterDisplay(true);
92
97
  }
@@ -54,7 +54,6 @@ const AddFilesView = (props) => {
54
54
  client={client}
55
55
  setAlterDisplay={setAlterDisplay}
56
56
  setOpenSnackbar={setOpenSnackbar}
57
- cartCount={count}
58
57
  cartFiles={cartFiles}
59
58
  />
60
59
  )