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

En tant qu’employeur je peux inviter un candidat à prendre rdv depuis ma liste de candidatures [GEN-1702] #4357

Merged
merged 4 commits into from
Sep 13, 2024

Conversation

leo-naeka
Copy link
Contributor

@leo-naeka leo-naeka commented Jul 3, 2024

🤔 Pourquoi ?

Faciliter l’expérience de recrutement des employeurs. Leur permettre d’inviter par mail/sms des candidats à prendre rdv avec eux depuis les emplois.

🍰 Comment ?

Mise en place d'un bouton permettant d'inviter un candidat à prendre rendez-vous avec le SIAE par l'intermédiaire de RDV Insertion.

🏝️ Comment tester

  • S'inscrire en tant que candidat avec un email valide

  • Puis postuler auprès d'un SIAE

  • En tant qu'employeur de ce SIAE, s'assurer que l'ID d'organisation RDV-I est bien défini en admin (654 pour la démo)

  • Puis parcourir la liste des candidatures et inviter le candidat à prendre RDV

  • En tant que candidat, je reçois un mail d'invitation de la part de RDV-I

💻 Captures d'écran

Capture d’écran 2024-08-15 à 13 03 56 Capture d’écran 2024-08-15 à 13 04 09

@leo-naeka leo-naeka added 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC ajouté Ajouté dans le changelog. labels Jul 3, 2024
@leo-naeka leo-naeka self-assigned this Jul 3, 2024
Copy link

github-actions bot commented Jul 3, 2024

🥁 La recette jetable est prête ! 👉 Je veux tester cette PR !

