Skip to content

Pilotage: Suivre le type de prescripteur dans les réponses au formulaire NPS TB 488#5827

Merged
rsebille merged 2 commits into
masterfrom
tally-by-prescriber-type-tb-488
Mar 31, 2025
Merged

Pilotage: Suivre le type de prescripteur dans les réponses au formulaire NPS TB 488#5827
rsebille merged 2 commits into
masterfrom
tally-by-prescriber-type-tb-488

Conversation

@calummackervoy
Copy link
Copy Markdown
Contributor

@calummackervoy calummackervoy commented Mar 24, 2025

🤔 Pourquoi ?

Carte Notion: https://www.notion.so/gip-inclusion/TB-488-Formulaire-Tally-par-type-de-prescripteur-1bb5f321b60480149bf4f04f0582eff1

🍰 Comment ?

Dans un nouveau formulaire Tally, on paramètre le type de prescripteur dans un champ encaché.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?
  • Ajouter l'étiquette « Bug » ?

🏝️ Comment tester ?

  • Créer un utilisateur test depuis le shell :
from tests.prescribers.factories import PrescriberOrganizationWithMembershipFactory
from itou.prescribers.enums import PrescriberOrganizationKind
PrescriberOrganizationWithMembershipFactory(kind=PrescriberOrganizationKind.CHRS, department="75", authorized=True)
displayTallyPopup();
  • Vérifier la réponse avec le type de prescripteur sur le formulaire Tally

💻 Captures d'écran

Screenshot 2025-03-24 at 12 37 44 Screenshot 2025-03-24 at 12 36 46

@calummackervoy calummackervoy added ajouté Ajouté dans le changelog. pilotage labels Mar 24, 2025
@calummackervoy calummackervoy self-assigned this Mar 24, 2025
"tally_popup_form_id": "mRG61J",
"tally_embed_form_id": "3qLKad",
"tally_popup_form_id": "3XQ5D4",
"tally_embed_form_id": "mVNGgv",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@YannickPassa Les anciens formulaires étaient partagés avec le TB 496 (stats_ft_state_main). J'ai raison qu'on devrait utiliser un nouveau formulaire qui cible que le TB 488 ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes !

Comment thread itou/templates/stats/stats.html Outdated
const formId = '{{ tally_popup_form_id }}';
const key = 'statsTallyPopupLastShown-' + formId;
const todaysDate = new Date();
const hiddenFields = JSON.parse("{{ tally_hidden_fields|default:'{}'|escapejs }}");
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

JavaScript non-testé ☹️

Copy link
Copy Markdown
Contributor

@YannickPassa YannickPassa left a comment

Choose a reason for hiding this comment

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

D'un point de vue métier c ok :)

Copy link
Copy Markdown
Contributor

@rsebille rsebille left a comment

Choose a reason for hiding this comment

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

Le JSON dans le contexte Django et le fait que je ne soit pas super à l'aise avec l'utilisation de |escapejs dessus me fait plutôt pencher qu'on devrais utiliser json_script qui est plutôt prévu pour ça, et vu qu'on peux y mettre un id on pourrais se baser sur celui-ci pour récupérer les infos depuis le JS mais aussi depuis le test python.

Comment thread tests/www/stats/test_views.py Outdated
Comment thread itou/www/stats/views.py Outdated
@calummackervoy calummackervoy force-pushed the tally-by-prescriber-type-tb-488 branch from 9bbe545 to 3b880d8 Compare March 28, 2025 10:07
@calummackervoy
Copy link
Copy Markdown
Contributor Author

@rsebille j'ai reformulé avec la solution json_script et j'ai ajouté le support pour la forme tally_embed qui termine la carte

@rsebille rsebille assigned rsebille and unassigned calummackervoy Mar 31, 2025
Published new forms to differentiate results from TB 496 (`stats_ft_state_main`).
TB 488 now has a hidden field for the prescriber kind in the Tally
results. This change required some changes to the JavaScript in order to
support such hidden fields in the context of `stats.html`.
@rsebille rsebille force-pushed the tally-by-prescriber-type-tb-488 branch from 3b880d8 to cf74feb Compare March 31, 2025 13:16
@rsebille rsebille added modifié Modifié dans le changelog. and removed ajouté Ajouté dans le changelog. labels Mar 31, 2025
@rsebille rsebille added this pull request to the merge queue Mar 31, 2025
Merged via the queue into master with commit d26cc10 Mar 31, 2025
14 checks passed
@rsebille rsebille deleted the tally-by-prescriber-type-tb-488 branch March 31, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

modifié Modifié dans le changelog. pilotage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants