Skip to content

Commit

Permalink
Add text for empty recent diagnoses panel
Browse files Browse the repository at this point in the history
  • Loading branch information
danlamanna committed Nov 22, 2024
1 parent 149488b commit 2e2ac63
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion isic/core/templates/core/widgets/diagnosis_picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

<script>
function frequentDiagnoses() {
const mostFrequentDiagnoses = JSON.parse(document.getElementById('most-frequent-diagnoses').textContent);
let mostFrequentDiagnoses = [];
if (document.getElementById('most-frequent-diagnoses')) {
mostFrequentDiagnoses = JSON.parse(document.getElementById('most-frequent-diagnoses').textContent);
}

return {
selectedDiagnosis: null,
Expand Down Expand Up @@ -34,6 +37,11 @@

<div class="quick-select" x-data="frequentDiagnoses()">
<h3>Recent Diagnoses</h3>

<template x-if="mostFrequentDiagnoses.length === 0">
<div class="text-sm text-gray-500 text-center">Start annotating to see your recent diagnoses here</div>
</template>

<div class="quick-select-list" id="quick-select-list">
<template x-for="diagnosis in mostFrequentDiagnoses" :key="diagnosis.id">
<div class="quick-select-item"
Expand Down

0 comments on commit 2e2ac63

Please sign in to comment.