Skip to content

Prescripteur : ajout d'une page "Présentation" pour l'organisation des prescripteurs habilités et d'une entrée dans le menu latéral#6060

Merged
EwenKorr merged 5 commits into
masterfrom
deloo/add-overview-prescribers-page
May 16, 2025
Merged

Prescripteur : ajout d'une page "Présentation" pour l'organisation des prescripteurs habilités et d'une entrée dans le menu latéral#6060
EwenKorr merged 5 commits into
masterfrom
deloo/add-overview-prescribers-page

Conversation

@hellodeloo

@hellodeloo hellodeloo commented Apr 28, 2025

Copy link
Copy Markdown
Contributor

🤔 Pourquoi ?

Tous comme les employeurs, les prescripteurs et les orienteurs doivent avoir accès à une page de présentation de leur organisation pour avoir une vue d’ensemble et accéder à certaines actions qui vont disparaitre de l’accueil

@hellodeloo hellodeloo added the ajouté Ajouté dans le changelog. label Apr 28, 2025
@hellodeloo hellodeloo self-assigned this Apr 28, 2025
@notion-workspace

Copy link
Copy Markdown

@hellodeloo hellodeloo changed the title feat: add overview page for prescribers feat: ajout d'une page "presentation" pour l'organisation des prescripteurs habilités et orienteurs Apr 28, 2025
@hellodeloo hellodeloo changed the title feat: ajout d'une page "presentation" pour l'organisation des prescripteurs habilités et orienteurs Prescripteur: ajout d'une page "presentation" pour l'organisation des prescripteurs habilités et orienteurs Apr 28, 2025

@francoisfreitag francoisfreitag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

En dehors du souci de permission, la page me semble bien fonctionner et être présente dans les menus comme souhaité 👍

Je ne vois pas le bouton « Voir la fiche publique » de la maquette ?

Comment thread itou/templates/prescribers/members.html Outdated
Comment thread itou/templates/prescribers/overview.html Outdated
Comment thread itou/templates/prescribers/overview.html Outdated
Comment thread itou/www/prescribers_views/views.py
@EwenKorr

EwenKorr commented Apr 29, 2025

Copy link
Copy Markdown
Contributor

Je ne vois pas le bouton « Voir la fiche publique » de la maquette ?

Il est actuellement conditionné à l'habilitation de l'organisation (il n'y a que les prescripteurs habilités qu'on peut trouver dans la recherche prescripteur).

Comme ça par exemple :

diff --git a/itou/prescribers/models.py b/itou/prescribers/models.py
index f09dc9c90..b693242e2 100644
--- a/itou/prescribers/models.py
+++ b/itou/prescribers/models.py
@@ -270,8 +270,6 @@ class PrescriberOrganization(AddressMixin, OrganizationAbstract):
         return get_tally_form_url("w2EoDp", **kwargs)

     def get_card_url(self):
-        if not self.is_authorized:
-            return None
         return reverse("prescribers_views:card", kwargs={"org_id": self.pk})

     def has_refused_authorization(self):
diff --git a/itou/templates/prescribers/card.html b/itou/templates/prescribers/card.html
index 8703bb384..8b1bbb5e1 100644
--- a/itou/templates/prescribers/card.html
+++ b/itou/templates/prescribers/card.html
@@ -13,7 +13,7 @@
 {% block title_content %}
     {% component_title c_title__main=c_title__main c_title__secondary=c_title__secondary %}
         {% fragment as c_title__main %}
-            <h1>Prescripteur habilité</h1>
+           <h1>Prescripteur{% if prescriber_org.is_authorized %}  habilité{% endif %}</h1>
         {% endfragment %}
         {% fragment as c_title__secondary %}
             <h2>{{ prescriber_org.get_kind_display }} - {{ prescriber_org.name }}</h2>
diff --git a/itou/www/prescribers_views/views.py b/itou/www/prescribers_views/views.py
index de1b405c3..f6d3bc55b 100644
--- a/itou/www/prescribers_views/views.py
+++ b/itou/www/prescribers_views/views.py
@@ -22,7 +22,6 @@ def card(request, org_id, template_name="prescribers/card.html"):
     prescriber_org = get_object_or_404(
         PrescriberOrganization,
         pk=org_id,
-        authorization_status=PrescriberAuthorizationStatus.VALIDATED,
     )
     back_url = get_safe_url(request, "back_url")
     context = {

Tu aurais besoin d'aide pour les tests de permission David ?

@francoisfreitag

Copy link
Copy Markdown
Member

Je ne vois pas le bouton « Voir la fiche publique » de la maquette ?

Il est actuellement conditionné à l'habilitation de l'organisation (il n'y a que les prescripteurs habilités qu'on peut trouver dans la recherche prescripteur).

Bien vu, j’aurais du chercher la chaîne de caractères dans le HTML au lieu de me fier à mes yeux haha.

@hellodeloo hellodeloo force-pushed the deloo/add-overview-prescribers-page branch 2 times, most recently from 6d4a13c to 8891b73 Compare April 30, 2025 09:45
@hellodeloo hellodeloo added the 1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC label Apr 30, 2025
@github-actions

Copy link
Copy Markdown

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

@hellodeloo hellodeloo force-pushed the deloo/add-overview-prescribers-page branch 2 times, most recently from 8a6deca to 9051456 Compare April 30, 2025 14:35
@EwenKorr EwenKorr force-pushed the deloo/add-overview-prescribers-page branch 2 times, most recently from d051d74 to 641ab4a Compare May 2, 2025 13:10
@EwenKorr

EwenKorr commented May 2, 2025

Copy link
Copy Markdown
Contributor

J'ai rajouté des permissions et des tests.
Il faudra voir les commits qu'on squashe.

@EwenKorr EwenKorr force-pushed the deloo/add-overview-prescribers-page branch 6 times, most recently from 63fc1bd to 6b30840 Compare May 5, 2025 13:52
{% endif %}
</div>
<div class="col-12 col-lg-4 order-1 order-lg-2">
{% include "companies/includes/_company_info.html" with company=organization show=True show_cta=False extra_box_class="mb-3 mb-lg-5" %}

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.

On inclut ici un bout d'HTML de companies.
Mon cœur balance entre séparer les entreprises des prescripteurs, et le principe DRY.
Un avis ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Peut-être un renommage pour déplacer ce fragment vers un emplacement plus générique ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Je propose toujours un déplacement ici, pour mieux indiquer que le fragment fonctionne aussi avec les organisations.

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.

Ah oui !
Je ferai ça dans une PR à côté, je me note ça.

@EwenKorr EwenKorr requested a review from francoisfreitag May 5, 2025 13:56
@hellodeloo hellodeloo requested a review from EwenKorr May 5, 2025 13:59

@francoisfreitag francoisfreitag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

En me connectant en tant qu’orienteur membre d’une orga, j’ai dans la console:

Uncaught TypeError: can't access property "focus", thisElToFocus is null
    focusAndScrollTo http://localhost:8000/prescribers/overview:744
    <anonymous> http://localhost:8000/prescribers/overview:750

Le texte de présentation ne s’affiche également pas chez moi (ni chromium, ni firefox)

Comment thread itou/templates/prescribers/overview.html Outdated
Comment thread itou/templates/prescribers/overview.html Outdated
{% endif %}
</div>
<div class="col-12 col-lg-4 order-1 order-lg-2">
{% include "companies/includes/_company_info.html" with company=organization show=True show_cta=False extra_box_class="mb-3 mb-lg-5" %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Peut-être un renommage pour déplacer ce fragment vers un emplacement plus générique ?

Comment thread tests/www/prescribers_views/__snapshots__/test_edit.ambr
Comment thread tests/www/prescribers_views/test_overview.py
Comment thread tests/www/prescribers_views/test_overview.py Outdated
@EwenKorr

EwenKorr commented May 5, 2025

Copy link
Copy Markdown
Contributor

En me connectant en tant qu’orienteur membre d’une orga, j’ai dans la console:

Uncaught TypeError: can't access property "focus", thisElToFocus is null
    focusAndScrollTo http://localhost:8000/prescribers/overview:744
    <anonymous> http://localhost:8000/prescribers/overview:750

C'est le cas partout, y compris actuellement en production ? @hellodeloo, une idée ?

Le texte de présentation ne s’affiche également pas chez moi (ni chromium, ni firefox)

C'est voulu 🤷
https://gip-inclusion.slack.com/archives/CU8ATF54L/p1746438370497209?thread_ts=1746008376.030279&cid=CU8ATF54L

@EwenKorr EwenKorr force-pushed the deloo/add-overview-prescribers-page branch 2 times, most recently from fbc77b6 to 997c499 Compare May 9, 2025 10:22
@francoisfreitag francoisfreitag changed the title Prescripteur: ajout d'une page "presentation" pour l'organisation des prescripteurs habilités et orienteurs Prescripteur: ajout d'une page "presentation" pour l'organisation des prescripteurs habilités May 12, 2025

@francoisfreitag francoisfreitag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Idéalement, prescribers: better display organization kind for France Travail pourrait sortir dans une autre PR plutôt que de rester dans la PR intitulée « ajout d'une page "presentation" pour l'organisation des prescripteurs habilités »

{% bootstrap_field form.description %}

{% itou_buttons_form primary_label="Enregistrer" primary_aria_label="Enregistrer la modification" %}
{% if organization.kind != PrescriberOrganizationKind.FT %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

On pourrait centraliser cette logique dans le formulaire, via un attribut (nommé readonly ?). On a déjà

if self.instance.kind == PrescriberOrganizationKind.FT:

L’attribut aurait idéalement un petit commentaire qui explique pourquoi FT est traité en lecture seule (les collaborateurs changeant d’agence éditaient souvent leur ancienne organisation avec les infos de leur nouvelle agence, faisant un beau micmac), et on aurait ainsi un lien entre les champs désactivés et les boutons masqués.

@EwenKorr EwenKorr May 12, 2025

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.

Bonne idée, de lier la désactivation des champs et le masquage des boutons, je fais ça.

Pour le commentaire : il est déjà là non ?

# PE users often mistakenly edit this page, to the point where the
# support asked to disable it, and have them reach out in case of
# changes.

(et j'imagine que ce commit aurait mieux été dans une PR séparée aussi 😬)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Le commentaire est effectivement déjà là 🙈.

(oui, le commit aurait aussi été mieux dans une PR séparée 🙂. Après, on est quand même proche de la fin sur celle ci, donc comme tu préfères.)

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.

Je vais laisser ce commit là-dedans et je tâcherai de songer plus tôt à extraire des commits par la suite (notamment à la reprise d'une PR de quelqu'un d'autre :D)

Comment thread itou/templates/prescribers/overview.html Outdated
Comment thread itou/templates/prescribers/overview.html Outdated
Comment thread itou/templates/prescribers/overview.html Outdated
Comment thread itou/templates/prescribers/overview.html Outdated
Comment thread itou/utils/templatetags/nav.py Outdated
Comment thread tests/www/prescribers_views/test_overview.py
Comment thread tests/www/prescribers_views/test_overview.py Outdated
Comment thread tests/www/prescribers_views/test_edit.py
Comment thread itou/www/prescribers_views/forms.py Outdated
@EwenKorr

EwenKorr commented May 12, 2025

Copy link
Copy Markdown
Contributor

Idéalement, prescribers: better display organization kind for France Travail pourrait sortir dans une autre PR plutôt que de rester dans la PR intitulée « ajout d'une page "presentation" pour l'organisation des prescripteurs habilités »

Oui, c'est sûr !
#6110
(ça permet de découper encore mieux, il y avait une amélioration de @hellodeloo sur le composant à intégrer aussi, un <h2> à passer en <p> en gros)

@EwenKorr EwenKorr force-pushed the deloo/add-overview-prescribers-page branch 2 times, most recently from cbf290f to 350e203 Compare May 12, 2025 13:55
{% endif %}
</div>
<div class="col-12 col-lg-4 order-1 order-lg-2">
{% include "companies/includes/_company_info.html" with company=organization show=True show_cta=False extra_box_class="mb-3 mb-lg-5" %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Je propose toujours un déplacement ici, pour mieux indiquer que le fragment fonctionne aussi avec les organisations.

@EwenKorr EwenKorr force-pushed the deloo/add-overview-prescribers-page branch 4 times, most recently from ec32e12 to a0641e0 Compare May 15, 2025 12:05
@EwenKorr

Copy link
Copy Markdown
Contributor

Dernière petite modif : pour les prescripteurs non habilités, au lieu d'afficher dans le menu latéral seulement "Collaborateurs", on affiche "Modifier les informations" (pour que ça corresponde au bloc du dashboard)

@francoisfreitag

Copy link
Copy Markdown
Member

Je ne vois pas le commit correspondant et la recette jetable ne semble pas à jour (connecté à la belle verte).

@EwenKorr

Copy link
Copy Markdown
Contributor

J'ai fait un commit fixup : fixup! add "edit" link for unauthorized orgs in side menu

En recette effectivement, ce n'est pas à jour (à cause des conflits ? Je vais résoudre ça)

@EwenKorr EwenKorr force-pushed the deloo/add-overview-prescribers-page branch from a0641e0 to e700038 Compare May 15, 2025 12:54

@francoisfreitag francoisfreitag left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Passé trop vite, j’ai vu le fixup et je me suis dit que c’était le même que lors de la dernière relecture 🙈

Le fixup me semble très bien.

@EwenKorr

Copy link
Copy Markdown
Contributor

Merci ! La recette a été redéployée, ce devait être à cause du conflit.

@EwenKorr EwenKorr force-pushed the deloo/add-overview-prescribers-page branch from e700038 to c7fc535 Compare May 16, 2025 06:34
@EwenKorr EwenKorr changed the title Prescripteur: ajout d'une page "presentation" pour l'organisation des prescripteurs habilités Prescripteur : ajout d'une page "Présentation" pour l'organisation des prescripteurs habilités et d'une entrée dans le menu latéral May 16, 2025
@EwenKorr EwenKorr added this pull request to the merge queue May 16, 2025
Merged via the queue into master with commit d6956ac May 16, 2025
@EwenKorr EwenKorr deleted the deloo/add-overview-prescribers-page branch May 16, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1-recette-jetable [Payé à l’heure] Crée une recette jetable sur CC ajouté Ajouté dans le changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants