From e9640b7dd770bd7d3867fe35081a9b652995feda Mon Sep 17 00:00:00 2001 From: StephanH90 <88476449+StephanH90@users.noreply.github.com> Date: Thu, 25 Jan 2024 16:11:09 +0100 Subject: [PATCH] feat(form-builder): allow editing of form meta (#2597) --- .../cfb-form-editor/cfb-advanced-settings.hbs | 16 ++++++++++++++++ .../cfb-form-editor/cfb-advanced-settings.js | 6 ++++++ .../components/cfb-form-editor/general.hbs | 8 ++++++++ .../addon/components/cfb-form-editor/general.js | 3 +++ .../components/cfb-form-editor/question.hbs | 17 ++--------------- .../addon/gql/fragments/form-info.graphql | 1 + .../cfb-form-editor/cfb-advanced-settings.js | 1 + 7 files changed, 37 insertions(+), 15 deletions(-) create mode 100644 packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.hbs create mode 100644 packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.js create mode 100644 packages/form-builder/app/components/cfb-form-editor/cfb-advanced-settings.js diff --git a/packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.hbs b/packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.hbs new file mode 100644 index 000000000..3fd9ab528 --- /dev/null +++ b/packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.hbs @@ -0,0 +1,16 @@ + + {{#if this.showAdvanced}} + + {{else}} + + {{/if}} + {{t "caluma.form-builder.question.advancedSettings"}} + + +{{#if this.showAdvanced}} + {{yield}} +{{/if}} \ No newline at end of file diff --git a/packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.js b/packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.js new file mode 100644 index 000000000..a76e673b4 --- /dev/null +++ b/packages/form-builder/addon/components/cfb-form-editor/cfb-advanced-settings.js @@ -0,0 +1,6 @@ +import Component from "@glimmer/component"; +import { tracked } from "@glimmer/tracking"; + +export default class CfbFormEditorCfbAdvancedSettings extends Component { + @tracked showAdvanced = false; +} diff --git a/packages/form-builder/addon/components/cfb-form-editor/general.hbs b/packages/form-builder/addon/components/cfb-form-editor/general.hbs index c684760b5..ea2b9bf32 100644 --- a/packages/form-builder/addon/components/cfb-form-editor/general.hbs +++ b/packages/form-builder/addon/components/cfb-form-editor/general.hbs @@ -49,6 +49,14 @@ @renderComponent={{component "cfb-toggle-switch" size="small"}} /> + + + +
- - {{#if this.showAdvanced}} - - {{else}} - - {{/if}} - {{t "caluma.form-builder.question.advancedSettings"}} - - - {{#if this.showAdvanced}} + {{#if (has-question-type f.model "action-button")}} - {{/if}} +