From e3909571617b8b28c819b007c0aef9956621f351 Mon Sep 17 00:00:00 2001 From: vasileios Date: Wed, 9 Oct 2024 11:33:48 +0200 Subject: [PATCH] [#4709] Updated generic error message for errors in a form,added a link to the requests logs --- .../admin/forms/form/change_form.html | 1 + src/openforms/js/compiled-lang/en.json | 36 +++++++++++++++---- src/openforms/js/compiled-lang/nl.json | 36 +++++++++++++++---- .../admin/form_design/form-creation-form.js | 16 +++++++-- src/openforms/js/components/admin/index.js | 10 ++++-- src/openforms/js/lang/en.json | 10 +++--- src/openforms/js/lang/nl.json | 10 +++--- 7 files changed, 92 insertions(+), 27 deletions(-) diff --git a/src/openforms/forms/templates/admin/forms/form/change_form.html b/src/openforms/forms/templates/admin/forms/form/change_form.html index 7a39c1108a..15e6e1beca 100644 --- a/src/openforms/forms/templates/admin/forms/form/change_form.html +++ b/src/openforms/forms/templates/admin/forms/form/change_form.html @@ -30,6 +30,7 @@ data-form-history-url="{{ history_url }}" data-csrftoken="{{ csrf_token }}" data-tinymce-url="{% static 'tinymce/tinymce.min.js' %}" + data-outgoing-requests-url="{% url 'admin:log_outgoing_requests_outgoingrequestslog_changelist' %}" > {# Managed by React #} {% endblock %} diff --git a/src/openforms/js/compiled-lang/en.json b/src/openforms/js/compiled-lang/en.json index 708f0d19ef..1b56ee8c5c 100644 --- a/src/openforms/js/compiled-lang/en.json +++ b/src/openforms/js/compiled-lang/en.json @@ -1061,6 +1061,36 @@ "value": "and" } ], + "9fW2NX": [ + { + "type": 0, + "value": "Sorry! Something unexpected went wrong." + }, + { + "children": [ + ], + "type": 8, + "value": "br" + }, + { + "type": 0, + "value": "Contact your technical administrator to investigate, or perhaps more information is available in the " + }, + { + "children": [ + { + "type": 0, + "value": "outgoing request logs" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": "." + } + ], "9lk1eS": [ { "type": 0, @@ -5165,12 +5195,6 @@ "value": "The regular expression pattern test that the city field value must pass before the form can be submitted." } ], - "ow5AAO": [ - { - "type": 0, - "value": "The form is invalid. Please correct the errors below." - } - ], "oxYXJX": [ { "type": 0, diff --git a/src/openforms/js/compiled-lang/nl.json b/src/openforms/js/compiled-lang/nl.json index 6d6e8b9ecc..9e0f54e9b6 100644 --- a/src/openforms/js/compiled-lang/nl.json +++ b/src/openforms/js/compiled-lang/nl.json @@ -1065,6 +1065,36 @@ "value": "en" } ], + "9fW2NX": [ + { + "type": 0, + "value": "Sorry! Er is iets onverwachts misgegaan." + }, + { + "children": [ + ], + "type": 8, + "value": "br" + }, + { + "type": 0, + "value": "Neem contact op met je technische beheerder om dit te onderzoeken, of misschien is er meer informatie beschikbaar in de " + }, + { + "children": [ + { + "type": 0, + "value": "logboeken van uitgaande verzoeken" + } + ], + "type": 8, + "value": "link" + }, + { + "type": 0, + "value": "." + } + ], "9lk1eS": [ { "type": 0, @@ -5187,12 +5217,6 @@ "value": "Het patroon van reguliere expressie waar de stad aan moet voldoen voor het formulier kan verstuurd worden." } ], - "ow5AAO": [ - { - "type": 0, - "value": "De gegevens zijn ongeldig. Los de problemen hieronder op." - } - ], "oxYXJX": [ { "type": 0, diff --git a/src/openforms/js/components/admin/form_design/form-creation-form.js b/src/openforms/js/components/admin/form_design/form-creation-form.js index eaeb7708d9..1e43c6d701 100644 --- a/src/openforms/js/components/admin/form_design/form-creation-form.js +++ b/src/openforms/js/components/admin/form_design/form-creation-form.js @@ -990,7 +990,7 @@ StepsFieldSet.propTypes = { /** * Component to render the form edit page. */ -const FormCreationForm = ({formUuid, formUrl, formHistoryUrl}) => { +const FormCreationForm = ({formUuid, formUrl, formHistoryUrl, outgoingRequestsUrl}) => { const {csrftoken} = useContext(APIContext); const intl = useIntl(); const initialState = { @@ -1267,8 +1267,18 @@ const FormCreationForm = ({formUuid, formUrl, formHistoryUrl}) => { {Object.keys(state.errors).length ? (

Contact your + technical administrator to investigate, or perhaps more information is + available in the outgoing request logs.`} + values={{ + br: () =>
, + link: chunks => ( + + {chunks} + + ), + }} />
) : null} diff --git a/src/openforms/js/components/admin/index.js b/src/openforms/js/components/admin/index.js index 746a2a9c44..847d0b1773 100644 --- a/src/openforms/js/components/admin/index.js +++ b/src/openforms/js/components/admin/index.js @@ -18,7 +18,8 @@ const mountForm = wrapperProps => { if (!formCreationFormNodes.length) return; for (const formCreationFormNode of formCreationFormNodes) { - const {csrftoken, formUuid, formUrl, tinymceUrl, formHistoryUrl} = formCreationFormNode.dataset; + const {csrftoken, formUuid, formUrl, tinymceUrl, formHistoryUrl, outgoingRequestsUrl} = + formCreationFormNode.dataset; ReactModal.setAppElement(formCreationFormNode); const root = createRoot(formCreationFormNode); @@ -28,7 +29,12 @@ const mountForm = wrapperProps => { // Strict mode is likely only viable once we've simplified the code substantially. - + ); diff --git a/src/openforms/js/lang/en.json b/src/openforms/js/lang/en.json index d108756b16..566fda3bce 100644 --- a/src/openforms/js/lang/en.json +++ b/src/openforms/js/lang/en.json @@ -434,6 +434,11 @@ "description": "Extra logic action prefix", "originalDefault": "and" }, + "9fW2NX": { + "defaultMessage": "Sorry! Something unexpected went wrong.

Contact your technical administrator to investigate, or perhaps more information is available in the outgoing request logs.", + "description": "Generic admin error message", + "originalDefault": "Sorry! Something unexpected went wrong.

Contact your technical administrator to investigate, or perhaps more information is available in the outgoing request logs." + }, "9y3/ek": { "defaultMessage": "Confirm", "description": "JSON editor: confirm edited variable definition", @@ -2309,11 +2314,6 @@ "description": "Include confirmation page content in PDF", "originalDefault": "Whether to include the content of the confirmation page in the PDF." }, - "ow5AAO": { - "defaultMessage": "The form is invalid. Please correct the errors below.", - "description": "Generic error message", - "originalDefault": "The form is invalid. Please correct the errors below." - }, "oxYXJX": { "defaultMessage": "How successful submissions of this form will be removed after the limit. Leave blank to use value in General Configuration.", "description": "Successful Submissions Removal Method help text", diff --git a/src/openforms/js/lang/nl.json b/src/openforms/js/lang/nl.json index 1e7d203adb..62defca08a 100644 --- a/src/openforms/js/lang/nl.json +++ b/src/openforms/js/lang/nl.json @@ -438,6 +438,11 @@ "description": "Extra logic action prefix", "originalDefault": "and" }, + "9fW2NX": { + "defaultMessage": "Sorry! Er is iets onverwachts misgegaan.

Neem contact op met je technische beheerder om dit te onderzoeken, of misschien is er meer informatie beschikbaar in de logboeken van uitgaande verzoeken.", + "description": "Generic admin error message", + "originalDefault": "Sorry! Something unexpected went wrong.

Contact your technical administrator to investigate, or perhaps more information is available in the outgoing request logs." + }, "9y3/ek": { "defaultMessage": "Bevestigen", "description": "JSON editor: confirm edited variable definition", @@ -2328,11 +2333,6 @@ "description": "Include confirmation page content in PDF", "originalDefault": "Whether to include the content of the confirmation page in the PDF." }, - "ow5AAO": { - "defaultMessage": "De gegevens zijn ongeldig. Los de problemen hieronder op.", - "description": "Generic error message", - "originalDefault": "The form is invalid. Please correct the errors below." - }, "oxYXJX": { "defaultMessage": "Geeft aan hoe voltooide inzendingen worden opgeschoond na de bewaartermijn. Laat leeg om de waarde van de algemene configuratie te gebruiken.", "description": "Successful Submissions Removal Method help text",