diff --git a/src/components/Icon/IconHamburger.global.vue b/src/components/Icon/IconHamburger.global.vue index 0b04ede..05a884a 100644 --- a/src/components/Icon/IconHamburger.global.vue +++ b/src/components/Icon/IconHamburger.global.vue @@ -1,7 +1,6 @@ - \ No newline at end of file + diff --git a/src/modules/otus/components/Panel/PanelCitation/PanelCitation.vue b/src/modules/otus/components/Panel/PanelCitation/PanelCitation.vue index 0159067..8b977fe 100644 --- a/src/modules/otus/components/Panel/PanelCitation/PanelCitation.vue +++ b/src/modules/otus/components/Panel/PanelCitation/PanelCitation.vue @@ -1,23 +1,18 @@ @@ -53,8 +57,9 @@ import { ref, watch, computed } from 'vue' import TaxonWorks from '../../../services/TaxonWorks' import CitationRow from './PanelCitationRow.vue' import CitationRowShowMore from './PanelCitationShowMore.vue' +import PanelReferenceRow from './PanelReferenceRow.vue' -const MAX_CITATIONS = 3 +const MAX_CITATIONS = 5 const props = defineProps({ otuId: { @@ -62,15 +67,15 @@ const props = defineProps({ required: true }, - taxon: { - type: Object, + taxonId: { + type: [Number, String], required: true } }) -const rowRefs = ref([]) const showAll = ref(false) const citations = ref([]) +const sources = ref([]) const citationList = computed(() => { const copyArr = citations.value.slice() const first = copyArr.splice(0, MAX_CITATIONS) @@ -86,37 +91,22 @@ const citationList = computed(() => { const menuOptions = computed(() => [ { - label: showAll.value - ? 'Show less' - : 'Show all', - action: () => showAll.value = !showAll.value - }, - { - label: 'Expand', - action: () => changeRowExpandedState(true) - }, - { - label: 'Collapse', - action: () => changeRowExpandedState(false) + label: showAll.value ? 'Show less' : 'Show all', + action: () => (showAll.value = !showAll.value) } ]) watch( - () => props.otuId, + () => props.taxonId, async () => { - if (!props.otuId) { return } - const list = (await TaxonWorks.getTaxonNameCitations(props.otuId)).data + if (!props.taxonId) { + return + } + const { data } = await TaxonWorks.getTaxonNameCitations(props.taxonId) - citations.value = !props.taxon.is_valid - ? list.filter(c => c.names.includes(props.taxon.full_name_tag)) - : list + citations.value = data.timeline + sources.value = data.sources }, { immediate: true } ) - -const changeRowExpandedState = value => { - rowRefs.value.forEach(component => { - component.setExpanded(value) - }) -} diff --git a/src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue b/src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue index ab320ec..c9cd1fb 100644 --- a/src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue +++ b/src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue @@ -1,69 +1,23 @@ \ No newline at end of file + diff --git a/src/modules/otus/components/Panel/PanelCitation/PanelReferenceRow.vue b/src/modules/otus/components/Panel/PanelCitation/PanelReferenceRow.vue new file mode 100644 index 0000000..a5ee9d4 --- /dev/null +++ b/src/modules/otus/components/Panel/PanelCitation/PanelReferenceRow.vue @@ -0,0 +1,18 @@ + + + diff --git a/src/modules/otus/components/Panel/PanelTypeDesignation/PanelTypeDesignation.vue b/src/modules/otus/components/Panel/PanelTypeDesignation/PanelTypeDesignation.vue index 8a17144..589ef0b 100644 --- a/src/modules/otus/components/Panel/PanelTypeDesignation/PanelTypeDesignation.vue +++ b/src/modules/otus/components/Panel/PanelTypeDesignation/PanelTypeDesignation.vue @@ -1,9 +1,7 @@