-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
jlpereira
committed
Mar 10, 2023
1 parent
f8b0e35
commit 43c78c6
Showing
6 changed files
with
104 additions
and
134 deletions.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 14 additions & 60 deletions
74
src/modules/otus/components/Panel/PanelCitation/PanelCitationRow.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,23 @@ | ||
| <template> | ||
| <div | ||
| class=" | ||
| flex | ||
| justify-start | ||
| border-b | ||
| border-base-muted | ||
| p-3 | ||
| px-4 | ||
| " | ||
| > | ||
| <div | ||
| class="h-5 w-5 text-secondary-color opacity-60 mr-2 cursor-pointer" | ||
| @click="isExpanded = !isExpanded" | ||
| > | ||
| <IconArrowRight | ||
| v-if="!isExpanded" | ||
| class="h-5 w-5" | ||
| /> | ||
| <IconArrowDown | ||
| v-else | ||
| class="h-5 w-5" | ||
| /> | ||
| </div> | ||
|
|
||
| <div class="break-all"> | ||
| <span | ||
| :title="citation.source.name" | ||
| v-html="sourceLabel" | ||
| /> | ||
| <span> — </span> | ||
| <span | ||
| class=" text-base-lighter" | ||
| v-html="taxonNames" | ||
| /> | ||
| </div> | ||
| </div> | ||
| <li class="border-b border-base-muted p-3 px-5"> | ||
| <span | ||
| class="break-all block" | ||
| :title="citation.label" | ||
| v-html="citation.label" | ||
| /> | ||
| <span | ||
| v-if="citation.type_label" | ||
| class="ml-4 text-base-soft" | ||
| v-html="citation.type_label" | ||
| /> | ||
| </li> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { ref, computed } from 'vue' | ||
| const props = defineProps({ | ||
| defineProps({ | ||
| citation: { | ||
| type: Object, | ||
| required: true | ||
| } | ||
| }) | ||
| const isExpanded = ref(false) | ||
| const sourceLabel = computed(() => { | ||
| const { source } = props.citation | ||
| return isExpanded.value | ||
| ? source.name | ||
| : source.short_name | ||
| }) | ||
| const taxonNames = computed(() => props.citation.names.join(', ')) | ||
| const setExpanded = value => { | ||
| isExpanded.value = value | ||
| } | ||
| defineExpose({ | ||
| setExpanded | ||
| }) | ||
| </script> | ||
| </script> |
18 changes: 18 additions & 0 deletions
18
src/modules/otus/components/Panel/PanelCitation/PanelReferenceRow.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <template> | ||
| <li class="border-b border-base-muted p-3 px-5"> | ||
| <span | ||
| class="break-all block" | ||
| :title="source" | ||
| v-html="source" | ||
| /> | ||
| </li> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| defineProps({ | ||
| source: { | ||
| type: String, | ||
| required: true | ||
| } | ||
| }) | ||
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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'] | ||
| }) | ||
| } | ||
| } | ||
| } |