Feature #1540

Add Categories Admin

Added by Pavan Rikhi 4 months ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Pavan Rikhi% Done:

100%

Category:AdminSpent time:-
Target version:v0.9.0 - Admin
Easy Pickings:

Description

List/Add/Edit.

Show form along with preview of description.

Sanitize description!

Update Category Predecessor cache.

Associated revisions

Revision f3163d64
Added by Pavan Rikhi about 2 months ago

[#1540] Add API Route for Admin Categories Page

Add new modules for Admin routes, currently specifying a single route to
fetch minimal category information.

Add a withAdminCookie function to the Auth module to validate a Cookie &
ensure that the user is designated as an Administrator.

Refs #1540

Revision 7cae2fe6
Added by Pavan Rikhi about 2 months ago

[#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.

Refs #1540

Revision 6a85b90b
Added by Pavan Rikhi about 2 months ago

[#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
Category dropdown.

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.

Refs #1540

Revision 0d1a21af
Added by Pavan Rikhi about 2 months ago

[#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
textarea elements.

Add a selectImageFile function to the Views.Utils module for generating
commands that prompt the user to select a supported image file.

Refs #1540

Revision 7da16951
Added by Pavan Rikhi about 2 months ago

[#1540] Update the Cache When Creating a New Category

Refs #1540

Revision ad5e44dd
Added by Pavan Rikhi about 1 month ago

[#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.

Refs #1540

Revision 344f98d8
Added by Pavan Rikhi about 1 month ago

[#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.

Closes #1540

History

#1 Updated by Pavan Rikhi 4 months ago

  • Description updated (diff)

#2 Updated by Pavan Rikhi about 1 month ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

Also available in: Atom PDF