Skip to content

Commit

Permalink
fix: disabled sort for fields without a name property
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Feb 18, 2021
1 parent 7c4ca99 commit 3b37b74
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/renderer/components/WorkspaceQueryTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
/>
<span>{{ field.alias || field.name }}</span>
<i
v-if="currentSort === field.name || currentSort === `${field.table}.${field.name}`"
v-if="idSortable && currentSort === field.name || currentSort === `${field.table}.${field.name}`"
class="mdi sort-icon"
:class="currentSortDir === 'asc' ? 'mdi-sort-ascending':'mdi-sort-descending'"
/>
Expand Down Expand Up @@ -124,6 +124,9 @@ export default {
primaryField () {
return this.fields.filter(field => ['pri', 'uni'].includes(field.key))[0] || false;
},
idSortable () {
return this.fields.every(field => field.name);
},
isHardSort () {
return this.mode === 'table' && this.localResults.length === 1000;
},
Expand Down Expand Up @@ -328,6 +331,8 @@ export default {
this.isContext = true;
},
sort (field) {
if (!this.idSortable) return;
if (this.mode === 'query')
field = `${this.getTable(this.resultsetIndex)}.${field}`;
Expand Down

0 comments on commit 3b37b74

Please sign in to comment.