From 434e1311f20633880b36ef41f2abaa79f433e0ef Mon Sep 17 00:00:00 2001 From: f Date: Thu, 4 Jul 2024 16:51:08 -0300 Subject: [PATCH 1/2] fix: htmx usa value para el evento #16714 --- app/javascript/controllers/form_validation_controller.js | 4 ++-- app/javascript/controllers/notification_controller.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/javascript/controllers/form_validation_controller.js b/app/javascript/controllers/form_validation_controller.js index dd1a98ed..b1c0a2f8 100644 --- a/app/javascript/controllers/form_validation_controller.js +++ b/app/javascript/controllers/form_validation_controller.js @@ -39,13 +39,13 @@ export default class extends Controller { if (!this.element.getAttributeNames().some(x => x.startsWith("hx-"))) this.element.submit(); - window.dispatchEvent(new CustomEvent("notification:show", { detail: { id: this.submittingIdValue } })); + window.dispatchEvent(new CustomEvent("notification:show", { detail: { value: this.submittingIdValue } })); } else { event?.stopPropagation(); this.element.classList.add("was-validated"); - window.dispatchEvent(new CustomEvent("notification:show", { detail: { id: this.invalidIdValue } })); + window.dispatchEvent(new CustomEvent("notification:show", { detail: { value: this.invalidIdValue } })); } this.submitting = false; diff --git a/app/javascript/controllers/notification_controller.js b/app/javascript/controllers/notification_controller.js index 7fbe3b5a..89ae085d 100644 --- a/app/javascript/controllers/notification_controller.js +++ b/app/javascript/controllers/notification_controller.js @@ -19,8 +19,8 @@ export default class extends Controller { * actual, se oculta. */ show(event = undefined) { - if (event?.detail?.id !== this.element.id) { - this.hide({ detail: { id: this.element.id } }); + if (event?.detail?.value !== this.element.id) { + this.hide({ detail: { value: this.element.id } }); return; } @@ -33,7 +33,7 @@ export default class extends Controller { } hide(event = undefined) { - if (event?.detail?.id !== this.element.id) return; + if (event?.detail?.value !== this.element.id) return; this.element.classList.remove(...this.showClasses); this.element.classList.add(...this.hideClasses); From 3efd3827a6fdb6f19e3cd5dd93ad3aff33ec21d0 Mon Sep 17 00:00:00 2001 From: f Date: Thu, 4 Jul 2024 16:51:40 -0300 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20ser=20espec=C3=ADficxs=20con=20lo=20?= =?UTF-8?q?que=20va=20a=20pasar=20en=20el=20bot=C3=B3n=20#16712?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/locales/en.yml | 2 +- config/locales/es.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/en.yml b/config/locales/en.yml index ce5a9e36..ee3a23e7 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -957,7 +957,7 @@ en: add: "Add %{layout}" add_new: "Add new option" cancel: "Cancel" - close: "Close" + close: "Close without saving" edit: "Edit" filter: "Start typing to filter..." save: "Save" diff --git a/config/locales/es.yml b/config/locales/es.yml index 416c3e1a..336dc503 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -967,7 +967,7 @@ es: add: "Agregar %{layout}" add_new: "Agregar nueva opción" cancel: "Cancelar" - close: "Cerrar" + close: "Cerrar sin guardar" edit: "Editar" filter: "Empezá a escribir para filtrar..." save: "Guardar"