Skip to content

Commit

Permalink
fix: show more informative message when all gts are deselected (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrer authored Jun 17, 2024
1 parent cc76ffc commit 6a4bd20
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/components/workflows/WorkflowsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ const groupByDocuments = () => {
Loading...
</template>
<template v-else>
<div class="flex flex-col" v-if="evals.length > 0">
<div class="flex flex-col" v-if="Object.keys(groupedData).length > 0">
<div class="flex items-center mb-4 ml-auto">
<p class="mr-2">{{ $t('group_by') }}:</p>
<Dropdown v-model="sortBy" :options="sortOptions" optionLabel="label" placeholder="Choose something.." class="" />
</div>
<TrendLegend :show-text-colors="false" class="ml-auto mb-4"/>
</div>
<table v-if="evals.length > 0" class="w-full border border-collapse rounded text-sm">
<table v-if="Object.keys(groupedData).length > 0" class="w-full border border-collapse rounded text-sm">
<thead>
<tr>
<th class="p-2 border">{{ sortBy.value === 'documents' ? $t('documents') : $t('workflows') }}</th>
Expand Down Expand Up @@ -168,7 +168,7 @@ const groupByDocuments = () => {
</template>
</tbody>
</table>
<div v-else>{{ $t('no_table_data') }}</div>
<div v-else class="mt-12 mb-6">{{ $t('no_documents_selected') }}</div>
</template>
</template>

Expand Down
31 changes: 18 additions & 13 deletions src/components/workflows/WorkflowsTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,29 @@ watch(selectedMetric,

<template>
<div class="flex flex-col">
<div class="flex w-full mb-4">
<Dropdown
v-model="selectedMetric"
:options="metrics"
:pt="DropdownPassThroughStyles"
optionLabel="label"
placeholder="Select a metric"
class="ml-auto md:w-14rem"
unstyled
/>
</div>
<TrendLegend class="ml-auto mb-4"/>
<template v-if="gtList.length > 0">
<div class="flex w-full mb-4">
<Dropdown
v-model="selectedMetric"
:options="metrics"
:pt="DropdownPassThroughStyles"
optionLabel="label"
placeholder="Select a metric"
class="ml-auto md:w-14rem"
unstyled
/>
</div>
<TrendLegend class="ml-auto mb-4"/>
</template>
<div class="flex flex-col space-y-6">
<template v-if="gtList.length > 0">
<TimelineItem v-for="gt in gtList" :key="gt.id" :gt="gt" :metric="selectedMetricValue" />
</template>
<template v-else-if="workflowsStore.gt.length > 0 ">
<div class="my-6">{{ $t('no_documents_selected') }}</div>
</template>
<template v-else>
<div class="my-6">An error has occurred. Please try again later!</div>
<div class="my-6">{{ $t('error_please_try_again_later') }}</div>
</template>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
"cer_min_desc": "CER Min absteigend",
"cer_max_asc": "CER Max aufsteigend",
"cer_max_desc": "CER Max absteigend",
"no_table_data": "Keine Tabellendaten verfügbar",
"workflow_steps": "Workflowschritte",
"external_repo_url": "Externer Link zum Repository",
"change": "Ändern",
Expand Down Expand Up @@ -70,5 +69,7 @@
"workflows_intro_additional_infos": "Weitere Informationen finden Sie auf der OCR-D-Website {ocrd_link}.",
"ocrd_link": "https://ocr-d.de/de/",
"workflows_intro_gt_guidelines": "Die OCR-D Ground Truth Richtlinien können unter {gt_guidelines_link} abgerufen werden.",
"gt_guidelines_link": "https://ocr-d.de/de/gt-guidelines/trans/"
"gt_guidelines_link": "https://ocr-d.de/de/gt-guidelines/trans/",
"no_documents_selected": "Es sind keine Dokumente (Ground Truth) ausgewählt. Bitte wählen Sie alle oder spezifische Ground Truths aus.",
"error_please_try_again_later": "Es ist ein Fehler aufgetreten. Bitte versuchen Sie es später erneut!"
}
5 changes: 3 additions & 2 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"cer_min_desc": "CER Min descending",
"cer_max_asc": "CER Max ascending",
"cer_max_desc": "CER Max descending",
"no_table_data": "No table data available",
"workflow_steps": "Workflow steps",
"external_repo_url": "External link to the repository",
"change": "Change",
Expand Down Expand Up @@ -64,5 +63,7 @@
"workflows_intro_additional_infos": "For more information see the OCR-D website {ocrd_link}.",
"ocrd_link": "https://ocr-d.de/en/",
"workflows_intro_gt_guidelines": "The OCR-D Ground Truth Guidelines can be found under {gt_guidelines_link}.",
"gt_guidelines_link": "https://ocr-d.de/en/gt-guidelines/trans/"
"gt_guidelines_link": "https://ocr-d.de/en/gt-guidelines/trans/",
"no_documents_selected": "No documents (Ground Truth) are selected. Please select all or specific ground truths.",
"error_please_try_again_later": "An error has occurred. Please try again later!"
}

0 comments on commit 6a4bd20

Please sign in to comment.