Skip to content

Commit

Permalink
[BI-1717] The 'Experiment Details' vue now has the trialDbId and pass…
Browse files Browse the repository at this point in the history
…es it to the Download functionality
  • Loading branch information
davedrp committed Jun 2, 2023
1 parent 0e3cdc0 commit a764186
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/components/experiments/ExperimentsObservationsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@
v-on:search="initSearch"
>
<b-table-column label="Title" field="name" cell-class="fixed-width-wrapped" sortable v-slot="props" :th-attrs="(column) => ({scope:'col'})" searchable>
<router-link v-bind:to="{name: 'experiment-details', params: {programId: activeProgram.id, experimentId: BrAPIUtils.getBreedingInsightId(props.row.data.externalReferences,'/trials')}}">
<router-link v-bind:to="{
name: 'experiment-details',
params:
{
programId: activeProgram.id,
experimentId: BrAPIUtils.getBreedingInsightId(props.row.data.externalReferences,'/trials'),
trialDbId: props.row.data.trialDbId
}
}">
{{ props.row.data.trialName }}
</router-link>

Expand Down
2 changes: 1 addition & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ const routes = [
]
},
{
path: '/programs/:programId/experiment/:experimentId',
path: '/programs/:programId/experiment/:experimentId/trialDbId/:trialDbId',
name: 'experiment-details',
meta: {
title: 'Experiment Detail',
Expand Down
7 changes: 5 additions & 2 deletions src/views/experiments-and-observations/ExperimentDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<ExperimentObservationsDownloadButton
v-bind:modal-title="`Download ${experiment.trialName}`"
v-bind:trial-db-id="experimentUUID"
v-bind:trial-db-id="trialDbId"
v-on:show-error-notification ="$emit('show-error-notification', $event)"
anchor-class="button is-primary is-outlined"
>
Expand Down Expand Up @@ -108,11 +108,14 @@ export default class ExperimentDetails extends TrialsAndStudiesBase {
this.getExperiment();
}


get experimentUUID(): string {
return this.$route.params.experimentId;
}

get trialDbId(): string {
return this.$route.params.trialDbId;
}

get userName(): string {
if( !this.experiment.additionalInfo ){return '';}
if( !this.experiment.additionalInfo.createdBy){return '';}
Expand Down

0 comments on commit a764186

Please sign in to comment.