Wordpress-android: Post Password Dialog : Input validation required

Created on 6 May 2020  路  4Comments  路  Source: wordpress-mobile/WordPress-Android

Expected behavior

That the password dialog should have input validation and empty spaces and such forth shouldn't allow it to be submitted.

Actual behavior

It has no input validation so you are able to set empty spaces as a password.

Steps to reproduce the behavior

  1. Create a new post.
  2. Go to Post Settings.
  3. Click on the field and add an empty password.
  4. Once you press okay you will see the empty password below the Password title.

Link to video https://drive.google.com/open?id=1A3lTcgO9MQAFmVa7heDq2XztIlO9hmMa

Tested on Google Pixel 4 XL, Android 10, WPAndroid develop ()

Post Settings [Type] Bug good first issue

Most helpful comment

Hi @jd-alexander

Thanks for assigning this issue. Here's how I intend to resolve this:

If the password is blank,

  1. Show a toast to user.
  2. Ignore blank password for post with no passwords, remove previous password if present.

The password check will go in here:
https://github.com/wordpress-mobile/WordPress-Android/blob/a5623c4262a7fd062053161246ec1ea52caf0da6/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java#L745-L758

Does this sound ok?

Alternatively I could update the PostSettingsInputDialogFragment to validate input and show error messages inline. However, that dialog is shared for other input fields, so not sure if it's a good idea.

Cheers!

Adi

All 4 comments

Hi @jd-alexander , if no one's working on this issue, I'll pick it up.

Cheers!

Adi

@adityabhaskar yes, please go ahead 馃槃 If you have any questions, I am more than happy to help 馃檹

Hi @jd-alexander

Thanks for assigning this issue. Here's how I intend to resolve this:

If the password is blank,

  1. Show a toast to user.
  2. Ignore blank password for post with no passwords, remove previous password if present.

The password check will go in here:
https://github.com/wordpress-mobile/WordPress-Android/blob/a5623c4262a7fd062053161246ec1ea52caf0da6/WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostSettingsFragment.java#L745-L758

Does this sound ok?

Alternatively I could update the PostSettingsInputDialogFragment to validate input and show error messages inline. However, that dialog is shared for other input fields, so not sure if it's a good idea.

Cheers!

Adi

Thanks for tackling this @adityabhaskar I did a review of your PR. Let me know your thoughts 馃槃

Was this page helpful?
0 / 5 - 0 ratings