-
Notifications
You must be signed in to change notification settings - Fork 192
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
Refactor: update Honorific block to only accept labels and add field validation #7564
Conversation
…on rules to only accept options
@jonwaldstein I noticed the build settings are not persisting properly after you refresh the page. It looks like the options state is being updated from a I confirmed this is currently an issue in develop as well but could be fixed with a conditional if you would like to include that in this PR since its relative to this setting. Otherwise I can open a new one. Heres a short video of the bug: . Screen.Recording.2024-10-04.at.2.55.27.PM.mov |
$group->getNodeByName('honorific') | ||
->label('Title') | ||
->options(...array_values($block->getAttribute('honorifics'))); | ||
$options = array_values((array)$block->getAttribute('honorifics')); |
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.
Should we check for empty strings when passing the options? I found you can add an empty option and it will display. Not a big deal i'm not sure why someone would add a label and not fill it out but it's just something I noticed.
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.
nice catch! resolved f3eed61
@JoshuaHungDinh this is ready for re-review. Also fixed those options not persisting 74de009 I think there are further improvements we can make here but this should be good for now. |
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.
Awesome, this should be good to go!
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.
Awesome, this should be good to go!
…al options in block attributes
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.
Pass manual QA tests.
Resolves GIVE-1292
Description
I noticed the honorific block was offering to "show values", except it didn't actually do anything with the values. Since honorifics are both a value and label, also used in global settings I decided to remove the option for showing values.
Furthermore, extra field validation was added to only accept the available select options.
Affects
The honorific block & field
Visuals
The problem discovery
https://www.loom.com/share/1ae99a62f60a4e96b47d00f394de0681?sid=79a84b4c-427e-4b0d-9f99-44d684b6f0bb
The fix
https://www.loom.com/share/0bc214e053b64e458a4bea57a5454d0f?sid=28e23e37-1510-4f56-9edf-248cb884f2bf
Testing Instructions
Pre-review Checklist
@unreleased
tags included in DocBlocks