Skip to content
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

Post: add protected post password field inline error and uncheck "Password protected" for empty field #64157

Open
ramonjd opened this issue Aug 1, 2024 · 2 comments · May be fixed by #67034
Labels
Needs Design Feedback Needs general design feedback. [Package] Edit Post /packages/edit-post [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@ramonjd
Copy link
Member

ramonjd commented Aug 1, 2024

What problem does this address?

A follow up on:

Context: #64156 (comment)

1. Add an inline error to warn about a 255+ char password

The protected post field in the database accepts a character count of up to 255.

Anything beyond that returns a server error.

#64155 limited character input to 255 characters.

Though it is an edge case, it might be useful to indicate to the user that such a password isn't allowed and has been truncated. @peterwilsoncc's idea that one.

2. Uncheck password protected when the password field is empty

When clearing a post password, the Pasword Protected checkbox remains open, even after saving the post.

This communicates that it's enabled, even though the password is empty and the password protection is disabled.

It might be useful to update the showPassword state when toggling the panel to uncheck it.

0411e662db3a7a7609847dd018095475.mp4

Example:

				<Dropdown
					className="editor-post-status"
					contentClassName="editor-change-status__content"
					popoverProps={ popoverProps }
					focusOnMount
					renderToggle={ ( { onToggle } ) => {
						const toggleStatusPanel = () => {
							onToggle();
							/*
							 * Reset password visibility
							 * if the password has been cleared.
							 */
							if ( ! password ) {
								setShowPassword( false );
							}
						};
...

What is your proposed solution?

@ramonjd ramonjd added [Type] Enhancement A suggestion for improvement. Needs Design Feedback Needs general design feedback. [Package] Edit Post /packages/edit-post labels Aug 1, 2024
@ramonjd
Copy link
Member Author

ramonjd commented Aug 1, 2024

@sarthaknagoshe2002
Copy link
Contributor

@ramonjd I have raise a PR for this issue could you please take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback. [Package] Edit Post /packages/edit-post [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
2 participants