sort table names alphabetically when selecting data source
This commit is contained in:
parent
07b5dc6e57
commit
582d05651d
|
@ -52,9 +52,16 @@
|
||||||
let modal
|
let modal
|
||||||
|
|
||||||
$: text = value?.label ?? "Choose an option"
|
$: text = value?.label ?? "Choose an option"
|
||||||
$: tables = $tablesStore.list.map(table =>
|
$: tables = $tablesStore.list
|
||||||
format.table(table, $datasources.list)
|
.map(table => format.table(table, $datasources.list))
|
||||||
)
|
.sort((a, b) => {
|
||||||
|
// sort tables alphabetically, grouped by datasource
|
||||||
|
const dsComparison = a.datasourceName.localeCompare(b.datasourceName)
|
||||||
|
if (dsComparison !== 0) {
|
||||||
|
return dsComparison
|
||||||
|
}
|
||||||
|
return a.label.localeCompare(b.label)
|
||||||
|
})
|
||||||
$: viewsV1 = $viewsStore.list.map(view => ({
|
$: viewsV1 = $viewsStore.list.map(view => ({
|
||||||
...view,
|
...view,
|
||||||
label: view.name,
|
label: view.name,
|
||||||
|
|
Loading…
Reference in New Issue