-
Notifications
You must be signed in to change notification settings - Fork 58
[OUDS] Manage mandatory fields indication #3439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
hannahiss
wants to merge
18
commits into
ouds/main
Choose a base branch
from
ouds/main-his-mandatory-fields
base: ouds/main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 14 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
60caefd
Mandatory fields indication
hannahiss 014a5c1
Fix typo
hannahiss 5c94c28
Text input mandatory indication
hannahiss cf5670f
Merge branch 'ouds/main' into ouds/main-his-mandatory-fields
hannahiss df51fca
Fix ids
hannahiss e403074
Update site/src/content/docs/foundation/form-validation.mdx
hannahiss 0ece7fd
Update site/src/content/docs/foundation/form-validation.mdx
hannahiss bb1ef89
Merge branch 'ouds/main' into ouds/main-his-mandatory-fields
hannahiss 400d17e
Update padding for overflowed label + shortcode
hannahiss e61898d
Examples +scss on each form component
hannahiss ea11036
ids
hannahiss 0178468
Merge branch 'ouds/main' into ouds/main-his-mandatory-fields
hannahiss 1251127
Merge branch 'ouds/main' into ouds/main-his-mandatory-fields
hannahiss 0afcb5e
Merge branch 'ouds/main' into ouds/main-his-mandatory-fields
hannahiss 5a5b9a5
Merge branch 'ouds/main' into ouds/main-his-mandatory-fields
hannahiss d80743c
Fixes after Max's review
hannahiss 85f4c9a
Merge branch 'ouds/main' into ouds/main-his-mandatory-fields
hannahiss f63d4f5
Remove test examples with different combinations of labels
hannahiss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,19 @@ | |
|
|
||
| .is-required::after { | ||
| position: absolute; | ||
| margin-left: $form-label-required-margin-left; | ||
| color: $form-label-required-color; | ||
| //right: 0; | ||
MaxLardenois marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| margin-left: 4px; | ||
| font-weight: $ouds-font-weight-system-web-strong; | ||
| color: $ouds-color-content-status-negative; | ||
| content: "*"; | ||
| } | ||
|
|
||
| .is-required2::after { | ||
MaxLardenois marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| position: absolute; | ||
| //right: 0; | ||
| margin-left: 4px; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we/did you ask for tokens for this?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I asked for it in Figma |
||
| font-weight: $ouds-font-weight-system-web-strong; | ||
| color: $ouds-color-content-status-negative; | ||
| content: "*"; | ||
| } | ||
|
|
||
|
|
||
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
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
27 changes: 27 additions & 0 deletions
27
site/src/components/shortcodes/MandatoryFieldIndication.astro
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| /* | ||
| * Outputs mandatory fields indication | ||
| */ | ||
|
|
||
| import {getConfig} from "@libs/config.ts"; | ||
| interface Props { | ||
| /** | ||
| * The component name that should be displayed. | ||
| */ | ||
| componentName?: string | ||
|
|
||
| } | ||
|
|
||
| import { getVersionedDocsPath } from '@libs/path' | ||
|
|
||
| const { componentName } = Astro.props | ||
|
|
||
| const name = (componentName ? componentName.toLowerCase() : "") | ||
|
|
||
| const link = (componentName ? `https://r.orange.fr/r/S-ouds-doc-${componentName.replace(" ", "-")}` : "") | ||
|
|
||
| --- | ||
|
|
||
| <p>To indicate that a {name} is mandatory in a form, add the class <code>.is-required</code> to display a red asterisk at the end of the label.</p> | ||
|
|
||
| <p>For general rules about when to add mandatory fields indication, please refer to the <a href={link}>{name} design guidelines</a> and to the <a href={getVersionedDocsPath('/foundation/form-validation#mandatory-fields-indication')}>form validation documentation</a>. In particular, do not forget to handle error messages.</p> |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should put the is-required common css elsewhere as the content of this file is mostly Bootstrap... Idk where though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked myself the question... We can still change that later