Skip to content

Commit

Permalink
oaipmh: update admin list view
Browse files Browse the repository at this point in the history
* display spec with <pre> tag
* closes inveniosoftware/invenio-administration#94
  • Loading branch information
jrcastro2 committed Sep 22, 2022
1 parent 3863029 commit baec637
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ class SearchResultItemComponent extends Component {
return result.system_created;
};

displayAsPre = (result, property) => {
if (property === "spec") {
return <pre>{_get(result, property)}</pre>;
} else {
return _get(result, property);
}
};

render() {
const {
title,
Expand Down Expand Up @@ -61,10 +69,10 @@ class SearchResultItemComponent extends Component {
idKeyPath
)}
>
{_get(result, property)}
{this.displayAsPre(result, property)}
</a>
) : (
_get(result, property)
this.displayAsPre(result, property)
)}
</Table.Cell>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { NotificationController } from "@js/invenio_administration/src/ui_messag
const domContainer = document.getElementById("invenio-search-config");

const sortColumns = (columns) =>
Object.entries(columns).sort((a, b) => a[1].order > b[1].order);
Object.entries(columns).sort((a, b) => a[1].order - b[1].order);
const title = JSON.parse(domContainer.dataset.title);
const resourceName = JSON.parse(domContainer.dataset.resourceName);
const columns = JSON.parse(domContainer.dataset.fields);
Expand Down

0 comments on commit baec637

Please sign in to comment.