diff --git a/src/breeding-insight/model/DatasetTableRow.ts b/src/breeding-insight/model/DatasetTableRow.ts
index 2d382bae..d927f0bb 100644
--- a/src/breeding-insight/model/DatasetTableRow.ts
+++ b/src/breeding-insight/model/DatasetTableRow.ts
@@ -34,6 +34,8 @@ export class DatasetTableRow {
obsUnitId?: string;
traitValues?: string[] = [];
treatmentFactors?: string;
+ subExpUnitId?: string;
+ subObsUnitId?: string;
constructor(germplasmName?: string,
gid?: string,
@@ -51,7 +53,9 @@ export class DatasetTableRow {
elevation?: number,
rtk?: string,
obsUnitId?: string,
- traitValues?: string[]) {
+ traitValues?: string[],
+ subExpUnitId?: string,
+ subObsUnitId?: string) {
this.germplasmName = germplasmName;
this.gid = gid;
this.testOrCheck = testOrCheck;
@@ -69,7 +73,8 @@ export class DatasetTableRow {
this.rtk = rtk;
this.obsUnitId = obsUnitId;
this.traitValues = traitValues;
-
+ this.subExpUnitId = subExpUnitId;
+ this.subObsUnitId = subObsUnitId;
}
static assign(dataset: DatasetTableRow): DatasetTableRow {
@@ -91,7 +96,9 @@ export class DatasetTableRow {
dataset.elevation,
dataset.rtk,
dataset.obsUnitId,
- dataset.traitValues
+ dataset.traitValues,
+ dataset.subExpUnitId,
+ dataset.subObsUnitId
);
}
diff --git a/src/views/import/Dataset.vue b/src/views/import/Dataset.vue
index 52ff677f..373ffd98 100644
--- a/src/views/import/Dataset.vue
+++ b/src/views/import/Dataset.vue
@@ -56,6 +56,7 @@
v-bind:pagination="paginationController"
v-bind:debounce-search="400"
v-on:show-error-notification="$emit('show-error-notification', $event)"
+ v-bind:default-sort="['data.envLocation', 'desc']"
>
{{ props.row.data.expUnitId }}
+
+ {{ props.row.data.subExpUnitId }}
+
+
+ {{ props.row.data.subObsUnitId }}
+
+
val.levelOrder === 0);
+ if (parentObsInfo) datasetTableRow.obsUnitId = this.removeUnique(parentObsInfo.levelCode);
+ datasetTableRow.expUnitId = unit.additionalInfo.expUnitID;
+ datasetTableRow.subExpUnitId = this.removeUnique(unit.observationUnitName);
+ datasetTableRow.subObsUnitId = BrAPIUtils.getBreedingInsightId(unit.externalReferences, "/observationunits");
+ }
// Env Year
datasetTableRow.envYear = "";
@@ -568,6 +616,7 @@ export default class Dataset extends ProgramsBase {
setObsUnitIDLabel(){
this.obsUnitIDLabel = this.observationUnit + " ObsUnitID"
+ if (this.isSubEntity) this.subObsUnitIDLabel = this.subObservationUnit + " ObsUnitID"
}
@Watch('$route')
@@ -592,6 +641,9 @@ export default class Dataset extends ProgramsBase {
if (response.isErr()) throw response.value;
this.datasetModel = response.value;
+ // Use this.datasetModel to determine if this table is for a top level or sub entity dataset
+ if (this.datasetModel.observationUnits[0].observationUnitPosition.observationLevelRelationships.length > 2) this.isSubEntity = true;
+
// Use this.datasetModel to initialize this.unitDbIdToTraitValues
this.unitDbIdToTraitValues = this.createUnitDbIdToTraitValues();
@@ -600,6 +652,7 @@ export default class Dataset extends ProgramsBase {
this.createDatasetTableRows();
// Set the obsUnitId label to include observation level
+ if (this.isSubEntity) this.subObservationUnit = this.datasetModel.observationUnits[0].additionalInfo.observationLevel;
this.setObsUnitIDLabel();
//Initialize the paginationController