From ff13455b56647b9aefcac6f389929a4856c6ee2d Mon Sep 17 00:00:00 2001 From: "@s.roertgen" Date: Tue, 26 Mar 2024 16:33:14 +0100 Subject: [PATCH] WIP: Allow multiple entries for `note` and `scopeNote` #281 --- src/components/Concept.jsx | 24 +++++++++++++----------- src/context.js | 4 ++-- src/types.js | 4 ++-- test/data/pageContext.js | 4 ++-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/components/Concept.jsx b/src/components/Concept.jsx index 58702c9..f570293 100644 --- a/src/components/Concept.jsx +++ b/src/components/Concept.jsx @@ -52,22 +52,24 @@ const Concept = ({ )} - {concept.scopeNote && ( + {concept.scopeNote && i18n(language)(concept.scopeNote) !== "" && (
-

Scope Note

- - {i18n(language)(concept.scopeNote) || - `*No scope note in language "${language}" provided.*`} - +

ScopeNote

+
)} - {concept.note && ( + {concept.note && i18n(language)(concept.note) !== "" && (

Note

- - {i18n(language)(concept.note) || - `*No note in language "${language}" provided.*`} - +
)} {concept.altLabel && i18n(language)(concept.altLabel) !== "" && ( diff --git a/src/context.js b/src/context.js index 0ae32b3..92eddf8 100644 --- a/src/context.js +++ b/src/context.js @@ -49,10 +49,10 @@ const jsonld = { "@container": "@language", }, scopeNote: { - "@container": "@language", + "@container": ["@language", "@set"], }, note: { - "@container": "@language", + "@container": ["@language", "@set"], }, notation: { "@container": "@set", diff --git a/src/types.js b/src/types.js index 911dc60..223dee9 100644 --- a/src/types.js +++ b/src/types.js @@ -20,8 +20,8 @@ module.exports = (languages) => ` altLabel: LanguageMapArray, hiddenLabel: LanguageMapArray, definition: LanguageMap, - scopeNote: LanguageMap, - note: LanguageMap, + scopeNote: LanguageMapArray, + note: LanguageMapArray, notation: [String], example: LanguageMap, topConceptOf: [ConceptScheme] @link(from: "topConceptOf___NODE"), diff --git a/test/data/pageContext.js b/test/data/pageContext.js index 116a23f..b54ad52 100644 --- a/test/data/pageContext.js +++ b/test/data/pageContext.js @@ -50,10 +50,10 @@ export const topConcept = { de: "Ein Beispiel", }, scopeNote: { - de: "Meine Scope Note", + de: ["Meine Scope Note"], }, note: { - de: "Meine Anmerkung", + de: ["Meine Anmerkung"], }, notation: ["1"], narrower: [concept2],