@bento-core/paginated-table 1.0.0-alpha.0 → 1.0.1-CDS.0
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.
|
@@ -39,6 +39,13 @@ const DownloadManifestView = props => {
|
|
|
39
39
|
variables.first = 10000;
|
|
40
40
|
return variables;
|
|
41
41
|
};
|
|
42
|
+
const appendStringsToRecord = (records, columnsToAppendString) => records.map(record => {
|
|
43
|
+
const updatedRecord = record;
|
|
44
|
+
columnsToAppendString.forEach(columnConfigObject => {
|
|
45
|
+
updatedRecord[columnConfigObject.dataField] = columnConfigObject.appendString + updatedRecord[columnConfigObject.dataField];
|
|
46
|
+
});
|
|
47
|
+
return updatedRecord;
|
|
48
|
+
});
|
|
42
49
|
const client = (0, _client.useApolloClient)();
|
|
43
50
|
async function fetchData(_ref) {
|
|
44
51
|
let {
|
|
@@ -48,7 +55,16 @@ const DownloadManifestView = props => {
|
|
|
48
55
|
const fetchResult = await client.query({
|
|
49
56
|
query: table.api,
|
|
50
57
|
variables: _objectSpread({}, getQueryVeriables(queryVariables))
|
|
51
|
-
}).then(result => result.data.filesInList)
|
|
58
|
+
}).then(result => result.data.filesInList).then(result => {
|
|
59
|
+
const {
|
|
60
|
+
columns
|
|
61
|
+
} = table;
|
|
62
|
+
const columnsToAppendString = columns.filter(colum => colum.appendString);
|
|
63
|
+
if (Object.keys(columnsToAppendString).length > 0) {
|
|
64
|
+
return appendStringsToRecord(result, columnsToAppendString);
|
|
65
|
+
}
|
|
66
|
+
return result;
|
|
67
|
+
});
|
|
52
68
|
return fetchResult;
|
|
53
69
|
}
|
|
54
70
|
async function DocumentDownload() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/paginated-table",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1-CDS.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@bento-core/cart": "^1.0.
|
|
17
|
-
"@bento-core/table": "^1.0.0
|
|
18
|
-
"@bento-core/tool-tip": "^1.0.0
|
|
19
|
-
"@bento-core/util": "^1.0.0
|
|
16
|
+
"@bento-core/cart": "^1.0.1-CDS.0",
|
|
17
|
+
"@bento-core/table": "^1.0.0",
|
|
18
|
+
"@bento-core/tool-tip": "^1.0.0",
|
|
19
|
+
"@bento-core/util": "^1.0.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
22
|
"@apollo/client": "^3.6.9",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
},
|
|
29
29
|
"author": "CTOS Bento Team",
|
|
30
30
|
"license": "ISC",
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "21403ee7ea6a9e2a757be8bac4b9fb6c5f356686"
|
|
32
32
|
}
|
|
@@ -29,6 +29,15 @@ const DownloadManifestView = (props) => {
|
|
|
29
29
|
return variables;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
const appendStringsToRecord = (records, columnsToAppendString) => records.map((record) => {
|
|
33
|
+
const updatedRecord = record;
|
|
34
|
+
columnsToAppendString.forEach((columnConfigObject) => {
|
|
35
|
+
updatedRecord[columnConfigObject.dataField] = columnConfigObject.appendString
|
|
36
|
+
+ updatedRecord[columnConfigObject.dataField];
|
|
37
|
+
});
|
|
38
|
+
return updatedRecord;
|
|
39
|
+
});
|
|
40
|
+
|
|
32
41
|
const client = useApolloClient();
|
|
33
42
|
async function fetchData({ queryVariables, table }) {
|
|
34
43
|
const fetchResult = await client
|
|
@@ -38,7 +47,16 @@ const DownloadManifestView = (props) => {
|
|
|
38
47
|
...getQueryVeriables(queryVariables),
|
|
39
48
|
},
|
|
40
49
|
})
|
|
41
|
-
.then((result) => result.data.filesInList)
|
|
50
|
+
.then((result) => result.data.filesInList)
|
|
51
|
+
.then((result) => {
|
|
52
|
+
const { columns } = table;
|
|
53
|
+
const columnsToAppendString = columns.filter((colum) => colum.appendString);
|
|
54
|
+
if (Object.keys(columnsToAppendString).length > 0) {
|
|
55
|
+
return appendStringsToRecord(result, columnsToAppendString);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return result;
|
|
59
|
+
});
|
|
42
60
|
return fetchResult;
|
|
43
61
|
}
|
|
44
62
|
|