@bento-core/paginated-table 1.0.1-ccdihub.46 → 1.0.1-ccdihub.48

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.
@@ -152,7 +152,8 @@ const CustomWrapper = props => {
152
152
  section,
153
153
  classes,
154
154
  activeFilters,
155
- tblDispatch
155
+ tblDispatch,
156
+ fileCount
156
157
  } = props;
157
158
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(CustomLayout, {
158
159
  configs: wrapConfig,
@@ -160,7 +161,8 @@ const CustomWrapper = props => {
160
161
  section: section,
161
162
  classes: classes,
162
163
  activeFilters: activeFilters,
163
- tblDispatch: tblDispatch
164
+ tblDispatch: tblDispatch,
165
+ fileCount: fileCount
164
166
  }, children));
165
167
  };
166
168
  var _default = CustomWrapper;
@@ -67,35 +67,57 @@ const AddAllFilesComponent = props => {
67
67
  * verify and set file ids
68
68
  */
69
69
  const addAllFiles = () => {
70
- console.log('!!!!???!!!inbento????!!!:', fileCount);
71
70
  const fileIds = (0, _WrapperService.getFilesID)({
72
71
  client,
73
72
  variables: activeFilters,
74
73
  query: addFileQuery
75
74
  });
76
- fileIds().then(response => {
77
- const data = response[responseKeys[0]];
78
- if (data && data.length > 0) {
79
- const isArray = Array.isArray(data[0][responseKeys[1]]);
80
- const ids = data.reduce((acc, id) => {
81
- if (id && id[responseKeys[1]]) {
82
- // if object convert to array
83
- const items = isArray ? id[responseKeys[1]] : [id[responseKeys[1]]];
84
- acc.push(...items);
85
- }
86
- return acc;
87
- }, []);
88
- if (ids.length > 1000) {
89
- setAlterDisplay(true);
90
- } else {
75
+ // fileIds().then((response) => {
76
+ // const data = response[responseKeys[0]];
77
+ // if (data && data.length > 0) {
78
+ // const isArray = Array.isArray(data[0][responseKeys[1]]);
79
+ // const ids = data.reduce((acc, id) => {
80
+ // if (id && id[responseKeys[1]]) {
81
+ // // if object convert to array
82
+ // const items = isArray ? id[responseKeys[1]] : [id[responseKeys[1]]];
83
+ // acc.push(...items);
84
+ // }
85
+ // return acc;
86
+ // }, []);
87
+ // if (ids.length > 1000) {
88
+ // setAlterDisplay(true);
89
+ // } else {
90
+ // setOpen(true);
91
+ // setAddFilesId(ids);
92
+ // }
93
+ // } else {
94
+ // setOpen(true);
95
+ // }
96
+ // return [];
97
+ // });
98
+ if (fileCount <= 200) {
99
+ fileIds().then(response => {
100
+ const data = response[responseKeys[0]];
101
+ if (data && data.length > 0) {
102
+ const isArray = Array.isArray(data[0][responseKeys[1]]);
103
+ const ids = data.reduce((acc, id) => {
104
+ if (id && id[responseKeys[1]]) {
105
+ // if object convert to array
106
+ const items = isArray ? id[responseKeys[1]] : [id[responseKeys[1]]];
107
+ acc.push(...items);
108
+ }
109
+ return acc;
110
+ }, []);
91
111
  setOpen(true);
92
112
  setAddFilesId(ids);
113
+ } else {
114
+ setOpen(true);
93
115
  }
94
- } else {
95
- setOpen(true);
96
- }
97
- return [];
98
- });
116
+ return [];
117
+ });
118
+ } else {
119
+ setAlterDisplay(true);
120
+ }
99
121
  };
100
122
 
101
123
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/paginated-table",
3
- "version": "1.0.1-ccdihub.46",
3
+ "version": "1.0.1-ccdihub.48",
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",
@@ -150,6 +150,7 @@ const CustomWrapper = (props) => {
150
150
  classes,
151
151
  activeFilters,
152
152
  tblDispatch,
153
+ fileCount,
153
154
  } = props;
154
155
  return (
155
156
  <>
@@ -160,6 +161,7 @@ const CustomWrapper = (props) => {
160
161
  classes={classes}
161
162
  activeFilters={activeFilters}
162
163
  tblDispatch={tblDispatch}
164
+ fileCount={fileCount}
163
165
  >
164
166
  {children}
165
167
  </CustomLayout>
@@ -60,35 +60,57 @@ const AddAllFilesComponent = (props) => {
60
60
  * verify and set file ids
61
61
  */
62
62
  const addAllFiles = () => {
63
- console.log('!!!!???!!!inbento????!!!:', fileCount);
64
63
  const fileIds = getFilesID({
65
64
  client,
66
65
  variables: activeFilters,
67
66
  query: addFileQuery,
68
67
  });
69
- fileIds().then((response) => {
70
- const data = response[responseKeys[0]];
71
- if (data && data.length > 0) {
72
- const isArray = Array.isArray(data[0][responseKeys[1]]);
73
- const ids = data.reduce((acc, id) => {
74
- if (id && id[responseKeys[1]]) {
75
- // if object convert to array
76
- const items = isArray ? id[responseKeys[1]] : [id[responseKeys[1]]];
77
- acc.push(...items);
78
- }
79
- return acc;
80
- }, []);
81
- if (ids.length > 1000) {
82
- setAlterDisplay(true);
83
- } else {
68
+ // fileIds().then((response) => {
69
+ // const data = response[responseKeys[0]];
70
+ // if (data && data.length > 0) {
71
+ // const isArray = Array.isArray(data[0][responseKeys[1]]);
72
+ // const ids = data.reduce((acc, id) => {
73
+ // if (id && id[responseKeys[1]]) {
74
+ // // if object convert to array
75
+ // const items = isArray ? id[responseKeys[1]] : [id[responseKeys[1]]];
76
+ // acc.push(...items);
77
+ // }
78
+ // return acc;
79
+ // }, []);
80
+ // if (ids.length > 1000) {
81
+ // setAlterDisplay(true);
82
+ // } else {
83
+ // setOpen(true);
84
+ // setAddFilesId(ids);
85
+ // }
86
+ // } else {
87
+ // setOpen(true);
88
+ // }
89
+ // return [];
90
+ // });
91
+ if (fileCount <= 200) {
92
+ fileIds().then((response) => {
93
+ const data = response[responseKeys[0]];
94
+ if (data && data.length > 0) {
95
+ const isArray = Array.isArray(data[0][responseKeys[1]]);
96
+ const ids = data.reduce((acc, id) => {
97
+ if (id && id[responseKeys[1]]) {
98
+ // if object convert to array
99
+ const items = isArray ? id[responseKeys[1]] : [id[responseKeys[1]]];
100
+ acc.push(...items);
101
+ }
102
+ return acc;
103
+ }, []);
84
104
  setOpen(true);
85
105
  setAddFilesId(ids);
106
+ } else {
107
+ setOpen(true);
86
108
  }
87
- } else {
88
- setOpen(true);
89
- }
90
- return [];
91
- });
109
+ return [];
110
+ });
111
+ } else {
112
+ setAlterDisplay(true);
113
+ }
92
114
  };
93
115
 
94
116
  /**