Skip to content

Commit

Permalink
Merge pull request #193 from Breeding-Insight/bug/BI-1372
Browse files Browse the repository at this point in the history
[BI-1372] Add ontology sort option for entity + attribute
  • Loading branch information
Chris Tucker authored Mar 8, 2022
2 parents c356ad3 + b07bb7a commit 0e79286
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/breeding-insight/model/Sort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export enum OntologySortField {
MethodDescription = 'methodDescription',
ScaleClass = 'scaleClass',
ScaleName = 'scaleName',
TraitDescription = 'traitDescription'
entityAttributeSortLabel = 'entityAttribute'
}

export class OntologySort {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ontology/OntologyTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
v-bind:label="'Trait'"
v-bind:visible="!traitSidePanelState.collapseColumns"
v-bind:sortField="ontologySort.field"
v-bind:sortFieldLabel="traitDescriptionSortLabel"
v-bind:sortFieldLabel="entityAttributeSortLabel"
v-bind:sortable="true"
v-bind:sortOrder="ontologySort.order"
v-on:newSortColumn="$emit('newSortColumn', $event)"
Expand Down Expand Up @@ -323,7 +323,7 @@ export default class OntologyTable extends Vue {
private methodSortLabel: string = OntologySortField.MethodDescription;
private scaleClassSortLabel: string = OntologySortField.ScaleClass;
private unitSortLabel: string = OntologySortField.ScaleName;
private traitDescriptionSortLabel: string = OntologySortField.TraitDescription;
private entityAttributeSortLabel: string = OntologySortField.entityAttributeSortLabel;

// New trait form
private newTraitActive: boolean = false;
Expand Down
13 changes: 12 additions & 1 deletion src/components/trait/TraitsImportTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,17 @@
</AlertTriangleIcon>
{{ data.observationVariableName }}
</TableColumn>
<TableColumn name="trait" v-bind:label="'Trait'" v-bind:visible="!collapseColumns">
<TableColumn
name="trait"
v-bind:label="'Trait'"
v-bind:visible="!collapseColumns"
v-bind:sortField="importPreviewOntologySort.field"
v-bind:sortFieldLabel="entityAttributeSortLabel"
v-bind:sortable="true"
v-bind:sortOrder="importPreviewOntologySort.order"
v-on:newSortColumn="newSortColumn"
v-on:toggleSortOrder="toggleSortOrder"
>
{{ data.entity | capitalize }} {{ data.attribute | capitalize }}
</TableColumn>
<TableColumn
Expand Down Expand Up @@ -203,6 +213,7 @@ export default class TraitsImportTable extends Vue {
private methodSortLabel: string = OntologySortField.MethodDescription;
private scaleClassSortLabel: string = OntologySortField.ScaleClass;
private unitSortLabel: string = OntologySortField.ScaleName;
private entityAttributeSortLabel: string = OntologySortField.entityAttributeSortLabel;

mounted() {
this.updatePagination();
Expand Down

0 comments on commit 0e79286

Please sign in to comment.