From e8519c2bc0d6862d37f3b389dd6fe0282f064057 Mon Sep 17 00:00:00 2001 From: W Beecher Baker Date: Thu, 12 Sep 2024 14:54:22 -0400 Subject: [PATCH] Simplify 'In the Collection' listing, and headline by scientific name / authorship --- .../Panel/PanelSpecimens/PanelSpecimens.vue | 49 +++++++-------- .../Panel/PanelSpecimens/SpecimenSummary.vue | 59 +++++-------------- 2 files changed, 41 insertions(+), 67 deletions(-) diff --git a/src/modules/otus/components/Panel/PanelSpecimens/PanelSpecimens.vue b/src/modules/otus/components/Panel/PanelSpecimens/PanelSpecimens.vue index 164321a..e37fea4 100644 --- a/src/modules/otus/components/Panel/PanelSpecimens/PanelSpecimens.vue +++ b/src/modules/otus/components/Panel/PanelSpecimens/PanelSpecimens.vue @@ -18,13 +18,8 @@

@@ -50,23 +45,31 @@ const inventoryDWC = ref("Loading...") const isLoading = ref(false) watch( - () => props.otuId, - async () => { - if (!props.otuId) { - inventoryDWC.value = 'No OTU specified.' - return - } + () => props.otuId, + async () => { + if (!props.otuId) { + inventoryDWC.value = 'No OTU specified.' + return + } - isLoading.value = true - useOtuPageRequest('panel:specimens', () => - TaxonWorks.getOtuInventoryDarwinCore(props.otuId) - ).then(({data}) => { - inventoryDWC.value = data - }).catch( - e => inventoryDWC.value = `Error: ${e}` - ).finally(() => isLoading.value = false) - }, - {immediate: true} - ) + isLoading.value = true + useOtuPageRequest('panel:specimens', () => + TaxonWorks.getOtuInventoryDarwinCore(props.otuId) + ).then(({data}) => { + inventoryDWC.value = data + }).catch( + e => inventoryDWC.value = `Error: ${e}` + ).finally(() => isLoading.value = false) + }, + {immediate: true} +) + +function genusSpecies(specimen) { + return [specimen.genus, specimen.specificEpithet].filter(Boolean).join(' ') +} + +function nameAndAuthor(specimen) { + return [`${genusSpecies(specimen)}`, specimen.scientificNameAuthorship].filter(Boolean).join(' ') +} diff --git a/src/modules/otus/components/Panel/PanelSpecimens/SpecimenSummary.vue b/src/modules/otus/components/Panel/PanelSpecimens/SpecimenSummary.vue index 9b9e6b8..96b099e 100644 --- a/src/modules/otus/components/Panel/PanelSpecimens/SpecimenSummary.vue +++ b/src/modules/otus/components/Panel/PanelSpecimens/SpecimenSummary.vue @@ -1,54 +1,25 @@ \ No newline at end of file