Skip to content

Commit b0f28c2

Browse files
authored
Merge pull request #199 from CBIIT/dev-1.2.2
Pull from Dev 1.2.2
2 parents 6dfbacc + e85d3b8 commit b0f28c2

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

src/pages/datasetDetailPage/DatasetDetail.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,25 @@ const DatasetDetail = ({
142142
if (pocLinks) { pocLinks = pocLinks.split(';'); }
143143
const sortedAdditonals = sortingAdditionalElement(content);
144144
const grantIDs = [];
145+
const grantNames = [];
145146
const grants = new Map();
146147
if (sortedAdditonals) {
147148
if (sortedAdditonals.includes("GRANT ID")) {
148149
additionalDict["GRANT ID"].forEach((item, i) => {
149150
grantIDs[i] = item.k;
150-
grants.set(item.k, additionalDict["GRANT NAME"][i].k);
151151
});
152152
}
153+
if (sortedAdditonals.includes("GRANT NAME")) {
154+
additionalDict["GRANT NAME"].forEach((item, i) => {
155+
grantNames[i] = item.k;
156+
});
157+
}
158+
for (let i = 0; i < grantIDs.length; i += 1) {
159+
if (grantNames[i] === null) {
160+
grants.set(grantIDs[i], "");
161+
}
162+
grants.set(grantIDs[i], grantNames[i]);
163+
}
153164
}
154165
useEffect(() => {
155166
if (!content) {
@@ -788,8 +799,14 @@ const DatasetDetail = ({
788799
<table className="table table-borderless">
789800
<tbody>
790801
<tr>
791-
{item ? <td width="210px"><div className="grantIDDataContainer">{item}</div></td> : null}
792-
{grants.get(item) ? <td><div className="grantNameDataContainer">{grants.get(item)}</div></td> : null}
802+
<td width="210px" style={{paddingLeft: "0px"}}>
803+
<div>
804+
{
805+
item.split(',').join(",\n")
806+
}
807+
</div>
808+
</td>
809+
<td><div className="grantNameDataContainer">{grants.get(item)}</div></td>
793810
</tr>
794811
</tbody>
795812
</table>

0 commit comments

Comments
 (0)