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 @@
-
- Nomenclature, citations ({{ citations.length }})
-
-
+ Timeline ({{ citations.length }})
+
-
+
-
+
@@ -30,8 +25,7 @@
@@ -39,12 +33,22 @@
-
+
+
+
+
+ References
+
+
@@ -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 @@
-
- Type
-
+ Type
@@ -25,20 +23,23 @@ const props = defineProps({
const typeDesignation = ref({})
const typeDesignationLabel = computed(() =>
[
- typeDesignation.value.subject_object_tag || '',
+ typeDesignation.value.subject_object_tag || '',
typeDesignation.value.subject_status_tag || '',
typeDesignation.value.object_object_tag || ''
- ].join(' '))
+ ].join(' ')
+)
watch(
() => props.taxonId,
async () => {
- if (!props.taxonId) { return }
+ if (!props.taxonId) {
+ return
+ }
TaxonWorks.getTaxonTypeDesignation(props.taxonId).then(({ data }) => {
- typeDesignation.value = data.type_taxon_name_relationship
+ typeDesignation.value = data.type_taxon_name_relationship || {}
})
},
{ immediate: true }
)
-
\ No newline at end of file
+
diff --git a/src/modules/otus/services/TaxonWorks.js b/src/modules/otus/services/TaxonWorks.js
index b3e6328..14f8863 100644
--- a/src/modules/otus/services/TaxonWorks.js
+++ b/src/modules/otus/services/TaxonWorks.js
@@ -1,44 +1,53 @@
-import { makeAPIRequest } from "@/utils/request"
+import { makeAPIRequest } from '@/utils/request'
export default class TaxonWorks {
-
- static getTaxonNameCitations (otuId) {
- return makeAPIRequest.get(`/otus/${otuId}/inventory/nomenclature_citations`, { params: { extend: ['source'] } })
+ static getTaxonNameCitations(taxonId) {
+ return makeAPIRequest.get(`/taxon_names/${taxonId}/inventory/catalog`)
}
- static getOtu (id) {
- return makeAPIRequest.get(`/otus/${id}`, { params: { extend: ['parents'] } })
+ static getOtu(id) {
+ return makeAPIRequest.get(`/otus/${id}`, {
+ params: { extend: ['parents'] }
+ })
}
- static getTaxon (id) {
+ static getTaxon(id) {
return makeAPIRequest.get(`/taxon_names/${id}`)
}
- static summary (id) {
+ static summary(id) {
return makeAPIRequest.get(`/taxon_names/${id}/inventory/summary`)
}
- static getTaxonTypeDesignation (id) {
- return makeAPIRequest.get(`/taxon_names/${id}`, { params: { extend: ['type_taxon_name_relationship'] } })
+ static getTaxonTypeDesignation(id) {
+ return makeAPIRequest.get(`/taxon_names/${id}`, {
+ params: { extend: ['type_taxon_name_relationship'] }
+ })
}
- static getOtuImages (otuId, params = {}) {
- return makeAPIRequest.get(`/otus/${otuId}/inventory/images.json`, { params })
+ static getOtuImages(otuId, params = {}) {
+ return makeAPIRequest.get(`/otus/${otuId}/inventory/images.json`, {
+ params
+ })
}
- static getOtuDescendants (otuId, params) {
- return makeAPIRequest.get(`/otus/${otuId}/inventory/taxonomy.json`, { params })
+ static getOtuDescendants(otuId, params) {
+ return makeAPIRequest.get(`/otus/${otuId}/inventory/taxonomy.json`, {
+ params
+ })
}
- static getOtuTypeMaterial (otuId) {
+ static getOtuTypeMaterial(otuId) {
return makeAPIRequest.get(`/otus/${otuId}/inventory/type_material.json`)
}
- static getOtuDistribution (otuId) {
+ static getOtuDistribution(otuId) {
return makeAPIRequest.get(`/otus/${otuId}/inventory/distribution`)
}
- static getOtuContent (otuId) {
- return makeAPIRequest.get(`/otus/${otuId}/inventory/content`, { extend: ['depiction']})
+ static getOtuContent(otuId) {
+ return makeAPIRequest.get(`/otus/${otuId}/inventory/content`, {
+ extend: ['depiction']
+ })
}
-}
\ No newline at end of file
+}