@bento-core/table 1.0.1-ccdihub.73 → 1.0.1-ccdihub.74
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/util/downloadTable.js +8 -14
- package/package.json +1 -1
- package/src/util/downloadTable.js +8 -17
|
@@ -151,26 +151,20 @@ function downloadJson(tableData, table, downloadFileName) {
|
|
|
151
151
|
let survivalStatus = entry.last_known_survival_status;
|
|
152
152
|
let sampleId = entry.sample_id;
|
|
153
153
|
let dataCategory = entry.data_category;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
} else if (survivalStatus.toString().charAt(0) === '[' && survivalStatus.toString().charAt(survivalStatus.toString().length - 1) === ']') {
|
|
154
|
+
const toReturn = _objectSpread({}, entry);
|
|
155
|
+
if (survivalStatus && survivalStatus.toString().charAt(0) === '[' && survivalStatus.toString().charAt(survivalStatus.toString().length - 1) === ']') {
|
|
157
156
|
survivalStatus = survivalStatus.toString().substring(1, survivalStatus.length - 1);
|
|
157
|
+
toReturn['Last Known Survival Status'] = survivalStatus;
|
|
158
158
|
}
|
|
159
|
-
if (
|
|
160
|
-
sampleId = '';
|
|
161
|
-
} else if (sampleId.toString().charAt(0) === '[' && sampleId.toString().charAt(sampleId.toString().length - 1) === ']') {
|
|
159
|
+
if (sampleId && sampleId.toString().charAt(0) === '[' && sampleId.toString().charAt(sampleId.toString().length - 1) === ']') {
|
|
162
160
|
sampleId = sampleId.toString().substring(1, sampleId.length - 1);
|
|
161
|
+
toReturn['Sample Id'] = sampleId;
|
|
163
162
|
}
|
|
164
|
-
if (
|
|
165
|
-
dataCategory = '';
|
|
166
|
-
} else if (dataCategory.toString().charAt(0) === '[' && dataCategory.toString().charAt(dataCategory.toString().length - 1) === ']') {
|
|
163
|
+
if (dataCategory && dataCategory.toString().charAt(0) === '[' && dataCategory.toString().charAt(dataCategory.toString().length - 1) === ']') {
|
|
167
164
|
dataCategory = dataCategory.toString().substring(1, dataCategory.length - 1);
|
|
165
|
+
toReturn['Data Category'] = dataCategory;
|
|
168
166
|
}
|
|
169
|
-
return
|
|
170
|
-
last_known_survival_status: survivalStatus,
|
|
171
|
-
sample_id: sampleId,
|
|
172
|
-
data_category: dataCategory
|
|
173
|
-
});
|
|
167
|
+
return toReturn;
|
|
174
168
|
});
|
|
175
169
|
filterColumns.forEach(column => {
|
|
176
170
|
formatDataVal = JSON.parse(JSON.stringify(formatDataVal).split("\"".concat(column.dataField, "\":")).join("\"".concat(column.header, "\":")));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/table",
|
|
3
|
-
"version": "1.0.1-ccdihub.
|
|
3
|
+
"version": "1.0.1-ccdihub.74",
|
|
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",
|
|
@@ -100,30 +100,21 @@ export function downloadJson(tableData, table, downloadFileName) {
|
|
|
100
100
|
let survivalStatus = entry.last_known_survival_status;
|
|
101
101
|
let sampleId = entry.sample_id;
|
|
102
102
|
let dataCategory = entry.data_category;
|
|
103
|
+
const toReturn = { ...entry };
|
|
103
104
|
|
|
104
|
-
if (
|
|
105
|
-
survivalStatus = '';
|
|
106
|
-
} else if (survivalStatus.toString().charAt(0) === '[' && survivalStatus.toString().charAt(survivalStatus.toString().length - 1) === ']') {
|
|
105
|
+
if (survivalStatus && survivalStatus.toString().charAt(0) === '[' && survivalStatus.toString().charAt(survivalStatus.toString().length - 1) === ']') {
|
|
107
106
|
survivalStatus = survivalStatus.toString().substring(1, survivalStatus.length - 1);
|
|
107
|
+
toReturn['Last Known Survival Status'] = survivalStatus;
|
|
108
108
|
}
|
|
109
|
-
|
|
110
|
-
if (!sampleId || sampleId === '[]') {
|
|
111
|
-
sampleId = '';
|
|
112
|
-
} else if (sampleId.toString().charAt(0) === '[' && sampleId.toString().charAt(sampleId.toString().length - 1) === ']') {
|
|
109
|
+
if (sampleId && sampleId.toString().charAt(0) === '[' && sampleId.toString().charAt(sampleId.toString().length - 1) === ']') {
|
|
113
110
|
sampleId = sampleId.toString().substring(1, sampleId.length - 1);
|
|
111
|
+
toReturn['Sample Id'] = sampleId;
|
|
114
112
|
}
|
|
115
|
-
|
|
116
|
-
if (!dataCategory || dataCategory === '[]') {
|
|
117
|
-
dataCategory = '';
|
|
118
|
-
} else if (dataCategory.toString().charAt(0) === '[' && dataCategory.toString().charAt(dataCategory.toString().length - 1) === ']') {
|
|
113
|
+
if (dataCategory && dataCategory.toString().charAt(0) === '[' && dataCategory.toString().charAt(dataCategory.toString().length - 1) === ']') {
|
|
119
114
|
dataCategory = dataCategory.toString().substring(1, dataCategory.length - 1);
|
|
115
|
+
toReturn['Data Category'] = dataCategory;
|
|
120
116
|
}
|
|
121
|
-
return
|
|
122
|
-
...entry,
|
|
123
|
-
last_known_survival_status: survivalStatus,
|
|
124
|
-
sample_id: sampleId,
|
|
125
|
-
data_category: dataCategory,
|
|
126
|
-
};
|
|
117
|
+
return toReturn;
|
|
127
118
|
});
|
|
128
119
|
filterColumns.forEach((column) => {
|
|
129
120
|
formatDataVal = JSON.parse(
|