error handler improved, fixes

This commit is contained in:
Jan Prochazka
2021-03-27 10:07:36 +01:00
parent 218478c128
commit 833610c88b
5 changed files with 65 additions and 38 deletions

View File

@@ -1,4 +1,6 @@
<script lang="ts">
import _ from 'lodash';
import { getFormContext } from '../forms/FormProviderCore.svelte';
import FormSelectField from '../forms/FormSelectField.svelte';
import { useDatabaseList } from '../utility/metadataLoaders';
@@ -8,10 +10,13 @@
const { values } = getFormContext();
$: databases = useDatabaseList({ conid: $values[conidName] });
$: databaseOptions = ($databases || []).map(db => ({
value: db.name,
label: db.name,
}));
$: databaseOptions = _.sortBy(
($databases || []).map(db => ({
value: db.name,
label: db.name,
})),
'label'
);
</script>
<FormSelectField {...$$restProps} options={databaseOptions} />