@leo-naeka leo-naeka force-pushed the leo/rdvi-job-application-list branch from 257dd64 to d5cbc0d Compare July 3, 2024 11:24
@leo-naeka leo-naeka force-pushed the leo/rdvi-job-application-list branch 4 times, most recently from fe08205 to 8a4b4a0 Compare August 7, 2024 14:58
@leo-naeka leo-naeka force-pushed the leo/rdvi-job-application-list branch from ae052aa to 4ef5548 Compare August 15, 2024 07:10
@leo-naeka leo-naeka removed the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Aug 15, 2024
@leo-naeka leo-naeka changed the title En tant qu’employeur je peux inviter un candidat à prendre rdv depuis ma liste de candidatures En tant qu’employeur je peux inviter un candidat à prendre rdv depuis ma liste de candidatures [GEN-1702] Aug 15, 2024
@leo-naeka leo-naeka marked this pull request as ready for review August 15, 2024 11:18
config/settings/base.py Outdated Show resolved Hide resolved
itou/rdv_insertion/enums.py Show resolved Hide resolved
@@ -13,10 +13,18 @@ htmx.onLoad(function () {
* [2] https://select2.org/programmatic-control/events#listening-for-events
* [3] https://developer.mozilla.org/en-US/docs/Web/API/Event/Event
*/
e.target.dispatchEvent(new Event("change", {bubbles: true}));
e.target.dispatchEvent(new Event("change", { bubbles: true }));
Copy link
Contributor

Choose a reason for hiding this comment

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

👀 Est-il venu le temps de définir notre linter/formatter de fichier JS ? 🧌

Copy link
Contributor

Choose a reason for hiding this comment

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

djlint devrait le faire :

format_js = true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

J'imagine que djlint ne format que les blocs JS des templates et pas les fichiers JS eux-mêmes ?

En tout cas en local il skip :

❯ pre-commit run --files itou/static/js/htmx_compat.js
Ruff format..........................................(no files to check)Skipped
Ruff check...........................................(no files to check)Skipped
djlint...............................................(no files to check)Skipped
ShellCheck...........................................(no files to check)Skipped

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Par ailleurs j'ai un doute que djlint ait pour mission de traiter les fichiers JS. Car si je rajoute types_or: [html,javascript], voilà la diff produite 😵‍💫

Diff
diff --git a/itou/static/js/htmx_compat.js b/itou/static/js/htmx_compat.js
index f4a9fd094..fe541f7cb 100644
--- a/itou/static/js/htmx_compat.js
+++ b/itou/static/js/htmx_compat.js
@@ -1,30 +1,30 @@
 "use strict";
 
 htmx.onLoad(function (target) {
-  function showEvent(e) {
-    /**
-      * Select2 events are jQuery events [1][2] and not standard JavaScript
-      * events [3].
-      *
-      * Dispatch a JavaScript change event when the select2 selection changes,
-      * for hx-trigger="change".
-      *
-      * [1] https://api.jquery.com/category/events/event-object/
-      * [2] https://select2.org/programmatic-control/events#listening-for-events
-      * [3] https://developer.mozilla.org/en-US/docs/Web/API/Event/Event
-      */
-    e.target.dispatchEvent(new Event("change", { bubbles: true }));
-  }
-  // Selection events from https://select2.org/programmatic-control/events
-  $(".django-select2").on("select2:select", showEvent);
-  $(".django-select2").on("select2:unselect", showEvent);
-  $(".django-select2").on("select2:clear", showEvent);
+function showEvent(e) {
+/**
+* Select2 events are jQuery events [1][2] and not standard JavaScript
+* events [3].
+*
+* Dispatch a JavaScript change event when the select2 selection changes,
+* for hx-trigger="change".
+*
+* [1] https://api.jquery.com/category/events/event-object/
+* [2] https://select2.org/programmatic-control/events#listening-for-events
+* [3] https://developer.mozilla.org/en-US/docs/Web/API/Event/Event
+*/
+e.target.dispatchEvent(new Event("change", { bubbles: true }));
+}
+// Selection events from https://select2.org/programmatic-control/events
+$(".django-select2").on("select2:select", showEvent);
+$(".django-select2").on("select2:unselect", showEvent);
+$(".django-select2").on("select2:clear", showEvent);
 
-  // Init target tooltips
-  var tooltipTriggerList = [].slice.call(
-    target.parentNode.querySelectorAll('[data-bs-toggle="tooltip"]')
-  );
-  tooltipTriggerList.map(function (tooltipTriggerEl) {
-    return new bootstrap.Tooltip(tooltipTriggerEl);
-  });
+// Init target tooltips
+var tooltipTriggerList = [].slice.call(
+target.parentNode.querySelectorAll('[data-bs-toggle="tooltip"]')
+);
+tooltipTriggerList.map(function (tooltipTriggerEl) {
+return new bootstrap.Tooltip(tooltipTriggerEl);
+});
 });

Du coup je serais plutôt partant de rajouter un hook (prettier?) + config propre au projet, car là c'est manifestement ma config globale qui a pris le dessus

itou/www/apply/urls.py Outdated Show resolved Hide resolved
tests/utils/test.py Outdated Show resolved Hide resolved
itou/www/apply/views/process_views.py Outdated Show resolved Hide resolved
itou/www/apply/views/process_views.py Outdated Show resolved Hide resolved
itou/www/apply/views/process_views.py Outdated Show resolved Hide resolved
Copy link
Contributor

@francoisfreitag francoisfreitag left a comment

Choose a reason for hiding this comment

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

J’ai un bug d’UI avec les STR suivants:

  1. sans avoir configuré RDV-I, juste l’ID de la structure sur garage martinet
  2. proposer un RDV (échec)
  3. Le bouton Réessayer un envoi s’affiche, avec le tooltip
  4. Cliquer sur Réessayer un envoi
  5. Le bouton « Réessayer un envoi » s’affiche à nouveau

En scrollant vers le bas, le tooltip du premier bouton apparaît en haut à gauche de l’écran. Il aurait dû disparaître.

Screencast.from.2024-08-27.16-51-10.webm

itou/rdv_insertion/models.py Show resolved Hide resolved
itou/rdv_insertion/models.py Show resolved Hide resolved
itou/rdv_insertion/models.py Show resolved Hide resolved
itou/rdv_insertion/models.py Show resolved Hide resolved
itou/static/css/itou.css Outdated Show resolved Hide resolved
tests/www/apply/test_list_rdv_insertion.py Outdated Show resolved Hide resolved
tests/www/apply/test_list_rdv_insertion.py Outdated Show resolved Hide resolved
tests/www/apply/test_list_rdv_insertion.py Outdated Show resolved Hide resolved
tests/www/apply/test_list_rdv_insertion.py Outdated Show resolved Hide resolved
@leo-naeka leo-naeka force-pushed the leo/rdvi-job-application-list branch 2 times, most recently from a2af14b to 7a57ef1 Compare September 10, 2024 15:52
Copy link
Contributor

@francoisfreitag francoisfreitag left a comment

Choose a reason for hiding this comment

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

Le commit de prise en compte des remarques me semble bien. J’ai refait un micro tour sur la PR 👍

itou/static/js/htmx_compat.js Outdated Show resolved Hide resolved
itou/rdv_insertion/models.py Show resolved Hide resolved
itou/templates/apply/list_for_siae.html Show resolved Hide resolved
itou/www/apply/views/process_views.py Show resolved Hide resolved
@leo-naeka leo-naeka force-pushed the leo/rdvi-job-application-list branch 2 times, most recently from 555e34b to b2ae1fc Compare September 11, 2024 21:57
@leo-naeka leo-naeka added this pull request to the merge queue Sep 13, 2024
Merged via the queue into master with commit 8017d81 Sep 13, 2024
11 checks passed
@leo-naeka leo-naeka deleted the leo/rdvi-job-application-list branch September 13, 2024 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ajouté Ajouté dans le changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants