Skip to content

Commit

Permalink
Add definition and note to contentForConcept
Browse files Browse the repository at this point in the history
  • Loading branch information
stefandesu committed May 8, 2023
1 parent 6dca760 commit 5ba38f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/components/ConceptDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,6 @@
<b>{{ $t("conceptDetail.modified") }}:</b> <date-string :date="item.modified" />
</span>
</div>
<template v-if="item.definition">
<b>{{ $t("conceptDetail.definition") }}:</b>
<div
v-for="({ language, definition }, index) in Object.keys(item.definition || {}).map(language => item.definition[language].map(definition => ({ language, definition }))).reduce((prev, cur) => prev.concat(cur), []).filter(item => item.language != '-').sort(sortByLanguage)"
:key="`conceptDetail-${isLeft}-defintion-${language}-${index}`"
class="conceptDetail-identifier">
{{ definition }} <sup class="text-lightGrey">{{ language }}</sup>
</div>
</template>
</tab>
<!-- coli-ana (see https://github.com/gbv/cocoda/issues/524) -->
<tab
Expand Down
12 changes: 12 additions & 0 deletions src/utils/concept-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ function contentForConcept(concept) {
languageMap: concept.editorialNote,
isArray: true,
},
{
title: "note",
prop: "note",
languageMap: concept.note,
isArray: true,
},
{
title: "definition",
prop: "definition",
languageMap: concept.definition,
isArray: true,
},
]
return content.filter(part => part.languageMap && Object.keys(part.languageMap).length)
}
Expand Down

0 comments on commit 5ba38f6

Please sign in to comment.