Skip to content
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

[BI-1923] Treatment factor missing from experimental ui #332

Merged
merged 8 commits into from
Oct 3, 2023
2 changes: 1 addition & 1 deletion src/breeding-insight/model/DatasetTableRow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class DatasetTableRow {
column?: string;
obsUnitId?: string;
traitValues?: string[] = [];

treatmentFactors?: string;

constructor(germplasmName?: string,
gid?: string,
Expand Down
20 changes: 20 additions & 0 deletions src/views/import/Dataset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,19 @@
>
{{ props.row.data.column }}
</b-table-column>

<b-table-column
v-slot="props"
field="data.treatmentFactors"
label="Treatment Factors"
sortable
searchable
:th-attrs="() => ({scope:'col'})"
>
{{ props.row.data.treatmentFactors }}
</b-table-column>


<b-table-column
v-slot="props"
field="data.obsUnitId"
Expand All @@ -170,6 +183,7 @@
>
{{ props.row.data.obsUnitId }}
</b-table-column>

<b-table-column
v-for="( observationVariable, index ) in this.datasetModel.observationVariables" :key="observationVariable.observationVariableName"
v-slot="props"
Expand Down Expand Up @@ -392,6 +406,12 @@ export default class Dataset extends ProgramsBase {
}
}

// Treatment Factors
datasetTableRow.treatmentFactors = "";
if(unit.additionalInfo && unit.additionalInfo.treatments && unit.additionalInfo.treatments && unit.additionalInfo.treatments[0]){
datasetTableRow.treatmentFactors = unit.additionalInfo.treatments[0].factor;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While treatment factors are stored for persistence to the brapi storage server, they are translated back to being in unit.treatments in ObservationUnitDAO.java. This code should reference that location in the ObservationUnit object rather than in additionalInfo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!


datasetTableRow.traitValues = this.unitDbId_to_traitValues[unit.observationUnitDbId];
this.datasetTableRows.push(datasetTableRow);
}
Expand Down