@bento-core/paginated-table 1.0.1-CDS.1 → 1.0.1-CDS.2
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 +6 -1
- package/dist/wrapper/components/AddSelectedFiles/AddSelectedFilesController.js +6 -1
- package/package.json +2 -2
- package/src/wrapper/components/AddAllFiles/AddAllView.js +7 -1
- package/src/wrapper/components/AddSelectedFiles/AddSelectedFilesController.js +6 -1
|
@@ -46,11 +46,16 @@ const AddAllFilesComponent = props => {
|
|
|
46
46
|
variables: activeFilters,
|
|
47
47
|
query: addFileQuery
|
|
48
48
|
});
|
|
49
|
+
let filesInCart = 0;
|
|
50
|
+
if (localStorage.getItem('CartFileIds')) {
|
|
51
|
+
const filesId = JSON.parse(localStorage.getItem('CartFileIds')) || [];
|
|
52
|
+
filesInCart = filesId.length;
|
|
53
|
+
}
|
|
49
54
|
fileIds().then(response => {
|
|
50
55
|
const data = response[responseKeys[0]];
|
|
51
56
|
if (data && data.length > 0) {
|
|
52
57
|
const ids = (0, _util.default)(response, responseKeys);
|
|
53
|
-
if (ids.length > maxFileLimit) {
|
|
58
|
+
if (ids.length + filesInCart > maxFileLimit) {
|
|
54
59
|
setAlterDisplay(true);
|
|
55
60
|
} else {
|
|
56
61
|
setOpen(true);
|
|
@@ -60,9 +60,14 @@ const AddSelectedFilesController = props => {
|
|
|
60
60
|
fileIds: selectedRows,
|
|
61
61
|
query: addFileQuery
|
|
62
62
|
});
|
|
63
|
+
let filesInCart = 0;
|
|
64
|
+
if (localStorage.getItem('CartFileIds')) {
|
|
65
|
+
const filesId = JSON.parse(localStorage.getItem('CartFileIds')) || [];
|
|
66
|
+
filesInCart = filesId.length;
|
|
67
|
+
}
|
|
63
68
|
fileIds().then(response => {
|
|
64
69
|
const ids = (0, _util.default)(response, responseKeys);
|
|
65
|
-
if (ids.length >= maxFileLimit) {
|
|
70
|
+
if (ids.length + filesInCart >= maxFileLimit) {
|
|
66
71
|
setAlterDisplay(true);
|
|
67
72
|
} else {
|
|
68
73
|
addFiles(ids);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/paginated-table",
|
|
3
|
-
"version": "1.0.1-CDS.
|
|
3
|
+
"version": "1.0.1-CDS.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
},
|
|
29
29
|
"author": "CTOS Bento Team",
|
|
30
30
|
"license": "ISC",
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "7b3aaef031248be613da70582863625cf729fcce"
|
|
32
32
|
}
|
|
@@ -38,11 +38,17 @@ const AddAllFilesComponent = (props) => {
|
|
|
38
38
|
variables: activeFilters,
|
|
39
39
|
query: addFileQuery,
|
|
40
40
|
});
|
|
41
|
+
let filesInCart = 0;
|
|
42
|
+
if (localStorage.getItem('CartFileIds')) {
|
|
43
|
+
const filesId = JSON.parse(localStorage.getItem('CartFileIds')) || [];
|
|
44
|
+
filesInCart = filesId.length;
|
|
45
|
+
}
|
|
46
|
+
|
|
41
47
|
fileIds().then((response) => {
|
|
42
48
|
const data = response[responseKeys[0]];
|
|
43
49
|
if (data && data.length > 0) {
|
|
44
50
|
const ids = addFilesResponseHandler(response, responseKeys);
|
|
45
|
-
if (ids.length > maxFileLimit) {
|
|
51
|
+
if (ids.length + filesInCart > maxFileLimit) {
|
|
46
52
|
setAlterDisplay(true);
|
|
47
53
|
} else {
|
|
48
54
|
setOpen(true);
|
|
@@ -47,10 +47,15 @@ const AddSelectedFilesController = (props) => {
|
|
|
47
47
|
fileIds: selectedRows,
|
|
48
48
|
query: addFileQuery,
|
|
49
49
|
});
|
|
50
|
+
let filesInCart = 0;
|
|
51
|
+
if (localStorage.getItem('CartFileIds')) {
|
|
52
|
+
const filesId = JSON.parse(localStorage.getItem('CartFileIds')) || [];
|
|
53
|
+
filesInCart = filesId.length;
|
|
54
|
+
}
|
|
50
55
|
|
|
51
56
|
fileIds().then((response) => {
|
|
52
57
|
const ids = addFilesResponseHandler(response, responseKeys);
|
|
53
|
-
if (ids.length >= maxFileLimit) {
|
|
58
|
+
if (ids.length + filesInCart >= maxFileLimit) {
|
|
54
59
|
setAlterDisplay(true);
|
|
55
60
|
} else {
|
|
56
61
|
addFiles(ids);
|