Cherry Pick of recent changes in qms (#8498)

Signed-off-by: Victor Ilyushchenko <alt13ri@gmail.com>
This commit is contained in:
Victor Ilyushchenko
2025-04-09 16:14:38 +04:00
committed by GitHub
parent 3d7bedd204
commit 280a0819a2
38 changed files with 428 additions and 202 deletions
@@ -137,11 +137,16 @@
$: space = $locationStep.space
let submitted = false
async function handleSubmit (): Promise<void> {
if ($locationStep.space === undefined || $locationStep.project === undefined) {
return
}
if (submitted) return
submitted = true
const newDocId = generateId<ControlledDocument>()
const _space = $locationStep.space
@@ -198,6 +203,7 @@
loading={isLoading}
label={documents.string.NewDocument}
submitLabel={documents.string.CreateDraft}
canSubmit={!submitted}
{canProceed}
{steps}
selectedStep={$currentStep}
@@ -130,11 +130,16 @@
currentStepUpdated(e.detail)
}
let submitted = false
async function handleSubmit (): Promise<void> {
if ($locationStep.space === undefined || $locationStep.project === undefined) {
return
}
if (submitted) return
submitted = true
const { category } = docObject
if (category === undefined || category === null) return
@@ -206,6 +211,7 @@
submitLabel={documents.string.CreateDraft}
{canProceed}
{steps}
canSubmit={!submitted}
selectedStep={currentTemplateStep}
on:stepChanged={handleStepChanged}
on:submit={handleSubmit}