From 34dcbc6b840b6d8378ecafc6e60a78a2ba834316 Mon Sep 17 00:00:00 2001 From: HMS17 Date: Mon, 18 Aug 2025 20:18:54 -0400 Subject: [PATCH 1/2] [BI-2193] Improve/Correct Sub-Entity Tabular View --- src/breeding-insight/model/DatasetTableRow.ts | 13 ++++- src/views/import/Dataset.vue | 57 ++++++++++++++++++- 2 files changed, 65 insertions(+), 5 deletions(-) diff --git a/src/breeding-insight/model/DatasetTableRow.ts b/src/breeding-insight/model/DatasetTableRow.ts index 2d382bae2..d927f0bb6 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 52ff677f2..7e285aac6 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); //todo maybe put in brapiutils, also check if robust + 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 From a4fcf5d4c41c4fe8a8eadc469d2c665d436c6e6b Mon Sep 17 00:00:00 2001 From: HMS17 Date: Mon, 18 Aug 2025 20:20:05 -0400 Subject: [PATCH 2/2] [BI-2193] Improve/Correct Sub-Entity Tabular View --- src/views/import/Dataset.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/import/Dataset.vue b/src/views/import/Dataset.vue index 7e285aac6..373ffd982 100644 --- a/src/views/import/Dataset.vue +++ b/src/views/import/Dataset.vue @@ -492,7 +492,7 @@ export default class Dataset extends ProgramsBase { datasetTableRow.expUnitId = this.removeUnique(unit.observationUnitName); datasetTableRow.obsUnitId = BrAPIUtils.getBreedingInsightId(unit.externalReferences, "/observationunits"); } else { - let parentObsInfo = unit.observationUnitPosition.observationLevelRelationships.find((val) => val.levelOrder === 0); //todo maybe put in brapiutils, also check if robust + let parentObsInfo = unit.observationUnitPosition.observationLevelRelationships.find((val) => val.levelOrder === 0); if (parentObsInfo) datasetTableRow.obsUnitId = this.removeUnique(parentObsInfo.levelCode); datasetTableRow.expUnitId = unit.additionalInfo.expUnitID; datasetTableRow.subExpUnitId = this.removeUnique(unit.observationUnitName);