Skip to content

Commit

Permalink
Merge pull request #214 from zazuko/fix-er-213
Browse files Browse the repository at this point in the history
Show graph name label
  • Loading branch information
ludovicm67 committed Dec 4, 2023
2 parents 73cf1f4 + c0576e5 commit 42d2aee
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-worms-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@zazuko/trifid-entity-renderer": patch
---

Fix issue where graph name label was not shown if it is not a known prefix (closes #213)
2 changes: 1 addition & 1 deletion packages/entity-renderer/renderer/metadata/namedGraphs.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const getLabel = (term) => {
if (term.constructor.name === 'DefaultGraph') {
return 'Default graph'
}
return shrink(term.value)
return shrink(term.value) || term.value
}

const getNamedGraphsCounts = (dataset) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/entity-renderer/renderer/web-component/N3Term.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { shrink } from '@zazuko/prefixes'

function renderTerm (term) {
if (term.termType === 'NamedNode') {
return html`<a href="${term.value}">${shrink(term.value)}</a>`
return html`<a href="${term.value}">${shrink(term.value) || term.value}</a>`
}
if (term.constructor.name === 'DefaultGraph') {
return html`Default graph`
Expand Down

0 comments on commit 42d2aee

Please sign in to comment.