Skip to content

Commit

Permalink
T1889 cannot send letter on mycompassion (#53)
Browse files Browse the repository at this point in the history
* Setup test infrastructure

* Add warning if user tries to send/preview a letter with an empty text

* Add translations for warning message

* Simplify check

* Remove useless tests

* Fix pre-commit

* Change alert warning->danger to be clearer to user

* Update my_compassion/i18n/de.po

Fix translation Sie -> Du

Co-authored-by: ecino <[email protected]>

---------

Co-authored-by: ecino <[email protected]>
  • Loading branch information
nlachat-compassion and ecino authored Nov 18, 2024
1 parent 2016776 commit bb4d4e5
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 33 deletions.
18 changes: 9 additions & 9 deletions muskathlon/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ Muskathlon

Adds a website portal for Muskathlon Events :

- list of events
- event page with participants
- donation
- registration
- runner portal
- list of events
- event page with participants
- donation
- registration
- runner portal

Reports for sending information to 4M: - list with useful data about the
muskathlon event - bar graph amount by ambassador - fields format for a
Expand Down Expand Up @@ -60,10 +60,10 @@ Authors
Contributors
------------

- Sebastien Toth <[email protected]>
- Nicolas Badoux
- Samuel Fringeli
- Emanuel Cino <[email protected]>
- Sebastien Toth <[email protected]>
- Nicolas Badoux
- Samuel Fringeli
- Emanuel Cino <[email protected]>

Maintainers
-----------
Expand Down
6 changes: 3 additions & 3 deletions my_compassion/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ Authors
Contributors
------------

- Sebastien Toth <[email protected]>
- Christopher Meier <[email protected]>
- Théo Nikles <[email protected]>
- Sebastien Toth <[email protected]>
- Christopher Meier <[email protected]>
- Théo Nikles <[email protected]>

Maintainers
-----------
Expand Down
8 changes: 8 additions & 0 deletions my_compassion/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,14 @@ msgstr ""
"Wenn der Fehler weiterhin besteht, kontaktiere uns auf [email protected], "
"damit wir das Problem lösen können."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.letter_actions
msgid ""
"The text of your letter is empty. Please add some text and try again."
msgstr ""
"Der Text Deines Briefes ist leer."
"Bitte füge Text hinzu und versuche es erneut."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_children_letters
#: model_terms:ir.ui.view,arch_db:my_compassion.my_children_pictures
Expand Down
7 changes: 7 additions & 0 deletions my_compassion/i18n/fr_CH.po
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,13 @@ msgstr ""
"Si l'erreur persiste, Merci de nous contacter à [email protected] pour nous "
"signaler le problème."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.letter_actions
msgid ""
"The text of your letter is empty. Please add some text and try again."
msgstr ""
"Le texte de votre lettre est vide. Veuillez ajouter du texte et réessayer."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_children_letters
#: model_terms:ir.ui.view,arch_db:my_compassion.my_children_pictures
Expand Down
7 changes: 7 additions & 0 deletions my_compassion/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,13 @@ msgstr ""
"perderlo e contattaci all'indirizzo [email protected] per segnalare il "
"problema."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.letter_actions
msgid ""
"The text of your letter is empty. Please add some text and try again."
msgstr ""
"Il testo della tua lettera è vuoto. Si prega di aggiungere del testo e riprovare."

#. module: my_compassion
#: model_terms:ir.ui.view,arch_db:my_compassion.my_children_letters
#: model_terms:ir.ui.view,arch_db:my_compassion.my_children_pictures
Expand Down
6 changes: 6 additions & 0 deletions my_compassion/static/src/js/write_a_letter.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ function startStopLoading(type) {
* we can send a letter directly if the user pressed the corresponding button
*/
async function createLetter(mode = "preview") {
// Check if text is empty (and avoid sending the request if it is)
if (letter_content.value.length === 0) {
displayAlert("letter_text_empty_warning");
return;
}

startStopLoading(mode);
const params = new URLSearchParams(window.location.search);

Expand Down
7 changes: 7 additions & 0 deletions my_compassion/templates/my_account_write_a_letter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@

</div>
<div
id="letter_text_empty_warning"
class="alert alert-danger alert-dismissable text-center ml-2 mt-2 mb-2"
style="display: none;"
>
The text of your letter is empty. Please add some text and try again.
</div>
<div
id="send_error"
class="alert alert-danger alert-dismissable text-center ml-2 mt-2 mb-2"
style="display: none;"
Expand Down
2 changes: 1 addition & 1 deletion my_compassion_segmentation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Authors
Contributors
------------

- Emanuel Cino <[email protected]>
- Emanuel Cino <[email protected]>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion website_child_protection/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Authors
Contributors
------------

- Emanuel Cino <[email protected]>
- Emanuel Cino <[email protected]>

Maintainers
-----------
Expand Down
8 changes: 4 additions & 4 deletions website_event_compassion/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ To use this module, you need to:
Known issues / Roadmap
======================

- Nothing yet
- Nothing yet

Changelog
=========

10.0.1.0.0 (2018-07-12)
-----------------------

- [ADD] Add the module.
- [ADD] Add the module.

11.0.1.0.0 (2020-01-02)
-----------------------

- Migrated to Odoo v11.
- Migrated to Odoo v11.

Bug Tracker
===========
Expand All @@ -78,7 +78,7 @@ Authors
Contributors
------------

- Emanuel Cino <[email protected]>
- Emanuel Cino <[email protected]>

Maintainers
-----------
Expand Down
4 changes: 2 additions & 2 deletions website_sale_donation/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Changelog
14.0.1.1.0
----------

- [ADD] Automatically match partner during checkout.
- [ADD] Automatically match partner during checkout.

Bug Tracker
===========
Expand All @@ -58,7 +58,7 @@ Authors
Contributors
------------

- Emanuel Cino [email protected]
- Emanuel Cino [email protected]

Maintainers
-----------
Expand Down
22 changes: 11 additions & 11 deletions website_sponsorship/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ any published child.
Configuration
=============

- You can go on the website and edit the page templates in order to
make sure it fits your needs and design guidelines.
- Under Sponsorship/Settings/Personal Data Agreement, you should create
a page for displaying the general terms that have to be accepted upon
making a new sponsorship.
- You can go on the website and edit the page templates in order to make
sure it fits your needs and design guidelines.
- Under Sponsorship/Settings/Personal Data Agreement, you should create
a page for displaying the general terms that have to be accepted upon
making a new sponsorship.

Usage
=====
Expand All @@ -47,15 +47,15 @@ website.

Three new public routes will be added:

- /children : public childpool
- /child/<child_id>: child presentation page
- /child/<child_id>/sponsor: child sponsorship form
- /data-protection: data protection and general terms page
- /children : public childpool
- /child/<child_id>: child presentation page
- /child/<child_id>/sponsor: child sponsorship form
- /data-protection: data protection and general terms page

Known issues / Roadmap
======================

- T0433 : make a nice looking child description page
- T0433 : make a nice looking child description page

Bug Tracker
===========
Expand All @@ -78,7 +78,7 @@ Authors
Contributors
------------

- Emanuel Cino <[email protected]>
- Emanuel Cino <[email protected]>

Maintainers
-----------
Expand Down
4 changes: 2 additions & 2 deletions website_sponsorship/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ <h1 class="title">Website - Sponsor a child form</h1>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<ul class="simple">
<li>You can go on the website and edit the page templates in order to
make sure it fits your needs and design guidelines.</li>
<li>You can go on the website and edit the page templates in order to make
sure it fits your needs and design guidelines.</li>
<li>Under Sponsorship/Settings/Personal Data Agreement, you should create
a page for displaying the general terms that have to be accepted upon
making a new sponsorship.</li>
Expand Down

0 comments on commit bb4d4e5

Please sign in to comment.