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

Add validation to select either topic or tag in Recent Blog Entries #12456

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

AdalbertoMoz
Copy link
Contributor

@AdalbertoMoz AdalbertoMoz commented Jun 7, 2024

Description

The following changes attend two validations related to the recent_blog_entries.py file:

  • A Tag or a Topic must be selected; otherwise, raise an error.
  • If both Tag and Topic are selected, raise an error as well.

Also, some improvement-changes were made to improve readability.

Link to sample test page: https://foundation-s-feature-88-ev6doo.herokuapp.com/
Related PRs/issues: #8832

To Test

  1. Go to the Review App Blog Index Page

  2. Try to add a Recent Blog Entry, for example, inside the Mozilla Festival Page (inside of the Body)
    image

  3. Try to save the document in the following scenarios:

    Condition Error Message
    Neither Tag nor Topic is selected Raise a required error
    Both Tag and Topic are selected Raise an invalid error
    Only one is selected No errors, show the filtered blogs

Required error:

image

Invalid error:

image

Checklist

Tests
- [ ] Is the code I'm adding covered by tests?

Changes in Models:
- [ ] Did I update or add new fake data?
- [ ] Did I squash my migration?
- [ ] Are my changes backward-compatible. If not, did I schedule a deploy with the rest of the team?

Documentation:
- [ ] Is my code documented?
- [ ] Did I update the READMEs or wagtail documentation?

Merge Method
💡❗Remember to use squash merge when merging non-feature branches into main

┆Issue is synchronized with this Jira Story

@AdalbertoMoz AdalbertoMoz self-assigned this Jun 7, 2024
@AdalbertoMoz AdalbertoMoz temporarily deployed to foundation-s-feature-88-ev6doo June 7, 2024 20:56 Inactive
@AdalbertoMoz AdalbertoMoz force-pushed the feature/8832-topic-and-tag-validation branch from f3610a1 to 04b8d84 Compare June 10, 2024 21:31
@AdalbertoMoz AdalbertoMoz temporarily deployed to foundation-s-feature-88-ev6doo June 10, 2024 21:31 Inactive
Copy link
Collaborator

@danielfmiranda danielfmiranda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work! LGTM 🚀

@AdalbertoMoz AdalbertoMoz merged commit 867114a into main Jun 10, 2024
6 checks passed
@AdalbertoMoz AdalbertoMoz deleted the feature/8832-topic-and-tag-validation branch June 10, 2024 22:43
@data-sync-user
Copy link
Collaborator

➤ Simon Acosta Torres commented:

PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants