Skip to content

Commit

Permalink
Merge pull request #15110 from Budibase/sort-table-names
Browse files Browse the repository at this point in the history
sort table names alphabetically when selecting data source
  • Loading branch information
andz-bb authored Dec 4, 2024
2 parents 8d897ca + a1dd7c5 commit 3d88d2e
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,16 @@
let modal
$: text = value?.label ?? "Choose an option"
$: tables = $tablesStore.list.map(table =>
format.table(table, $datasources.list)
)
$: tables = $tablesStore.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 => ({
...view,
label: view.name,
Expand Down

0 comments on commit 3d88d2e

Please sign in to comment.