DEV: Define form template field inputs (#20430)

This commit is contained in:
Keegan George
2023-03-01 11:07:13 -08:00
committed by GitHub
parent 8b67a534a0
commit 666b4a7e6b
37 changed files with 963 additions and 130 deletions

View File

@ -1,70 +1,75 @@
// TODO(@keegan): Add translations for template strings
import I18n from "I18n";
export const templateFormFields = [
{
type: "checkbox",
structure: `- type: checkbox
choices:
- "Option 1"
- "Option 2"
- "Option 3"
attributes:
label: "Enter question here"
description: "Enter description here"
validations:
required: true`,
label: "${I18n.t("admin.form_templates.field_placeholders.label")}"
validations:
# ${I18n.t("admin.form_templates.field_placeholders.validations")}`,
},
{
type: "input",
structure: `- type: input
attributes:
label: "Enter input label here"
description: "Enter input description here"
placeholder: "Enter input placeholder here"
validations:
required: true`,
label: "${I18n.t("admin.form_templates.field_placeholders.label")}"
placeholder: "${I18n.t(
"admin.form_templates.field_placeholders.placeholder"
)}"
validations:
# ${I18n.t("admin.form_templates.field_placeholders.validations")}`,
},
{
type: "textarea",
structure: `- type: textarea
attributes:
label: "Enter textarea label here"
description: "Enter textarea description here"
placeholder: "Enter textarea placeholder here"
validations:
required: true`,
label: "${I18n.t("admin.form_templates.field_placeholders.label")}"
placeholder: "${I18n.t(
"admin.form_templates.field_placeholders.placeholder"
)}"
validations:
# ${I18n.t("admin.form_templates.field_placeholders.validations")}`,
},
{
type: "dropdown",
structure: `- type: dropdown
choices:
- "Option 1"
- "Option 2"
- "Option 3"
- "${I18n.t("admin.form_templates.field_placeholders.choices.first")}"
- "${I18n.t("admin.form_templates.field_placeholders.choices.second")}"
- "${I18n.t("admin.form_templates.field_placeholders.choices.third")}"
attributes:
label: "Enter dropdown label here"
description: "Enter dropdown description here"
validations:
required: true`,
none_label: "${I18n.t(
"admin.form_templates.field_placeholders.none_label"
)}"
label: "${I18n.t("admin.form_templates.field_placeholders.label")}"
filterable: false
validations:
# ${I18n.t("admin.form_templates.field_placeholders.validations")}`,
},
{
type: "upload",
structure: `- type: upload
attributes:
file_types: "jpg, png, gif"
label: "Enter upload label here"
description: "Enter upload description here"`,
allow_multiple: false
label: "${I18n.t("admin.form_templates.field_placeholders.label")}"
validations:
# ${I18n.t("admin.form_templates.field_placeholders.validations")}`,
},
{
type: "multiselect",
structure: `- type: multiple_choice
structure: `- type: multi-select
choices:
- "Option 1"
- "Option 2"
- "Option 3"
- "${I18n.t("admin.form_templates.field_placeholders.choices.first")}"
- "${I18n.t("admin.form_templates.field_placeholders.choices.second")}"
- "${I18n.t("admin.form_templates.field_placeholders.choices.third")}"
attributes:
label: "Enter multiple choice label here"
description: "Enter multiple choice description here"
validations:
required: true`,
none_label: "${I18n.t(
"admin.form_templates.field_placeholders.none_label"
)}"
label: "${I18n.t("admin.form_templates.field_placeholders.label")}"
validations:
# ${I18n.t("admin.form_templates.field_placeholders.validations")}`,
},
];