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

Initial TemplateCategory client #1884

Merged
merged 15 commits into from
Jul 9, 2024
Merged

Conversation

whabanks
Copy link
Contributor

@whabanks whabanks commented Jul 2, 2024

Summary | Résumé

This PR implements the template_category_api_client, implementing the following functionality on the platform admin pages.

  • Get list of Categories
  • Get data for a single Category
  • Update a Category
  • Create a new Category

Related issues

Test instructions | Instructions pour tester la modification

  1. Navigate to the Template Categories platform admin page - Note that the three generic categories are present
  2. Click the New Category button - Fill out the form and create the category - Note you're taken back to the list of template categories page
  3. Select the category you just created - Note that the form is filled correctly with the data you input on step 2
  4. Edit one or a combination of: hidden, sms priority, email priority - Save the category
  5. Note that the new values are properly reflected in the category list table.

Copy link

github-actions bot commented Jul 2, 2024

whabanks and others added 2 commits July 5, 2024 12:01
- Implemented add and update a category
- Tweaks to the api client
- Added tests for the API client
- Renamed desc_en/desc_fr to description_en/fr for consistency
@whabanks whabanks marked this pull request as ready for review July 8, 2024 14:35
Copy link
Member

@andrewleith andrewleith left a comment

Choose a reason for hiding this comment

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

Looks good overall. One issue when trying to add a new category, and one cache issue when trying to update a category - both detailed below.

app/main/views/templates.py Outdated Show resolved Hide resolved
whabanks and others added 7 commits July 8, 2024 15:00
- Fixed desc_en/desc_fr -> description_en/description_fr typos
- Delete the template_categories key when updating a category
- Updated tests to check we are properly deleting Redis cache keys when updating a template
- Added mock to get all template categories
- Added template_category_json()
- Updated template_json() with a template_category param
- Sorted config keys under config.py
tests/conftest.py Fixed Show fixed Hide fixed
tests/app/main/views/test_templates.py Fixed Show fixed Hide fixed
tests/conftest.py Fixed Show fixed Hide fixed
@andrewleith andrewleith merged commit c878f83 into main Jul 9, 2024
9 checks passed
@andrewleith andrewleith deleted the feat/template-category-client branch July 9, 2024 17:07
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.

2 participants