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
Fix #19792: raise error when tab RTE components are empty and prevent saving #20241
Fix #19792: raise error when tab RTE components are empty and prevent saving #20241
Conversation
Prevents user from saving when a component of a tab is empty, displaying an error message
Assigning @Lawful2002 for the first pass review of this PR. Thanks! |
@seanlip PTAL |
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.
Thanks @alice21mota! Left some notes.
Unassigning @seanlip since the review is done. |
Hi @alice21mota, it looks like some changes were requested on this pull request by @seanlip. PTAL. Thanks! |
dquote> change comment related to Value[0] in line 257 to be more specific dquote> replace tab with tabIndex dquote> make error messages more explicit for users dquote> fix tests to accomodate changes
dquote> change comment related to Value[0] in line 257 to be more specific dquote> replace tab with tabIndex dquote> make error messages more explicit for users dquote> fix tests to accomodate changes
change comment related to Value[0] in line 257 to be more specific replace tab with tabIndex make error messages more explicit for users fix tests to accomodate changes
Hi @seanlip PTAL! Screen.Recording.2024-05-03.at.19.02.08.mov |
Unassigning @alice21mota since a re-review was requested. @alice21mota, please make sure you have addressed all review comments. Thanks! |
Hi @seanlip! |
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.
Thanks @alice21mota. I think this looks good, just a few minor notes and it should be good to merge. Sorry for the delay, the past few days have been quite hectic.
Also, just a note -- please don't resolve review comments, let the reviewer do that. Otherwise the reviewer just has to open everything up again to check that the comments are addressed. Thanks!
@@ -356,21 +356,22 @@ describe('RteHelperModalComponent', () => { | |||
); | |||
expect(component.isErrorMessageNonempty()).toBe(true); | |||
expect(component.errorMessage).toBe( | |||
'Please ensure that each title and content are filled' | |||
'Please ensure that tab 1 title is filled.' |
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.
Please ensure that the title of tab 1 is filled
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.
Done!
component.customizationArgsForm.value[0][1].content = ''; | ||
component.onCustomizationArgsFormChange( | ||
component.customizationArgsForm.value | ||
); | ||
expect(component.isErrorMessageNonempty()).toBe(true); | ||
expect(component.errorMessage).toBe( | ||
'Please ensure that each title and content are filled' | ||
'Please ensure that tab 2 content is filled.' |
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.
Please ensure that the content of tab 2 is filled
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.
Done!
// Value[0] corresponds to tab Contents. | ||
for (let tab = 0; tab < value[0].length; tab++) { | ||
if (value[0][tab].title === '' || value[0][tab].content === '') { | ||
// Value[0] corresponds to all tabs Contents and titles. |
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.
all tab contents and titles.
(tabs --> tab; do not capitalize "Contents")
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.
Done!
Thank you for the notes @seanlip ! Will address and commit them shortly. |
5514e3d
to
7550dd5
Compare
Hi @seanlip ! Is it possible to re-run the checks? Many of them were cancelled after one failed, but I don´t believe it has anything to do with the changes I made. If not how should I proceed? |
@alice21mota Yup, this is a known flake (#19732). I'll re-run, thanks! In future, if you see an error, please search for it on GitHub and see if it's filed already. If so then reference it when asking for a re-run; if not, then either the issue is with your PR or a new issue should be filed. Thanks! |
Thank you @seanlip ! I believe the same thing occurred, not sure why. Will add the info to the existing issue. |
@alice21mota The new error is different, please follow the procedure I outlined above, thanks. |
7550dd5
to
4a6fe73
Compare
alter displayed messages when a tab component is not filled change corresponding tests accordingly fix comment typos
Hi @seanlip PTAL! |
Unassigning @alice21mota since a re-review was requested. @alice21mota, please make sure you have addressed all review comments. Thanks! |
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.
It looks good, thanks @alice21mota. Let's try to rerun this once #20287 is merged.
One note, can you please respond to the existing review comments (with "Done" if you've done them)? Let's follow the proper review process. Thanks!
Done! Thank you @seanlip ! |
@alice21mota I've merged develop into your branch. Let's see if it passes, if so we can merge this once @Lawful2002 reviews. @Lawful2002 could you please review for codeowners? Thanks. @alice21mota feel free to take up another issue in the meantime, if you like! |
Thank you @seanlip ! Will do :) |
Unassigning @Lawful2002 since they have already approved the PR. |
Hi @alice21mota, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks! |
Overview
Essential Checklist
Please follow the instructions for making a code change.
Proof that changes are correct
316467319-bb25deb9-9a37-425e-840c-7706a3a15229.mov
PR Pointers