-
Notifications
You must be signed in to change notification settings - Fork 1
[BI-1375] - Make GIDs clickable links #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ace3a32
87bc219
c544c2c
8ac629d
75df9da
88da05c
cace7e5
3802cb2
a32e82f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <!-- | ||
| - See the NOTICE file distributed with this work for additional information | ||
| - regarding copyright ownership. | ||
| - | ||
| - Licensed under the Apache License, Version 2.0 (the "License"); | ||
| - you may not use this file except in compliance with the License. | ||
| - You may obtain a copy of the License at | ||
| - | ||
| - http://www.apache.org/licenses/LICENSE-2.0 | ||
| - | ||
| - Unless required by applicable law or agreed to in writing, software | ||
| - distributed under the License is distributed on an "AS IS" BASIS, | ||
| - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| - See the License for the specific language governing permissions and | ||
| - limitations under the License. | ||
| --> | ||
|
|
||
| <template> | ||
| <router-link v-if="this.germplasmUUID" v-bind:to="{name: 'germplasm-details', params: {programId: activeProgram.id, germplasmId: this.germplasmUUID}}"> | ||
| {{ this.germplasmGID }} | ||
| </router-link> | ||
| <div v-else> | ||
| {{ this.germplasmGID }} | ||
| </div> | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import {Component, Prop, Vue} from 'vue-property-decorator' | ||
| import { mapGetters } from 'vuex' | ||
| import {Program} from "@/breeding-insight/model/Program"; | ||
|
|
||
| @Component({ | ||
| computed: { | ||
| ...mapGetters([ | ||
| 'activeProgram' | ||
| ]) | ||
| } | ||
| }) | ||
| export default class GermplasmLink extends Vue { | ||
|
|
||
| private activeProgram?: Program; | ||
| @Prop() | ||
| private germplasmUUID!: String; | ||
| @Prop() | ||
| private germplasmGID!: String; | ||
|
|
||
| } | ||
|
|
||
| </script> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,7 +35,18 @@ | |
| <li><b>Breeding Method: </b> {{ germplasm.additionalInfo.breedingMethod }}</li> | ||
| <li><b>Source: </b> {{ germplasm.seedSource }}</li> | ||
| <li><b>Pedigree: </b> {{ germplasm.additionalInfo.pedigreeByName }}</li> | ||
| <li><b>Pedigree GID(s): </b> {{ germplasm.pedigree }}</li> | ||
| <li><b>Pedigree GID(s): </b> | ||
| <GermplasmLink | ||
| v-if="germplasm.pedigree" | ||
| v-bind:germplasmUUID="Pedigree.parsePedigreeString(germplasm.additionalInfo.pedigreeByUUID).femaleParent" | ||
| v-bind:germplasmGID="Pedigree.parsePedigreeString(germplasm.pedigree).femaleParent" | ||
| > </GermplasmLink> | ||
| <template v-if="Pedigree.parsePedigreeString(germplasm.pedigree).maleParent"> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the GermplasmLink above you have the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now I have the GermplasmLink as a one germplasm per link sort of thing rather than a more complicated component that includes multiple configurations of links. The v-if here is wrapped around the "/ " part of the pedigree since the slash and gid only show up if there is a male parent. I could add some sort of boolean to pass in but I would still need a boolean on the outside for the slash lest I make the Germplasm Link more complicated by adding the slash. So what I have now seems to be the simplest route?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah gotcha, I missed the |
||
| / <GermplasmLink | ||
| v-bind:germplasmUUID="Pedigree.parsePedigreeString(germplasm.additionalInfo.pedigreeByUUID).maleParent" | ||
| v-bind:germplasmGID="Pedigree.parsePedigreeString(germplasm.pedigree).maleParent" | ||
| > </GermplasmLink></template> | ||
| </li> | ||
| </ul> | ||
| </section> | ||
| </article> | ||
|
|
@@ -93,29 +104,35 @@ import {Program} from "@/breeding-insight/model/Program"; | |
| import GermplasmBase from "@/components/germplasm/GermplasmBase.vue"; | ||
| import {Germplasm} from "@/breeding-insight/brapi/model/germplasm"; | ||
| import {GermplasmService} from "@/breeding-insight/service/GermplasmService"; | ||
| import GermplasmLink from '@/components/germplasm/GermplasmLink.vue' | ||
| import {Pedigree} from "@/breeding-insight/model/import/germplasm/Pedigree"; | ||
| import {GermplasmUtils} from '@/breeding-insight/utils/GermplasmUtils'; | ||
| import { Result } from '@/breeding-insight/model/Result'; | ||
|
|
||
| @Component({ | ||
| components: {}, | ||
| components: {GermplasmLink}, | ||
| computed: { | ||
| ...mapGetters([ | ||
| 'activeProgram' | ||
| ]) | ||
| }, | ||
| data: () => ({GermplasmUtils}) | ||
| data: () => ({Pedigree, GermplasmUtils}) | ||
| }) | ||
| export default class GermplasmDetails extends GermplasmBase { | ||
|
|
||
| private activeProgram?: Program; | ||
| private germplasm?: Germplasm; | ||
| private germplasmLoading: boolean = true; | ||
| private germplasmUUID: string = this.$route.params.germplasmId; | ||
|
|
||
| mounted() { | ||
| this.getGermplasm(); | ||
| } | ||
|
|
||
| get germplasmUUID(): string { | ||
| return this.$route.params.germplasmId; | ||
| } | ||
|
|
||
| @Watch('$route') | ||
| async getGermplasm() { | ||
| this.germplasmLoading = true; | ||
| try { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering for this if it would be better to have the GID not be a link if UUID isn't provided, rather than not showing the GID at all?
I'm thinking that because from a user perspective it might be better to have a broken link rather than missing data in the case of a data error such as missing UUID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, changed to be text in the case of no UUID