sort database list #178

This commit is contained in:
Jan Prochazka 2021-10-05 21:57:12 +02:00
parent c93594d8ca
commit 17efc3d32c

View File

@ -1,5 +1,6 @@
<script lang="ts"> <script lang="ts">
import { filterName } from 'dbgate-tools'; import { filterName } from 'dbgate-tools';
import _ from 'lodash';
import { useDatabaseList } from '../utility/metadataLoaders'; import { useDatabaseList } from '../utility/metadataLoaders';
import AppObjectList from './AppObjectList.svelte'; import AppObjectList from './AppObjectList.svelte';
import * as databaseAppObject from './DatabaseAppObject.svelte'; import * as databaseAppObject from './DatabaseAppObject.svelte';
@ -11,6 +12,9 @@
</script> </script>
<AppObjectList <AppObjectList
list={($databases || []).filter(x => filterName(filter, x.name)).map(db => ({ ...db, connection: data }))} list={_.sortBy(
($databases || []).filter(x => filterName(filter, x.name)),
'name'
).map(db => ({ ...db, connection: data }))}
module={databaseAppObject} module={databaseAppObject}
/> />