mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: random data gen issues.
This commit is contained in:
+21
-19
@@ -194,23 +194,25 @@
|
||||
|
||||
<CreateEntity bind:show={$showCreateEntity} onCreateEntity={createEntity} />
|
||||
|
||||
<Modal title="Generate sample data" bind:show={$randomDataModalState.show}>
|
||||
<Layout.Stack style="gap: 28px;">
|
||||
{#if $randomDataModalState.columns}
|
||||
<SuggestionsInput required context="data" showSampleCountPicker={!terminology.schema} />
|
||||
{:else}
|
||||
<Seekbar max={100} breakpointCount={5} bind:value={$randomDataModalState.value} />
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<Layout.Stack direction="row" gap="s" justifyContent="flex-end">
|
||||
<Button text on:click={() => resetSampleFieldsConfig()}>Cancel</Button>
|
||||
<Button
|
||||
on:click={() => {
|
||||
$randomDataModalState.onSubmit?.();
|
||||
$randomDataModalState.show = false;
|
||||
}}>Create</Button>
|
||||
{#if !$randomDataModalState.managed}
|
||||
<Modal title="Generate sample data" bind:show={$randomDataModalState.show}>
|
||||
<Layout.Stack style="gap: 28px;">
|
||||
{#if $randomDataModalState.columns}
|
||||
<SuggestionsInput required context="data" showSampleCountPicker={!terminology.schema} />
|
||||
{:else}
|
||||
<Seekbar max={100} breakpointCount={5} bind:value={$randomDataModalState.value} />
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
</svelte:fragment>
|
||||
</Modal>
|
||||
|
||||
<svelte:fragment slot="footer">
|
||||
<Layout.Stack direction="row" gap="s" justifyContent="flex-end">
|
||||
<Button text on:click={() => resetSampleFieldsConfig()}>Cancel</Button>
|
||||
<Button
|
||||
on:click={() => {
|
||||
$randomDataModalState.onSubmit?.();
|
||||
$randomDataModalState.show = false;
|
||||
}}>Create</Button>
|
||||
</Layout.Stack>
|
||||
</svelte:fragment>
|
||||
</Modal>
|
||||
{/if}
|
||||
+2
@@ -251,6 +251,8 @@
|
||||
subtitle="Generate data for testing"
|
||||
onClick={() => {
|
||||
$randomDataModalState.show = true;
|
||||
$randomDataModalState.columns = true;
|
||||
$randomDataModalState.managed = false;
|
||||
}} />
|
||||
|
||||
<EmptySheetCards
|
||||
|
||||
+1
@@ -836,6 +836,7 @@
|
||||
on:click={() => {
|
||||
$randomDataModalState.show = true;
|
||||
$randomDataModalState.columns = true;
|
||||
$randomDataModalState.managed = false;
|
||||
}}>Generate sample data</Button.Button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
+3
-1
@@ -55,6 +55,7 @@ export type RandomDataSchema = {
|
||||
show: boolean;
|
||||
value: number;
|
||||
columns?: boolean;
|
||||
managed: boolean,
|
||||
onSubmit?: () => Promise<void> | void;
|
||||
};
|
||||
|
||||
@@ -100,7 +101,8 @@ export const databaseSubNavigationItems = [
|
||||
|
||||
export const randomDataModalState = writable<RandomDataSchema>({
|
||||
show: false,
|
||||
value: 25 // initial value!
|
||||
value: 25, // initial value!
|
||||
managed: true, // true means don't use the one in database/+layout.svelte
|
||||
});
|
||||
|
||||
export const spreadsheetLoading = writable(false);
|
||||
|
||||
+2
@@ -341,6 +341,7 @@
|
||||
subtitle="Generate data for testing"
|
||||
onClick={() => {
|
||||
$randomDataModalState.show = true;
|
||||
$randomDataModalState.managed = true;
|
||||
}} />
|
||||
{/snippet}
|
||||
</EmptySheet>
|
||||
@@ -392,6 +393,7 @@
|
||||
subtitle="Generate data for testing"
|
||||
onClick={() => {
|
||||
$randomDataModalState.show = true;
|
||||
$randomDataModalState.managed = true;
|
||||
}} />
|
||||
|
||||
{#if isCloud}
|
||||
|
||||
+1
@@ -1244,6 +1244,7 @@
|
||||
variant="secondary"
|
||||
on:click={() => {
|
||||
$randomDataModalState.show = true;
|
||||
$randomDataModalState.managed = true;
|
||||
}}>Generate sample data</Button.Button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user