From 2a29cfd401303784b857ade7ad1296f57fbbc562 Mon Sep 17 00:00:00 2001 From: Falk Date: Tue, 19 Dec 2023 13:54:22 +0100 Subject: [PATCH] fix: incorporate review feedback --- .../copy-modal.hbs | 19 ++++++++++--------- .../copy-modal.js | 14 +++----------- .../components/cfb-form-editor/general.hbs | 9 +++++++++ .../cfb-form-editor/question-list.hbs | 2 +- .../addon/components/cfb-form-list/item.hbs | 11 ----------- .../addon/components/cfb-slug-input.hbs | 1 + .../addon/components/cfb-slug-input.js | 11 +++++++++++ .../tests/acceptance/form-copy-test.js | 9 ++++++--- packages/form-builder/translations/de.yaml | 3 ++- packages/form-builder/translations/en.yaml | 2 +- packages/form-builder/translations/fr.yaml | 10 ++++++++++ 11 files changed, 54 insertions(+), 37 deletions(-) rename packages/form-builder/addon/components/{cfb-form-list => cfb-form-editor}/copy-modal.hbs (83%) rename packages/form-builder/addon/components/{cfb-form-list => cfb-form-editor}/copy-modal.js (79%) diff --git a/packages/form-builder/addon/components/cfb-form-list/copy-modal.hbs b/packages/form-builder/addon/components/cfb-form-editor/copy-modal.hbs similarity index 83% rename from packages/form-builder/addon/components/cfb-form-list/copy-modal.hbs rename to packages/form-builder/addon/components/cfb-form-editor/copy-modal.hbs index db06148b4d..9e4da8abbc 100644 --- a/packages/form-builder/addon/components/cfb-form-list/copy-modal.hbs +++ b/packages/form-builder/addon/components/cfb-form-editor/copy-modal.hbs @@ -1,10 +1,10 @@ -{{#if this.visible}} - + + {{#if this.visible}} @@ -43,7 +44,7 @@ - -{{/if}} + {{/if}} + {{yield (hash toggle=this.toggle)}} \ No newline at end of file diff --git a/packages/form-builder/addon/components/cfb-form-list/copy-modal.js b/packages/form-builder/addon/components/cfb-form-editor/copy-modal.js similarity index 79% rename from packages/form-builder/addon/components/cfb-form-list/copy-modal.js rename to packages/form-builder/addon/components/cfb-form-editor/copy-modal.js index 7bdffd676f..8c21bcb0fd 100644 --- a/packages/form-builder/addon/components/cfb-form-list/copy-modal.js +++ b/packages/form-builder/addon/components/cfb-form-editor/copy-modal.js @@ -10,7 +10,7 @@ import { dropTask } from "ember-concurrency"; import copyFormMutation from "@projectcaluma/ember-form-builder/gql/mutations/copy-form.graphql"; import validations from "@projectcaluma/ember-form-builder/validations/form"; -export default class componentsCfbFormItemListCopyModal extends Component { +export default class CfbFormEditorCopyModal extends Component { @queryManager apollo; @service notification; @service router; @@ -49,21 +49,13 @@ export default class componentsCfbFormItemListCopyModal extends Component { ); this.notification.success( - this.intl.t( - `caluma.form-builder.notification.form.${ - this.args.slug ? "save" : "create" - }.success`, - ), + this.intl.t("caluma.form-builder.notification.form.create.success"), ); this.router.transitionTo("edit", form.slug); } catch (e) { this.notification.danger( - this.intl.t( - `caluma.form-builder.notification.form.${ - this.args.slug ? "save" : "create" - }.error`, - ), + this.intl.t("caluma.form-builder.notification.form.create.error"), ); } } 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 c684760b52..69cf2da255 100644 --- a/packages/form-builder/addon/components/cfb-form-editor/general.hbs +++ b/packages/form-builder/addon/components/cfb-form-editor/general.hbs @@ -50,6 +50,15 @@ />
+ + + + diff --git a/packages/form-builder/addon/components/cfb-form-list/item.hbs b/packages/form-builder/addon/components/cfb-form-list/item.hbs index 38dfa1d8d7..2e97db05a9 100644 --- a/packages/form-builder/addon/components/cfb-form-list/item.hbs +++ b/packages/form-builder/addon/components/cfb-form-list/item.hbs @@ -7,17 +7,6 @@ {{this.labelName}} - - - -