From 55c312cff038f4175856bf3216dfa7a2883eaec6 Mon Sep 17 00:00:00 2001 From: Alexis Guyomar Date: Thu, 9 Jan 2025 18:14:47 +0100 Subject: [PATCH] feat: modified error message dialog to match new layouts --- _dev/src/ts/dialogs/SendErrorReportDialog.ts | 4 ++++ .../dialogs/dialog-error-report.html.twig | 18 ++++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/_dev/src/ts/dialogs/SendErrorReportDialog.ts b/_dev/src/ts/dialogs/SendErrorReportDialog.ts index 80edcdf0f..26aee0709 100644 --- a/_dev/src/ts/dialogs/SendErrorReportDialog.ts +++ b/_dev/src/ts/dialogs/SendErrorReportDialog.ts @@ -9,6 +9,10 @@ export default class SendErrorReportDialog implements DomLifecycle { public mount = (): void => { this.#form.addEventListener('submit', this.#onSubmit); + + const errorMessageArea: HTMLTextAreaElement = this.#form.querySelector('#errorMessage')!; + const errors = logStore.getErrors(); + errorMessageArea.value = errors[errors.length - 1].message; }; public beforeDestroy = (): void => { diff --git a/views/templates/dialogs/dialog-error-report.html.twig b/views/templates/dialogs/dialog-error-report.html.twig index 4bea3fc04..c081a9657 100644 --- a/views/templates/dialogs/dialog-error-report.html.twig +++ b/views/templates/dialogs/dialog-error-report.html.twig @@ -2,12 +2,12 @@ {% set dialogId = 'errorDialog' %} {% set title = 'Send error report?'|trans({}) %} -{% set dialogSize = 'sm' %} +{% set dialogSize = 'md' %} {% block dialog_content %}

- {{ 'Help us improve the module by sending us this error report. You can add details in the description if you want to.'|trans({}) }} + {{ 'Help us improve the module by sending us this error report. For your information, the logs will be attached with your message. You can add more details in the description if you wish'|trans({}) }}

{% if data_transparency_link %} @@ -22,6 +22,20 @@ {% block dialog_extra_content_inner %}
+
+ + +
+