-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YALB-1696: Hotfix: Can't configure Page title as Site admin (#547)
* fix(YALB-1696): guard against empty block_form Code was added in YALB-959 that attached javascript to specific block types: * tabs * quick_links * image_grids * media_gallery It referenced a block_form array that tells us which block type we are currently attempting to use. In some cases, though, like the heading block, this block_form array does not exist, resulting in a background error. This makes it look as if the user cannot modify the block. While block_form doesn't always exist, it seems that getting the blockInfo and looking at the args can tell you which block type we are dealing with. I'm hoping there's a more elegant way of doing this, but it does seem to be working for existing and new block elements. In some cases, the arguments dictate the type of block, and in others, it has a block_form object. We abstract this to just get it. * fix(YALB-1696): fallback js error to submit button In fixing the block_form issue, I noticed that when testing the functionality of YALB-959, there was an issue where paragraph items that weren't expanded couldn't display the error message to the user, and would error. It would not hinder the submissions of the form, so it would result in users being able to submit with one tab, for instance. This fix checks if the input that was found is visible, and if not, it appends the message to the submit button that we know is there, thus letting the form continue to submit or stop.
- Loading branch information
1 parent
eebfad2
commit d435f5b
Showing
2 changed files
with
98 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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 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