From 97ea859315fb040e5834abb6d42ac81cf3eb84b1 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sun, 4 Apr 2021 13:19:52 +0200 Subject: [PATCH] web/admin: default FlowStageBinding's order to 0 Signed-off-by: Jens Langhammer --- web/src/pages/flows/FlowForm.ts | 2 +- web/src/pages/flows/StageBindingForm.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/pages/flows/FlowForm.ts b/web/src/pages/flows/FlowForm.ts index c1ef47a06..ef60875cf 100644 --- a/web/src/pages/flows/FlowForm.ts +++ b/web/src/pages/flows/FlowForm.ts @@ -87,7 +87,7 @@ export class FlowForm extends Form {

${t`Shown as the Title in Flow pages.`}

diff --git a/web/src/pages/flows/StageBindingForm.ts b/web/src/pages/flows/StageBindingForm.ts index d4359396b..34ad489a2 100644 --- a/web/src/pages/flows/StageBindingForm.ts +++ b/web/src/pages/flows/StageBindingForm.ts @@ -41,6 +41,7 @@ export class StageBindingForm extends Form { groupStages(stages: Stage[]): TemplateResult { return html` + ${groupBy(stages, (s => s.verboseName || "")).map(([group, stages]) => { return html` ${stages.map(stage => { @@ -60,6 +61,9 @@ export class StageBindingForm extends Form { target: this.targetPk || "", }).then(bindings => { const orders = bindings.results.map(binding => binding.order); + if (orders.length < 1) { + return 0; + } return Math.max(...orders) + 1; }); }