Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candidature: Corriger le bouton "Retour" de la modale d'acceptation de candidature [GEN-2376] #5390

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion itou/templates/apply/includes/accept_section.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ <h3 class="modal-title" id="confirmation-modal-label">Confirmation de l’embauc
hx-swap="outerHTML"
hx-vals='{"confirmed": "True"}'
hx-include="#acceptForm"
hx-trigger="click from:#confirm-hiring"
{% matomo_event "candidature" "submit" "accept_application_confirmation" %}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En alternative, tu pourrais ajouter un hx-trigger pour filtrer les évènements qui déclenche l'appel ajax.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je trouve ça pas plus simple à relire/comprendre, mais c'est très certainement subjectif 😅

<button type="button" class="btn btn-sm btn-outline-primary" data-bs-dismiss="modal">Retour</button>
<button class="btn btn-sm btn-primary">
<button id="confirm-hiring" class="btn btn-sm btn-primary">
<div class="stable-text">
<span>Confirmer</span>
</div>
Expand Down
4 changes: 4 additions & 0 deletions tests/www/apply/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,10 @@ def accept_job_application(self, client, job_application, post_data=None, assert
"""
url_accept = reverse("apply:accept", kwargs={"job_application_id": job_application.pk})
response = client.get(url_accept)
soup = parse_response_to_soup(response, selector="#main")
button = soup.find("button", attrs={"id": "confirm-hiring"})
assert button.parent.attrs["hx-trigger"] == "click from:#confirm-hiring"

assertContains(response, "Confirmation de l’embauche")
# Make sure modal is hidden.
assert response.headers.get("HX-Trigger") is None
Expand Down
Loading