@bento-core/paginated-table 1.0.1-CDS.1 → 1.0.1-CDS.3
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/dist/wrapper/components/DownloadManifestBtn.js +1 -1
- package/package.json +2 -2
- package/src/wrapper/components/AddAllFiles/AddAllView.js +7 -1
- package/src/wrapper/components/AddSelectedFiles/AddSelectedFilesController.js +6 -1
- package/src/wrapper/components/DownloadManifestBtn.js +1 -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);
|
|
@@ -53,7 +53,7 @@ const DownloadManifestView = props => {
|
|
|
53
53
|
table
|
|
54
54
|
} = _ref;
|
|
55
55
|
const fetchResult = await client.query({
|
|
56
|
-
query: table.api,
|
|
56
|
+
query: table.manifestAPI ? table.manifestAPI : table.api,
|
|
57
57
|
variables: _objectSpread({}, getQueryVeriables(queryVariables))
|
|
58
58
|
}).then(result => result.data.filesInList).then(result => {
|
|
59
59
|
const {
|
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.3",
|
|
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": "322ea86ebc3f5cb39891f07af5686428a31b9e1e"
|
|
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);
|
|
@@ -42,7 +42,7 @@ const DownloadManifestView = (props) => {
|
|
|
42
42
|
async function fetchData({ queryVariables, table }) {
|
|
43
43
|
const fetchResult = await client
|
|
44
44
|
.query({
|
|
45
|
-
query: table.api,
|
|
45
|
+
query: table.manifestAPI ? table.manifestAPI : table.api,
|
|
46
46
|
variables: {
|
|
47
47
|
...getQueryVeriables(queryVariables),
|
|
48
48
|
},
|