diff --git a/cypress/e2e/conceptSchemeAndConcept.cy.js b/cypress/e2e/conceptSchemeAndConcept.cy.js index 97ec3fe..7689c06 100644 --- a/cypress/e2e/conceptSchemeAndConcept.cy.js +++ b/cypress/e2e/conceptSchemeAndConcept.cy.js @@ -64,6 +64,16 @@ describe("Concept Scheme and Concept", () => { cy.get("h1").should("have.text", "Hash URI Konzept Schema") }) + it("Visting a hash URI Concept Scheme with hash uri in URL works", () => { + cy.visit("/example.org/hashURIConceptScheme.html#scheme", { + onBeforeLoad(win) { + Object.defineProperty(win.navigator, "language", { value: "de-DE" }) + }, + }) + cy.get(".conceptScheme > a").should("have.text", "Hash URI Konzept Schema") + cy.get("h1").should("have.text", "Hash URI Konzept Schema") + }) + it("Visting a hash URI Concept works", () => { cy.visit("/example.org/hashURIConceptScheme.html#concept1", { onBeforeLoad(win) { diff --git a/gatsby-node.js b/gatsby-node.js index e0db5a3..c817f73 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -299,7 +299,14 @@ exports.createPages = async ({ graphql, actions: { createPage } }) => { const conceptsInScheme = await graphql( queries.allConcept(conceptScheme.id, languages) ) - const embeddedConcepts = [] + // embed concept scheme data + const embeddedConcepts = [ + { + json: omitEmpty(Object.assign({}, conceptScheme, context.jsonld)), + jsonld: omitEmpty(Object.assign({}, conceptScheme, context.jsonld)), + }, + ] + conceptsInScheme.data.allConcept.edges.forEach(({ node: concept }) => { const json = omitEmpty(Object.assign({}, concept, context.jsonld)) const jsonld = omitEmpty(Object.assign({}, concept, context.jsonld)) diff --git a/src/components/Collection.jsx b/src/components/Collection.jsx index 4dcd86b..5556116 100644 --- a/src/components/Collection.jsx +++ b/src/components/Collection.jsx @@ -15,7 +15,7 @@ const Collection = ({ pageContext: { node: collection, customDomain } }) => { }, [data?.selectedLanguage]) return ( -
+

{i18n(language)(collection.prefLabel)}

{collection.id}

diff --git a/src/components/Concept.jsx b/src/components/Concept.jsx index 2834973..b148571 100644 --- a/src/components/Concept.jsx +++ b/src/components/Concept.jsx @@ -19,13 +19,14 @@ const Concept = ({ }, [data?.selectedLanguage]) return ( -
+

{concept.deprecated ? "Deprecated" : ""}

{concept.notation && {concept.notation.join(",")} } - {i18n(language)(concept.prefLabel)} + {(concept?.prefLabel && i18n(language)(concept.prefLabel)) || + (concept?.title && i18n(language)(concept.title))}

diff --git a/src/components/ConceptScheme.jsx b/src/components/ConceptScheme.jsx index 801f4d3..9ee48ca 100644 --- a/src/components/ConceptScheme.jsx +++ b/src/components/ConceptScheme.jsx @@ -22,19 +22,13 @@ const ConceptScheme = ({ if (pathname.hash) { const filtered = embed.filter((c) => c.json.id.endsWith(pathname.hash)) return ( -
+
) } else { return ( -
+

{i18n(language)(conceptScheme.title)}

diff --git a/src/templates/App.jsx b/src/templates/App.jsx index 52d8d9e..b9a6c93 100644 --- a/src/templates/App.jsx +++ b/src/templates/App.jsx @@ -198,7 +198,7 @@ const App = ({ pageContext, children, location }) => { )}
- {children} +
{children}
)