Skip to content

Commit

Permalink
feat(tree): Add SeqCode links.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmussig committed Nov 18, 2022
1 parent 680c215 commit e1035cd
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assets/api/taxon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export interface TaxonDescendants {
isRep?: boolean,
typeMaterial?: string,
nDescChildren?: number,
bergeysUrl?: string
bergeysUrl?: string,
seqcodeUrl?: string
}

export interface TaxonSearchResponse {
Expand Down
36 changes: 35 additions & 1 deletion pages/tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@
</template>
</v-checkbox>
</v-row>
<v-row no-gutters>
<v-checkbox
v-model="showSeqcodeUrl"
class="font-12px"
color="#4b0082"
dense
hide-details
label="SeqCode"
>
</v-checkbox>
</v-row>
</div>

</div>
Expand Down Expand Up @@ -205,6 +216,17 @@
</a>
</template>

<!-- SeqCode URL -->
<template v-if="showSeqcodeUrl && item.seqcodeUrl">
<a :href="item.seqcodeUrl" target="_blank">
<span class="rounded-circle pa-1" style="background-color: #4b0082">
<v-icon small dark>
{{ mdiLinkVariantSvg }}
</v-icon>
</span>
</a>
</template>

</div>
</template>
</div>
Expand Down Expand Up @@ -301,6 +323,17 @@
</template>
</v-checkbox>
</v-row>
<v-row no-gutters>
<v-checkbox
v-model="showSeqcodeUrl"
class="font-12px"
color="#4b0082"
dense
hide-details
label="SeqCode"
>
</v-checkbox>
</v-row>
</div>

<!-- Taxonomy table for the selected taxon -->
Expand Down Expand Up @@ -391,7 +424,8 @@ export default Vue.extend({
// Allow the user to select the following tree annotations
showDescChildren: false,
showDescGenomes: true,
showBergeysUrl: false
showBergeysUrl: false,
showSeqcodeUrl: false,
}),
watch: {
// If the user searches for a taxon, manipulate the tree
Expand Down
2 changes: 2 additions & 0 deletions store/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface TreeItem {
total?: number
nDescChildren?: number,
bergeysUrl?: string,
seqcodeUrl?: string,
children?: TreeItem[],

isGenome?: boolean,
Expand Down Expand Up @@ -112,6 +113,7 @@ function treeItemFromTaxonDescendants(item: TaxonDescendants): TreeItem {
out.total = item.total
out.nDescChildren = item.nDescChildren
out.bergeysUrl = item.bergeysUrl
out.seqcodeUrl = item.seqcodeUrl
out.children = []
}
return out
Expand Down

0 comments on commit e1035cd

Please sign in to comment.