Repository navigation
Conversation
keryanS
commented
Sep 30, 2026
Contributor
- Dans la démo du formulaire, la propriété ElementType permet maintenant de choisir toggle
There was a problem hiding this comment.
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
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
toggleas a selectableelementsTypein the form story, with matchingtogglesData, default args, and switch handling informProps. - Improve French descriptions (
checkboxes→cases à cocher,radios→boutons radios, addinterrupteurs). - Change the shared
fieldset-element.ejscase 'toggle'include path fromtoggle-grouptotoggle.
| 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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
