From 4562ed46db814a382238da535e32531706bf957f Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Tue, 1 Jun 2021 10:21:08 +0200 Subject: [PATCH] OnTheFly modal: adapt footer button for show/edit cases (bug minor) [BUG] to reproduce: * clic first on show item button * in modal clic edit button * close modal * clic again on show item button --- .../public/vuejs/_components/OnTheFly.vue | 19 ++++++++++++++++--- .../Resources/public/vuejs/_js/i18n.js | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly.vue index 238b97851..4e41a4adb 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_components/OnTheFly.vue @@ -39,7 +39,12 @@ @@ -69,10 +74,14 @@ export default { modal: { showModal: false, modalDialogClass: "modal-dialog-scrollable modal-xl" - } + }, + action: this.action } }, computed: { + action() { + return this.$data.action; + }, classAction() { switch (this.action) { case 'show': @@ -102,7 +111,7 @@ export default { case 'create': return 'onthefly.create.title'; } - }, + } }, methods: { openModal() { @@ -110,6 +119,10 @@ export default { this.$nextTick(function() { //this.$refs.search.focus(); }) + }, + changeActionTo(action) { + // [BUG] clic first on show item button; in modal clic edit button; close modal; clic again on show item button + this.$data.action = action; } } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js index ed8d8154f..025aeeb44 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/_js/i18n.js @@ -58,7 +58,7 @@ const messages = { }, create: { button: "Créer \"{q}\"", - title: "Saisir à la volée…", + title: "Créer à la volée…", person: "un nouvel usager", thirdparty: "un nouveau tiers" },