Add Categories Admin
|Assignee:||Pavan Rikhi||% Done:|
|Target version:||v0.9.0 - Admin|
Show form along with preview of description.
Update Category Predecessor cache.
[#1540] Add Basic Admin UI & Category List Page
Add a client Route for the Categories admin page, as well as the
required data type, a command for fetching the data, and a rendering
function for the page.
Add admin views to the Header & Navigation modules for rendering the
basic UI of the admin site and modify the view function to show the
admin UI if an admin route is loaded.
[#1540] Add API Route for Creating Categories
Add an API route for Admin's to create new categories. A GET to the
route fetches the names & IDs of existing categories for the Parent
Images are passed in with base-64 encoding. The route decodes, saves,
scales, & optimizes them. When the operation is successful, it inserts
the Category into the database & returns the new Category's ID.
[#1540] Add Admin Page for Creating New Categories
Add an Admin Route & view/model/msg/update for creating new categories.
Move the Admin Category views to a separate module.
Add a textareaRow function to the Views.HorizontalForm module for rendering
Add a selectImageFile function to the Views.Utils module for generating
commands that prompt the user to select a supported image file.
[#1540] Add API Route for Editing Categories
Add a editCategoryDataRoute & editCategoryRoute to the Admin API for
fetching a Category's details & updating a Category's fields.
Refactor the makeImage function in the newCategoryRoute into a
makeImageFromBase64 function that is used in both the New & Edit routes.
Modify the NewCategoryParameters validation to ensure the order field is
zero or positive.
[#1540] Add Edit Category Page to Admin Site
Add a CategoryEdit route to the Admin routes for rendering a form
allowing Administrators to edit the details of a Category. Add GET &
PATCH commands for fetching a category's details & updatin them.
Add an Edit link to the categories table in the CategoryList admin page.
Show non-field errors in the New Category form.
Redirect admins to the Edit Category page after they successfully create
a new Category.
Refactor functions shared by the New & Edit pages into a Utils section
of the Categories.AdminViews module.