Skip to content

Commit eb5a0d4

Browse files
iykekingshasura-bot
authored andcommitted
console: sort untracked tables list
Sorts untracked tables/views list by name. Resolves hasura#967 #### Before <img width="852" alt="Screenshot 2021-03-29 at 11 15 49" src="https://user-images.githubusercontent.com/22247592/112825665-f32f2200-9083-11eb-85c5-522d86cf9b29.png"> #### After <img width="851" alt="Screenshot 2021-03-29 at 11 31 24" src="https://user-images.githubusercontent.com/22247592/112825709-ffb37a80-9083-11eb-9552-a72314556d6c.png"> GitOrigin-RevId: 8fd00c4
1 parent bc4551d commit eb5a0d4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

console/src/dataSources/common.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Nullable } from '../components/Common/utils/tsUtils';
2-
import { Table, Relationship, CheckConstraint, BaseTable } from './types';
31
import { isEqual } from '../components/Common/utils/jsUtils';
2+
import { Nullable } from '../components/Common/utils/tsUtils';
43
import { QualifiedTable } from '../metadata/types';
54
import { FixMe } from '../types';
5+
import { BaseTable, CheckConstraint, Relationship, Table } from './types';
66

77
export type Operations = 'insert' | 'select' | 'update' | 'delete';
88
export const QUERY_TYPES: Operations[] = [
@@ -61,7 +61,9 @@ export const getTrackedTables = (tables: Table[]) => {
6161
};
6262

6363
export const getUntrackedTables = (tables: Table[]) => {
64-
return tables.filter(t => !t.is_table_tracked);
64+
return tables
65+
.filter(t => !t.is_table_tracked)
66+
.sort((a, b) => (a.table_name > b.table_name ? 1 : -1));
6567
};
6668

6769
export const getTableColumnNames = (table: Table) => {

0 commit comments

Comments
 (0)