mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
misc: fix subNav not updating;
fix: proper table suggestion state when creating a new table from inside the sheet view.
This commit is contained in:
1 parent
8a1c2fba1d
commit
f8505b5380
3 files changed
+25
-17
No files matched your search
+17
-11
@@ -19,6 +19,7 @@
|
||||
} = $props();
|
||||
|
||||
const databaseId = page.params.database;
|
||||
const isOnTablesPage = $derived(page.route?.id.endsWith('table-[table]'));
|
||||
|
||||
let name = $state('');
|
||||
let id: string = $state(null);
|
||||
@@ -27,10 +28,17 @@
|
||||
|
||||
let creatingTable = $state(false);
|
||||
|
||||
function enableThinkingModeForSuggestions() {
|
||||
function enableThinkingModeForSuggestions(table: Models.Table) {
|
||||
if ($tableColumnSuggestions.enabled) {
|
||||
// if enabled, trigger thinking mode!
|
||||
$tableColumnSuggestions.thinking = true;
|
||||
tableColumnSuggestions.update((store) => ({
|
||||
...store,
|
||||
thinking: true,
|
||||
table: {
|
||||
id: table.$id,
|
||||
name: table.name
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,14 +53,6 @@
|
||||
name
|
||||
});
|
||||
|
||||
tableColumnSuggestions.update((store) => ({
|
||||
...store,
|
||||
table: {
|
||||
id: table.$id,
|
||||
name: table.name
|
||||
}
|
||||
}));
|
||||
|
||||
updateAndCleanup();
|
||||
|
||||
await onTableCreated(table);
|
||||
@@ -62,7 +62,7 @@
|
||||
creatingTable = false;
|
||||
|
||||
// don't wait for UI to mount!
|
||||
enableThinkingModeForSuggestions();
|
||||
enableThinkingModeForSuggestions(table);
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.TableCreate);
|
||||
@@ -103,6 +103,12 @@
|
||||
touchedId = false;
|
||||
}
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (showCreate && isOnTablesPage && $tableColumnSuggestions.table) {
|
||||
$tableColumnSuggestions.table = null;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<Modal title="Create table" size="m" bind:show={showCreate} onSubmit={createTable} bind:error>
|
||||
|
||||
+5
-5
@@ -29,12 +29,12 @@
|
||||
import { onMount } from 'svelte';
|
||||
import { subNavigation } from '$lib/stores/database';
|
||||
|
||||
let data = $derived(page.data) as PageData;
|
||||
const data = $derived(page.data) as PageData;
|
||||
|
||||
let region = $derived(page.params.region);
|
||||
let project = $derived(page.params.project);
|
||||
let tableId = $derived(page.params.table);
|
||||
let databaseId = $derived(page.params.database);
|
||||
const region = $derived(page.params.region);
|
||||
const project = $derived(page.params.project);
|
||||
const tableId = $derived(page.params.table);
|
||||
const databaseId = $derived(page.params.database);
|
||||
|
||||
let openBottomSheet = $state(false);
|
||||
|
||||
|
||||
+3
-1
@@ -14,6 +14,7 @@
|
||||
import type { PageData } from './$types';
|
||||
import { tableViewColumns } from './store';
|
||||
import Confirm from '$lib/components/confirm.svelte';
|
||||
import { subNavigation } from '$lib/stores/database';
|
||||
|
||||
export let data: PageData;
|
||||
const databaseId = page.params.database;
|
||||
@@ -38,7 +39,8 @@
|
||||
type: 'success',
|
||||
message: `${selectedTables.length} table${selectedTables.length > 1 ? 's' : ''} deleted`
|
||||
});
|
||||
invalidate(Dependencies.TABLES);
|
||||
await invalidate(Dependencies.TABLES);
|
||||
subNavigation.update();
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
|
||||
Reference in new issue
Block a user