@bento-core/table 1.0.1-ccdihub.63 → 1.0.1-ccdihub.65

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.
@@ -129,7 +129,9 @@ function downloadJson(tableData, table, downloadFileName) {
129
129
  return !_Types.actionCellTypes.includes(cellType);
130
130
  });
131
131
  let formatDataVal = (0, _Dataformat.formatColumnValues)(filterColumns, tableData);
132
- formatDataVal = JSON.parse(JSON.stringify(formatDataVal).split('"participant_age_at_collection":').join('"participant_age_at_collection_(days)":'));
132
+ filterColumns.forEach(column => {
133
+ formatDataVal = JSON.parse(JSON.stringify(formatDataVal).split(column.dataField).join(column.header));
134
+ });
133
135
  const jsonse = JSON.stringify(formatDataVal);
134
136
  const exportData = new Blob([jsonse], {
135
137
  type: 'application/json'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.1-ccdihub.63",
3
+ "version": "1.0.1-ccdihub.65",
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",
@@ -87,7 +87,11 @@ export function downloadJson(tableData, table, downloadFileName) {
87
87
  const { columns = [] } = table;
88
88
  const filterColumns = columns.filter(({ cellType }) => !actionCellTypes.includes(cellType));
89
89
  let formatDataVal = formatColumnValues(filterColumns, tableData);
90
- formatDataVal = JSON.parse(JSON.stringify(formatDataVal).split('"participant_age_at_collection":').join('"participant_age_at_collection_(days)":'));
90
+ filterColumns.forEach((column) => {
91
+ formatDataVal = JSON.parse(
92
+ JSON.stringify(formatDataVal).split(column.dataField).join(column.header),
93
+ );
94
+ });
91
95
  const jsonse = JSON.stringify(formatDataVal);
92
96
  const exportData = new Blob([jsonse], { type: 'application/json' });
93
97
  const JsonURL = window.URL.createObjectURL(exportData);