Skip to content

Commit

Permalink
[BI-1336] programs table: fix species sort
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris T committed Feb 15, 2022
1 parent c54df71 commit 056858a
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/components/admin/AdminProgramsTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<b-table-column field="data.key" label="Program Key" sortable v-slot="props" :th-attrs="(column) => ({scope:'col'})">
{{ props.row.data.key }}
</b-table-column>
<b-table-column :custom-sort="sortSpecies" label="Species" v-slot="props" :th-attrs="(column) => ({scope:'col'})">
<b-table-column field="data.species" label="Species" sortable v-slot="props" :th-attrs="(column) => ({scope:'col'})">
<template v-if="speciesMap.size > 0">
{{ getSpeciesName(props.row.data.speciesId) }}
</template>
Expand Down Expand Up @@ -471,17 +471,6 @@ export default class AdminProgramsTable extends Vue {
emitProgramChange() {
EventBus.bus.$emit(EventBus.programChange);
}

sortSpecies(a: any, b: any, isAsc: boolean) {
if(isAsc) {
return this.getSpeciesName(a.data.speciesId)!.localeCompare(this.getSpeciesName(b.data.speciesId)!);
} else {
return this.getSpeciesName(b.data.speciesId)!.localeCompare(this.getSpeciesName(a.data.speciesId)!);
}
}



}

</script>

0 comments on commit 056858a

Please sign in to comment.