-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add password field #71545
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
Add password field #71545
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
7d5ae04 to
0aa6050
Compare
0aa6050 to
66d1b4b
Compare
|
Thanks for working on this @heavyweight. Could you also update the validation story here to include the |
| }, [] ); | ||
|
|
||
| return ( | ||
| <ValidatedInputControl |
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.
Can this use the utility/validated-text.tsx component instead? I understand it just needs to accept a suffix. It'd be great if the utility was renamed to utils/validated-input.tsx as well (we forgot to that recently).
| render: ( { item, field }: DataViewRenderFieldProps< any > ) => { | ||
| return field.elements | ||
| ? renderFromElements( { item, field } ) | ||
| : '•'.repeat( field.getValue( { item } ).length ); |
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.
Perhaps we can render a fixed number of dots instead of giving away the pass length?
| ? renderFromElements( { item, field } ) | ||
| : '•'.repeat( field.getValue( { item } ).length ); | ||
| }, | ||
| enableSorting: true, |
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.
Perhaps we should disable sorting by default, even though the field consumer can enable it.
| }, | ||
| enableSorting: true, | ||
| filterBy: { | ||
| defaultOperators: [ OPERATOR_IS_ANY, OPERATOR_IS_NONE ], |
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.
Same here, perhaps we shouldn't offer any filtering for password by default.
Co-authored-by: heavyweight <kpapazov@git.wordpress.org> Co-authored-by: oandregal <oandregal@git.wordpress.org>
|
👋 This show/hide button placement and variant doesn't match the standard password field patterns demonstrated in the
|
I will take a look at this 👍 |




What?
Adds a new
passwordfield type to the DataViews package with show/hide toggle functionality.Why?
DataViews currently lacks a dedicated password field type for handling sensitive data. This field type is essential for forms that need to collect and display passwords.
How?
Field Type Definition (
packages/dataviews/src/field-types/password.tsx):FieldTypeDefinitionwith proper validation•) based on password lengthForm Control (
packages/dataviews/src/dataform-controls/password.tsx):seen/unseenicons for intuitive user experienceStory Integration (
packages/dataviews/src/field-types/stories/index.story.tsx):Testing Instructions
npm run storybook:devScreenshots or screencast