fix(frontend):fix first draft save (#7552)

* Fix first draft save

* fix draft low code app save
This commit is contained in:
Guilhem
2026-01-13 20:24:59 +00:00
committed by GitHub
parent 8d005b030f
commit 28e25ec60d
3 changed files with 25 additions and 6 deletions
@@ -743,13 +743,20 @@
startIcon={{ icon: Save }}
disabled={pathError != ''}
on:click={() => saveInitialDraft()}
unifiedSize="md"
variant="accent"
>
Save initial draft
</Button>
</div>
{/snippet}
<AppEditorHeaderDeployInitialDraft {summary} {appPath} bind:pathError bind:newEditedPath />
<AppEditorHeaderDeployInitialDraft
bind:summary={$summary}
bind:appPath={$appPath}
bind:pathError
bind:newEditedPath
/>
</DrawerContent>
</Drawer>
{/if}
@@ -2,7 +2,12 @@
import { Alert } from '$lib/components/common'
import Path from '$lib/components/Path.svelte'
let { summary, appPath, pathError = $bindable(), newEditedPath = $bindable() } = $props()
let {
summary = $bindable(),
appPath = $bindable(),
pathError = $bindable(),
newEditedPath = $bindable()
} = $props()
let path: Path | undefined = $state(undefined)
let dirtyPath = $state(false)
@@ -22,11 +27,11 @@
onkeydown={(e) => {
e.stopPropagation()
}}
bind:value={$summary}
bind:value={summary}
onkeyup={() => {
if ($appPath == '' && $summary?.length > 0 && !dirtyPath) {
if (appPath == '' && summary?.length > 0 && !dirtyPath) {
path?.setName(
$summary
summary
.toLowerCase()
.replace(/[^a-z0-9_]/g, '_')
.replace(/-+/g, '_')
@@ -620,12 +620,19 @@
startIcon={{ icon: Save }}
disabled={pathError != '' || app == undefined}
on:click={() => saveInitialDraft()}
unifiedSize="md"
variant="accent"
>
Save initial draft
</Button>
</div>
{/snippet}
<AppEditorHeaderDeployInitialDraft {summary} {appPath} bind:pathError bind:newEditedPath />
<AppEditorHeaderDeployInitialDraft
bind:summary
bind:appPath
bind:pathError
bind:newEditedPath
/>
</DrawerContent>
</Drawer>
{/if}