Skip to content

Commit

Permalink
Adjust footer of concordance view
Browse files Browse the repository at this point in the history
Only show total number of mappings inside the listed concordances.
  • Loading branch information
stefandesu committed Sep 27, 2023
1 parent 2436d2a commit d15aeb8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 2 additions & 2 deletions config/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"date": "Date",
"download": "Download",
"showMappings": "Show Mappings",
"total": "Total",
"total": "with a total of",
"searchSourceScheme": "source scheme",
"searchSourceNotation": "source notation/URI",
"searchTargetScheme": "target scheme",
Expand Down Expand Up @@ -640,7 +640,7 @@
"date": "Datum",
"download": "Download",
"showMappings": "Mappings anzeigen",
"total": "Gesamt",
"total": "mit insgesamt",
"searchSourceScheme": "Quellvokabular",
"searchSourceNotation": "Quellnotation/-URI",
"searchTargetScheme": "Zielvokabular",
Expand Down
15 changes: 6 additions & 9 deletions src/components/MappingBrowser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,13 @@
</flexible-table>
</div>
<div style="display: flex;">
<p style="font-weight: bold; flex: 1; padding-left: 5px;">
<p style="flex: 1; text-align: right; font-weight: bold; padding-right: 45px;">
{{ concordanceTableItems.length }} {{ $t("mappingBrowser.concordances") }}
</p>
<p style="text-align: right; font-weight: bold; padding-right: 45px;">
{{ $t("mappingBrowser.total") }}: {{ concordanceTableItems.reduce((total, current) => {
return total + current.mappings || 0
}, 0).toLocaleString() }} {{ $t("general.of") }} {{ totalNumberOfMappings && totalNumberOfMappings.toLocaleString() || "?" }}
{{ $t("mappingBrowser.total") }}
{{ concordanceTableItems.reduce((total, current) => {
return total + (current.mappings || 0)
}, 0).toLocaleString() }}
{{ $t("registryInfo.mappings") }}
</p>
<data-modal-button
v-if="concordances && concordances.length > 0"
Expand Down Expand Up @@ -538,7 +538,6 @@ export default {
return {
tab: 0,
concordancesLoaded: false,
totalNumberOfMappings: null,
/** Whether tab was automatically switched to Mapping Navigator once.
* Will not switch automatically again afterwards.
*/
Expand Down Expand Up @@ -1788,8 +1787,6 @@ export default {
},
async refreshConcordances() {
await this.loadConcordances()
// Also retrieve total number of mappings in those registries
this.totalNumberOfMappings = (await Promise.all(this.concordanceRegistries.map(r => r.getMappings({ limit: 1 })))).reduce((p, c) => p + c._totalCount, 0)
this.concordancesLoaded = true
},
refreshEmbeddedMappings() {
Expand Down

0 comments on commit d15aeb8

Please sign in to comment.