@bento-core/table 1.0.1-ccdiintegrated.1 → 1.0.1-ccdiintegrated.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/util/downloadTable.js +36 -1
- package/package.json +3 -3
- package/src/util/downloadTable.js +37 -1
|
@@ -60,7 +60,7 @@ function convertToCSV(jsonse, keysToInclude, header) {
|
|
|
60
60
|
} else {
|
|
61
61
|
line += entry[keyName] !== null ? "\"".concat(entry[keyName], "\"") : ' ';
|
|
62
62
|
}
|
|
63
|
-
} else if (keyName === 'last_known_survival_status' || keyName === 'sample_id' || keyName === 'data_category') {
|
|
63
|
+
} else if (keyName === 'last_known_survival_status' || keyName === 'sample_id' || keyName === 'data_category' || keyName === 'participant_id' || keyName === 'anatomic_site' || keyName === 'participant_age_at_collection' || keyName === 'sample_description' || keyName === 'percent_tumor' || keyName === 'percent_necrosis' || keyName === 'consent_codes') {
|
|
64
64
|
if (!entry[keyName] || entry[keyName] === '[]') {
|
|
65
65
|
line += '';
|
|
66
66
|
} else if (entry[keyName].toString().charAt(0) === '[' && entry[keyName].toString().charAt(entry[keyName].toString().length - 1) === ']') {
|
|
@@ -162,6 +162,13 @@ function downloadJson(tableData, table, downloadFileName) {
|
|
|
162
162
|
let survivalStatus = entry.last_known_survival_status;
|
|
163
163
|
let sampleId = entry.sample_id;
|
|
164
164
|
let dataCategory = entry.data_category;
|
|
165
|
+
let participantId = entry.participant_id;
|
|
166
|
+
let anatomicSite = entry.anatomic_site;
|
|
167
|
+
let ageAtCollection = entry.participant_age_at_collection;
|
|
168
|
+
let sampleDescription = entry.sample_description;
|
|
169
|
+
let percentTumor = entry.percent_tumor;
|
|
170
|
+
let percentNecrosis = entry.percent_necrosis;
|
|
171
|
+
let consentCodes = entry.consent_codes;
|
|
165
172
|
const toReturn = _objectSpread({}, entry);
|
|
166
173
|
if (survivalStatus && survivalStatus.toString().charAt(0) === '[' && survivalStatus.toString().charAt(survivalStatus.toString().length - 1) === ']') {
|
|
167
174
|
survivalStatus = survivalStatus.toString().substring(1, survivalStatus.length - 1);
|
|
@@ -175,6 +182,34 @@ function downloadJson(tableData, table, downloadFileName) {
|
|
|
175
182
|
dataCategory = dataCategory.toString().substring(1, dataCategory.length - 1);
|
|
176
183
|
toReturn['Data Category'] = dataCategory;
|
|
177
184
|
}
|
|
185
|
+
if (participantId && participantId.toString().charAt(0) === '[' && participantId.toString().charAt(participantId.toString().length - 1) === ']') {
|
|
186
|
+
participantId = participantId.toString().substring(1, participantId.length - 1);
|
|
187
|
+
toReturn['Participant ID'] = participantId;
|
|
188
|
+
}
|
|
189
|
+
if (anatomicSite && anatomicSite.toString().charAt(0) === '[' && anatomicSite.toString().charAt(anatomicSite.toString().length - 1) === ']') {
|
|
190
|
+
anatomicSite = anatomicSite.toString().substring(1, anatomicSite.length - 1);
|
|
191
|
+
toReturn['Anatomic Site'] = anatomicSite;
|
|
192
|
+
}
|
|
193
|
+
if (ageAtCollection && ageAtCollection.toString().charAt(0) === '[' && ageAtCollection.toString().charAt(ageAtCollection.toString().length - 1) === ']') {
|
|
194
|
+
ageAtCollection = ageAtCollection.toString().substring(1, ageAtCollection.length - 1);
|
|
195
|
+
toReturn['Age at Collection'] = ageAtCollection;
|
|
196
|
+
}
|
|
197
|
+
if (sampleDescription && sampleDescription.toString().charAt(0) === '[' && sampleDescription.toString().charAt(sampleDescription.toString().length - 1) === ']') {
|
|
198
|
+
sampleDescription = sampleDescription.toString().substring(1, sampleDescription.length - 1);
|
|
199
|
+
toReturn['Sample Description'] = sampleDescription;
|
|
200
|
+
}
|
|
201
|
+
if (percentTumor && percentTumor.toString().charAt(0) === '[' && percentTumor.toString().charAt(percentTumor.toString().length - 1) === ']') {
|
|
202
|
+
percentTumor = percentTumor.toString().substring(1, percentTumor.length - 1);
|
|
203
|
+
toReturn['Percent Tumor'] = percentTumor;
|
|
204
|
+
}
|
|
205
|
+
if (percentNecrosis && percentNecrosis.toString().charAt(0) === '[' && percentNecrosis.toString().charAt(percentNecrosis.toString().length - 1) === ']') {
|
|
206
|
+
percentNecrosis = percentNecrosis.toString().substring(1, percentNecrosis.length - 1);
|
|
207
|
+
toReturn['Percent Necrosis'] = percentNecrosis;
|
|
208
|
+
}
|
|
209
|
+
if (consentCodes && consentCodes.toString().charAt(0) === '[' && consentCodes.toString().charAt(consentCodes.toString().length - 1) === ']') {
|
|
210
|
+
consentCodes = consentCodes.toString().substring(1, consentCodes.length - 1);
|
|
211
|
+
toReturn['Consent Codes'] = consentCodes;
|
|
212
|
+
}
|
|
178
213
|
toDelete.forEach(column => delete toReturn[column.dataField]);
|
|
179
214
|
return toReturn;
|
|
180
215
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bento-core/table",
|
|
3
|
-
"version": "1.0.1-ccdiintegrated.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.1-ccdiintegrated.2",
|
|
5
4
|
"homepage": "https://github.com/CBIIT/bento-frontend#readme",
|
|
6
5
|
"bugs": {
|
|
7
6
|
"url": "https://github.com/CBIIT/bento-frontend/issues"
|
|
@@ -39,5 +38,6 @@
|
|
|
39
38
|
},
|
|
40
39
|
"publishConfig": {
|
|
41
40
|
"access": "public"
|
|
42
|
-
}
|
|
41
|
+
},
|
|
42
|
+
"description": ""
|
|
43
43
|
}
|
|
@@ -46,7 +46,7 @@ export function convertToCSV(jsonse, keysToInclude, header) {
|
|
|
46
46
|
} else {
|
|
47
47
|
line += entry[keyName] !== null ? `"${entry[keyName]}"` : ' ';
|
|
48
48
|
}
|
|
49
|
-
} else if (keyName === 'last_known_survival_status' || keyName === 'sample_id' || keyName === 'data_category') {
|
|
49
|
+
} else if (keyName === 'last_known_survival_status' || keyName === 'sample_id' || keyName === 'data_category' || keyName === 'participant_id' || keyName === 'anatomic_site' || keyName === 'participant_age_at_collection' || keyName === 'sample_description' || keyName === 'percent_tumor' || keyName === 'percent_necrosis' || keyName === 'consent_codes') {
|
|
50
50
|
if (!entry[keyName] || entry[keyName] === '[]') {
|
|
51
51
|
line += '';
|
|
52
52
|
} else if (entry[keyName].toString().charAt(0) === '[' && entry[keyName].toString().charAt(entry[keyName].toString().length - 1) === ']') {
|
|
@@ -103,6 +103,13 @@ export function downloadJson(tableData, table, downloadFileName) {
|
|
|
103
103
|
let survivalStatus = entry.last_known_survival_status;
|
|
104
104
|
let sampleId = entry.sample_id;
|
|
105
105
|
let dataCategory = entry.data_category;
|
|
106
|
+
let participantId = entry.participant_id;
|
|
107
|
+
let anatomicSite = entry.anatomic_site;
|
|
108
|
+
let ageAtCollection = entry.participant_age_at_collection;
|
|
109
|
+
let sampleDescription = entry.sample_description;
|
|
110
|
+
let percentTumor = entry.percent_tumor;
|
|
111
|
+
let percentNecrosis = entry.percent_necrosis;
|
|
112
|
+
let consentCodes = entry.consent_codes;
|
|
106
113
|
const toReturn = { ...entry };
|
|
107
114
|
|
|
108
115
|
if (survivalStatus && survivalStatus.toString().charAt(0) === '[' && survivalStatus.toString().charAt(survivalStatus.toString().length - 1) === ']') {
|
|
@@ -117,6 +124,35 @@ export function downloadJson(tableData, table, downloadFileName) {
|
|
|
117
124
|
dataCategory = dataCategory.toString().substring(1, dataCategory.length - 1);
|
|
118
125
|
toReturn['Data Category'] = dataCategory;
|
|
119
126
|
}
|
|
127
|
+
if (participantId && participantId.toString().charAt(0) === '[' && participantId.toString().charAt(participantId.toString().length - 1) === ']') {
|
|
128
|
+
participantId = participantId.toString().substring(1, participantId.length - 1);
|
|
129
|
+
toReturn['Participant ID'] = participantId;
|
|
130
|
+
}
|
|
131
|
+
if (anatomicSite && anatomicSite.toString().charAt(0) === '[' && anatomicSite.toString().charAt(anatomicSite.toString().length - 1) === ']') {
|
|
132
|
+
anatomicSite = anatomicSite.toString().substring(1, anatomicSite.length - 1);
|
|
133
|
+
toReturn['Anatomic Site'] = anatomicSite;
|
|
134
|
+
}
|
|
135
|
+
if (ageAtCollection && ageAtCollection.toString().charAt(0) === '[' && ageAtCollection.toString().charAt(ageAtCollection.toString().length - 1) === ']') {
|
|
136
|
+
ageAtCollection = ageAtCollection.toString().substring(1, ageAtCollection.length - 1);
|
|
137
|
+
toReturn['Age at Collection'] = ageAtCollection;
|
|
138
|
+
}
|
|
139
|
+
if (sampleDescription && sampleDescription.toString().charAt(0) === '[' && sampleDescription.toString().charAt(sampleDescription.toString().length - 1) === ']') {
|
|
140
|
+
sampleDescription = sampleDescription.toString().substring(1, sampleDescription.length - 1);
|
|
141
|
+
toReturn['Sample Description'] = sampleDescription;
|
|
142
|
+
}
|
|
143
|
+
if (percentTumor && percentTumor.toString().charAt(0) === '[' && percentTumor.toString().charAt(percentTumor.toString().length - 1) === ']') {
|
|
144
|
+
percentTumor = percentTumor.toString().substring(1, percentTumor.length - 1);
|
|
145
|
+
toReturn['Percent Tumor'] = percentTumor;
|
|
146
|
+
}
|
|
147
|
+
if (percentNecrosis && percentNecrosis.toString().charAt(0) === '[' && percentNecrosis.toString().charAt(percentNecrosis.toString().length - 1) === ']') {
|
|
148
|
+
percentNecrosis = percentNecrosis.toString().substring(1, percentNecrosis.length - 1);
|
|
149
|
+
toReturn['Percent Necrosis'] = percentNecrosis;
|
|
150
|
+
}
|
|
151
|
+
if (consentCodes && consentCodes.toString().charAt(0) === '[' && consentCodes.toString().charAt(consentCodes.toString().length - 1) === ']') {
|
|
152
|
+
consentCodes = consentCodes.toString().substring(1, consentCodes.length - 1);
|
|
153
|
+
toReturn['Consent Codes'] = consentCodes;
|
|
154
|
+
}
|
|
155
|
+
|
|
120
156
|
toDelete.forEach((column) => delete toReturn[column.dataField]);
|
|
121
157
|
return toReturn;
|
|
122
158
|
});
|