Skip to content
Snippets Groups Projects
Commit d1e14a22 authored by Esko Ikkala's avatar Esko Ikkala
Browse files

Replace undefined with -

parent 58b8aba2
No related branches found
No related tags found
No related merge requests found
......@@ -92,8 +92,13 @@ class VirtualizedTable extends React.PureComponent {
const idRenderer = ({cellData, rowData}) => {
if (cellData == null) return '';
const idLink = <a target='_blank' rel='noopener noreferrer' href={'https://sdbm.library.upenn.edu/manuscripts/' + cellData}>{cellData}</a>;
let sdbmUrl = '';
if (rowData.sdbmId) {
sdbmUrl = 'https://sdbm.library.upenn.edu/manuscripts/';
} else {
sdbmUrl = 'https://sdbm.library.upenn.edu/entries/';
}
const idLink = <a target='_blank' rel='noopener noreferrer' href={sdbmUrl + cellData}>{cellData}</a>;
return (
<div key={cellData}>
{idLink}
......@@ -102,7 +107,7 @@ class VirtualizedTable extends React.PureComponent {
};
const valueFromArray = (property, rowData) => {
if (rowData[property] === 'Undefined') {
if (rowData[property] === '-') {
return rowData[property];
} else {
return rowData[property].map((item => item.split(';')[1])).join(' | ');
......
......@@ -50,13 +50,13 @@ export const mapManuscripts = (sparqlBindings) => {
const results = sparqlBindings.map(b => {
return {
id: b.id.value,
sdbmId: _.has(b, 'sdbmId',) ? b.sdbmId.value : 'Undefined',
sdbmId: _.has(b, 'sdbmId') ? b.sdbmId.value : '-',
prefLabel: b.prefLabel.value,
author: _.has(b, 'author',) ? b.author.value.split('|') : 'Undefined',
timespan: _.has(b, 'timespan',) ? b.timespan.value.split('|') : 'Undefined',
creationPlace: _.has(b, 'creationPlace',) ? b.creationPlace.value.split('|') : 'Undefined',
material: _.has(b, 'material',) ? b.material.value.split('|') : 'Undefined',
language: _.has(b, 'language',) ? b.language.value.split('|') : 'Undefined',
author: _.has(b, 'author',) ? b.author.value.split('|') : '-',
timespan: _.has(b, 'timespan',) ? b.timespan.value.split('|') : '-',
creationPlace: _.has(b, 'creationPlace',) ? b.creationPlace.value.split('|') : '-',
material: _.has(b, 'material',) ? b.material.value.split('|') : '-',
language: _.has(b, 'language',) ? b.language.value.split('|') : '-',
};
});
return results;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment