Skip to content

Refonte UI compte / habilitations#137

Draft
skelz0r wants to merge 14 commits into
developfrom
features/ui-compte-habilitations
Draft

Refonte UI compte / habilitations#137
skelz0r wants to merge 14 commits into
developfrom
features/ui-compte-habilitations

Conversation

@skelz0r

@skelz0r skelz0r commented May 20, 2026

Copy link
Copy Markdown
Member

No description provided.

@skelz0r
skelz0r force-pushed the features/ui-compte-habilitations branch from bb7f17c to b38e91d Compare June 18, 2026 09:16
skelz0r added 14 commits July 8, 2026 09:42
Replace the 4-column table (habilitation, token, actions, detail)
with a responsive grid of DSFR cards showing title, status badge,
DataPass reference and user role label.

- Switch eager loading from :active_token to
  :user_authorization_request_roles (fixes N+1 for role display)
- Filter roles in Ruby on the preloaded collection instead of
  hitting the DB per row
- Load @tokens (all tokens) in show action instead of @main_token
  + @other_tokens (preparation for show redesign)
- Rewrite index feature spec to match the new card-based UI
Remove mono-token-centric UI and redundant sections:
- Remove summary sidebar (sticky navigation)
- Remove scopes/access rights section (available on DataPass)
- Remove "main token" reveal/prolong/prolongation workflow
- Remove attestations download section
- Add prominent DataPass link button (fr-btn--lg)
- Replace token sections with a single table listing all tokens
  with actions: reveal, transfer and stats links
- Simplify contacts as an inline list with a DataPass edit link
- Keep delegations section unchanged

Adapt show spec and shared magic link spec to match new UI.
The viewable_by_users scope now filters out refused requests.
These are not actionable by users and add noise to the list.
Users can still see refused requests on DataPass directly.
Create a "Mairie de Nantes" authorization request (external_id 107)
where contact_technique@yopmail.com is the demandeur and
user@yopmail.com is only contact_technique. This allows testing
the UI from a non-demandeur perspective.

Also extract user creation into a dedicated create_users method
to keep perform under the method length limit.
DSFR renders the inner <table> as display:block, so it only spans the
width of its content instead of filling its container. This modifier
forces display:table at 100% width, keeps horizontal scroll on the
wrapper for small screens, and restores cell overflow so content such as
button labels is not clipped.
Apply fr-table--stretch to the tokens and delegations tables on the
authorization request show page so they span 100% as expected.

Fix the unclear token actions:
- the reveal button pointed at a missing i18n key
  (shared.authorization_requests.show.modal.show.display_cta), dropped
  during the show page redesign, so it rendered the humanized
  "Display cta"; add shared.tokens.reveal_token_button.cta and use it
  from the shared partial.
- the transfer button used fr-icon-share-line, which does not exist in
  this DSFR version and rendered as a solid blue square; switch to
  fr-icon-send-plane-line.
- DSFR collapses icon buttons to 2rem (icon-only) inside a
  fr-btns-group--sm unless the group declares fr-btns-group--icon-*; add
  fr-btns-group--icon-left so the labels stay visible.

Move the partial's fr-mt-2w spacing to the _detail_short caller so it no
longer misaligns the button when reused inside a table row.
Display the DataPass form (démarche) as a "Formulaire utilisé : <name>"
line below the title instead of a badge above it, where it read as a
disconnected tag. Drop the attachment icon and the redundant wrapper
divs, and simplify the "delivered at" line so the header markup is
flatter and easier to follow.
In the account area the listed items are authorization requests
(demandes), not granted habilitations; labelling them "Habilitation"
was confusing. Rename the user-facing wording to "demande" across the
index title, breadcrumb, status badges, table head and the contacts,
delegations, token prolongation and account transfer texts.

Left untouched on purpose: the public catalog "demande d'habilitation"
wording (the act of requesting an habilitation), the provider dashboard
which deliberately distinguishes "demandes et habilitations", and the
editor section where delegated habilitations are correctly named.
Show each piece of metadata on its own line at the same size: the
request number (previously inline after the delivery date), the form
used, the delivery date, and the description (when present). Bold the
labels via _html i18n keys so interpolated values stay HTML-escaped.

Drop the dead to_datapass branch (never passed as true; the dedicated
"Voir sur DataPass" CTA already links out) and its now-unused local.
Populate the description (finalité) of the seeded demandes with
realistic, varied wording inspired by production data, so the header's
new description line is exercised in development.
Add a dedicated contact_metier user (Camille Bernard) and attach it to
"Mairie de Lyon 2", which previously had only a demandeur and a contact
technique, so the contacts section shows the three roles. Document the
new dev-login test email.
Move the description right under the title, render it larger
(fr-text--lead) and drop the "Description :" label, so the purpose of the
demande reads at a glance. The remaining metadata lines stay small below
it. Remove the now-unused description_html i18n key.
The transfer view is already a main-modal turbo-frame, but the
"Transmettre" link navigated to it as a full page. Add the modal trigger
attributes (aria-controls, data-turbo-frame, data-fr-opened) so it opens
in place, consistent with the reveal token button.
"Demandes API Entreprise (4)" — the count adds nothing next to the
visible card grid. Remove it from the title and the now-unused count
interpolation.
@skelz0r
skelz0r force-pushed the features/ui-compte-habilitations branch from b38e91d to f511c7c Compare July 8, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant