Skip to content

✨ feat(form): ajout des interrupteurs au storybook de form - #1544

Open
keryanS wants to merge 1 commit into
mainfrom
feat/form-storybook-toggle
Open

keryanS wants to merge 1 commit into
mainfrom
feat/form-storybook-toggle

Conversation

@keryanS

@keryanS keryanS commented Sep 30, 2026

Copy link
Copy Markdown
Contributor
  • Dans la démo du formulaire, la propriété ElementType permet maintenant de choisir toggle

@keryanS keryanS added this to the 1.15.4 milestone Sep 30, 2026
@keryanS keryanS self-assigned this Sep 30, 2026
@keryanS keryanS added documentation Améliorations et ajouts à la documentation Prêt maj 1.15.0 labels Sep 30, 2026
@keryanS
keryanS requested a balanced review from Copilot September 30, 2026 14:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Repointing the shared fieldset-element.ejs toggle case to toggle.ejs breaks the existing Toggle-Group storybook and example samples that rely on the toggle-group template.

Review effort: Balanced
Findings: 1 High severity

Open (1)
What changed in this PR

This PR adds the "toggle" (interrupteur) element type to the DSFR form Storybook demo, so the form fieldset story can render toggles alongside the existing input/radio/checkbox types. It also refines two French argType descriptions and repoints the shared fieldset toggle branch to the single-toggle template.

Changes:

  • Register toggle as a selectable elementsType in the form story, with matching togglesData, default args, and switch handling in formProps.
  • Improve French descriptions (checkboxes → cases à cocher, radios → boutons radios, add interrupteurs).
  • Change the shared fieldset-element.ejs case 'toggle' include path from toggle-group to toggle.
File Description
src/​dsfr/​component/​form/​template/​stories/​form-arg-types.js Wires toggle into the form story: options, togglesData argType/args, choice flag, and formProps switch case.
src/​dsfr/​component/​form/​template/​ejs/​fieldset/​fieldset-element.ejs Repoints the shared toggle case to the single-toggle template, which regresses existing toggle-group consumers.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


case 'toggle':
path = '../../../../toggle/template/ejs/toggle-group';
path = '../../../../toggle/template/ejs/toggle';
@keryanS keryanS linked an issue Oct 1, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Améliorations et ajouts à la documentation maj 1.15.0 Prêt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ajout option Demo formulaire

2 participants