From 6237352e25fa1a0fa00a4a5caefa7d3defed16c4 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 27 Aug 2021 23:09:53 +0200 Subject: [PATCH] web/flows: fix checkboxes not being rendered correctly Signed-off-by: Jens Langhammer --- web/src/flows/stages/prompt/PromptStage.ts | 23 +++++++++++++++------- web/src/pages/stages/prompt/PromptForm.ts | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/web/src/flows/stages/prompt/PromptStage.ts b/web/src/flows/stages/prompt/PromptStage.ts index 70ca53b79..72a1e0aa6 100644 --- a/web/src/flows/stages/prompt/PromptStage.ts +++ b/web/src/flows/stages/prompt/PromptStage.ts @@ -64,13 +64,6 @@ export class PromptStage extends BaseStage`; - case "checkbox": - return ``; case "date": return ` ${this.challenge.fields.map((prompt) => { + // Checkbox is rendered differently + if (prompt.type === "checkbox") { + return html`
+ + + ${prompt.required + ? html`

${t`Required.`}

` + : html``} +
`; + } // Special types that aren't rendered in a wrapper if ( prompt.type === "static" || diff --git a/web/src/pages/stages/prompt/PromptForm.ts b/web/src/pages/stages/prompt/PromptForm.ts index 7fafebab7..a0164677a 100644 --- a/web/src/pages/stages/prompt/PromptForm.ts +++ b/web/src/pages/stages/prompt/PromptForm.ts @@ -157,7 +157,7 @@ export class PromptForm extends ModelForm {