Skip to content
Snippets Groups Projects
Commit 274ec470 authored by Moises Sacal's avatar Moises Sacal
Browse files

added simple comma and orcid fix

parent 4eeeffe4
Branches
No related merge requests found
...@@ -25,8 +25,7 @@ const Router = async function (state) { ...@@ -25,8 +25,7 @@ const Router = async function (state) {
//Just to avoid extra ajax calls but we can have multiple relationships here //Just to avoid extra ajax calls but we can have multiple relationships here
if (state.main.doc.record_type_s || state.main.doc.record_type_s === 'Person') { if (state.main.doc.record_type_s || state.main.doc.record_type_s === 'Person') {
//Removing orcid.org to have better matches //Removing orcid.org to have better matches
state.main.doc.id = state.main.doc.id.replace("https://orcid.org/", ""); state.main.doc.id = state.main.doc.id.replace("http://orcid.org/0000-000", "");
//state.main.doc.id = encodeURIComponent(state.main.doc.id);
//state.main.doc.id = encodeURIComponent(state.main.doc.id); //state.main.doc.id = encodeURIComponent(state.main.doc.id);
const res = await solrService.search({api: state.config.api}, { const res = await solrService.search({api: state.config.api}, {
start: 0, start: 0,
......
...@@ -3,11 +3,18 @@ const isIterable = require('../isIterable'); ...@@ -3,11 +3,18 @@ const isIterable = require('../isIterable');
const SubDocHorizontal = function (data) { const SubDocHorizontal = function (data) {
const div = $('<div class="row">'); const div = $('<div class="row">');
const headerDiv = $('<div class="col-sm-2">').html(data.fieldName); let subDiv = $('<div>');
div.append(headerDiv);
if (data.fieldName) {
const headerDiv = $('<div class="col-sm-2">').html(data.fieldName);
div.append(headerDiv);
subDiv.addClass('col-sm-10');
}
if (isIterable(data.value)) { if (isIterable(data.value)) {
let i = 0;
for (let key of data.value) { for (let key of data.value) {
i++;
try { try {
const a = $('<a>'); const a = $('<a>');
const subEle = $('<span class="">'); const subEle = $('<span class="">');
...@@ -18,14 +25,16 @@ const SubDocHorizontal = function (data) { ...@@ -18,14 +25,16 @@ const SubDocHorizontal = function (data) {
a.text(sub['name']); a.text(sub['name']);
a.addClass("link"); a.addClass("link");
subEle.append(a); subEle.append(a);
div.append(subEle); subDiv.append(subEle);
if (data.value.length > i) {
subDiv.append($('<span>,&nbsp;</span>'));
}
} catch (e) { } catch (e) {
div.append(''); subDiv.append('');
} }
} }
} }
div.append(subDiv);
return div; return div;
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment