Skip to content

Commit

Permalink
Merge pull request #1112 from ga-devfront/feat/update-send-error-report
Browse files Browse the repository at this point in the history
[NEW UI] Update send error message dialog
  • Loading branch information
Quetzacoalt91 authored Jan 10, 2025
2 parents 7deccfe + 55c312c commit 9d5b324
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions _dev/src/ts/dialogs/SendErrorReportDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
18 changes: 16 additions & 2 deletions views/templates/dialogs/dialog-error-report.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

{% set dialogId = 'errorDialog' %}
{% set title = 'Send error report?'|trans({}) %}
{% set dialogSize = 'sm' %}
{% set dialogSize = 'md' %}

{% block dialog_content %}
<div class="dialog__error-report-content">
<p>
{{ '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({}) }}
</p>

{% if data_transparency_link %}
Expand All @@ -22,6 +22,20 @@

{% block dialog_extra_content_inner %}
<form class="dialog__error-report-form" id="form-error-feedback" name="form-error-feedback">
<div class="form-group">
<label for="errorMessage">
{{ 'Error message'|trans({}) }}
</label>
<textarea
disabled
class="form-control"
id="errorMessage"
name="error"
placeholder=""
rows="3"
></textarea>
</div>

<div class="form-group">
<label for="userEmail">
{{ 'Email (optional)'|trans({}) }}
Expand Down

0 comments on commit 9d5b324

Please sign in to comment.