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

[7644] Add product category validation #7997

Merged
merged 9 commits into from
Dec 15, 2021

Conversation

richbrennan
Copy link
Contributor

@richbrennan richbrennan commented Dec 9, 2021

Closes #7644 and #7772

Adds validation to avoid:

  • Categories with the same name
  • Category being a descendent of itself
  • Categories being nested too deep

Link to sample test page: https://foundation-s-feature-76-cx7ws7.herokuapp.com/cms/snippets/wagtailpages/buyersguideproductcategory/

Review site password: https://mozilla.slack.com/archives/CBKP2SG94/p1639070578008300

To test, go to the page above and try the following:

  • Creating or editing a category to have the same name as an existing one
  • Making a category a descendent of itself by setting it to be its own parent or a child of one if it's children
  • Creating categories more than 2 levels deep

Checklist

Tests

  • Is the code I'm adding covered by tests?

@mofodevops mofodevops temporarily deployed to foundation-s-feature-76-cx7ws7 December 9, 2021 17:10 Inactive
@mofodevops mofodevops temporarily deployed to foundation-s-feature-76-cx7ws7 December 13, 2021 12:41 Inactive
@mofodevops mofodevops had a problem deploying to foundation-s-feature-76-cx7ws7 December 13, 2021 14:56 Failure
@mofodevops mofodevops temporarily deployed to foundation-s-feature-76-cx7ws7 December 13, 2021 14:57 Inactive
@mofodevops mofodevops temporarily deployed to foundation-s-feature-76-cx7ws7 December 13, 2021 16:59 Inactive
@richbrennan richbrennan changed the title [7644] add start of product category validation [7644] Add product category validation Dec 13, 2021
@richbrennan richbrennan marked this pull request as ready for review December 13, 2021 17:30
@mofodevops mofodevops temporarily deployed to foundation-s-feature-76-cx7ws7 December 13, 2021 17:30 Inactive
network-api/networkapi/wagtailpages/forms.py Outdated Show resolved Hide resolved
network-api/networkapi/wagtailpages/pagemodels/products.py Outdated Show resolved Hide resolved
network-api/networkapi/wagtailpages/forms.py Outdated Show resolved Hide resolved
@mofodevops mofodevops temporarily deployed to foundation-s-feature-76-cx7ws7 December 14, 2021 14:39 Inactive
@mofodevops mofodevops temporarily deployed to foundation-s-feature-76-cx7ws7 December 14, 2021 15:21 Inactive
@Pomax Pomax merged commit 1373376 into main Dec 15, 2021
@Pomax Pomax deleted the feature/7644-product-category-validation branch December 15, 2021 17:28
This pull request was closed.
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.

[PNI] - Subcategories - harden the subcategory form/save logic
3 participants