Skip to content

Add admin edit buttons and improve shop catalog UX#335

Merged
ddon merged 3 commits intoBeamLabEU:devfrom
timujinne:dev
Feb 14, 2026
Merged

Add admin edit buttons and improve shop catalog UX#335
ddon merged 3 commits intoBeamLabEU:devfrom
timujinne:dev

Conversation

@timujinne
Copy link
Contributor

Summary

Add admin edit buttons to shop catalog pages for quick access to product/category editing from the frontend. Also includes email route fixes, code quality improvements, and enhanced shop category management.

Changes

Shop Catalog Improvements

  • Add "Edit Product" and "Edit Category" buttons to user dropdown menu when viewing as admin
  • Add admin_edit_url and admin_edit_label assigns to catalog pages
  • Improve shop category hierarchy and navigation
  • Add bulk operations support for categories (change status, change parent, delete)
  • Add category filtering in entities data navigator
  • Add MIM product images for surgical instruments catalog

Email Module Fixes

  • Fix inconsistent email templates route path
  • Rename /admin/modules/emails/templates to /admin/emails/templates
  • Update navigation links and internal references across email module

Code Quality

  • Refactor apply_filters in data_navigator.ex to reduce cyclomatic complexity (16→4)
  • Extract filter functions for better maintainability
  • Fix double Enum.reject to single reject with compound condition
  • Replace unless/else with if/else in bulk operation handlers
  • All Credo checks passing

Technical Details

  • 23 files changed, 1301 insertions, 164 deletions
  • Maintains compatibility with new registry-driven admin navigation system
  • URL format uses product.id/category.id for routes

Test Plan

  • Pre-commit checks passed (compilation, docs, Credo, Dialyzer)
  • Admin can see Edit buttons in product/category dropdown when logged in
  • Edit buttons navigate to correct admin pages
  • Email templates routes work correctly with new path
  • Category filtering works in entities data navigator
  • Bulk category operations work correctly
  • No breaking changes to existing functionality
  • Code follows PhoenixKit conventions

Screenshots

Admin edit buttons appear in user dropdown menu when viewing products/categories as admin, providing quick access to edit pages without leaving the frontend catalog view.

Rename /admin/modules/emails/templates to /admin/emails/templates
to match the convention used by all other email routes (/admin/emails/*).
Updated routes, navigation links, and internal references across 8 files.
Add "Edit Product" and "Edit Category" buttons to user dropdown menu
when viewing products/categories as admin on frontend.

Changes:
- Add admin_edit_url and admin_edit_label assigns to catalog_product.ex
- Add admin_edit_label assigns to catalog_category.ex
- Fix URL format to use product.id/category.id with /edit suffix
- Refactor apply_filters in data_navigator.ex to reduce cyclomatic complexity
- Extract filter functions (filter_by_entity, filter_by_status, filter_by_category, filter_by_search)
- Fix double Enum.reject to single reject with compound condition in entity_data.ex
- Replace unless/else with if/else in categories.ex bulk operations
- Add category filtering support in entities data navigator
- Improve shop category hierarchy and navigation
- Add MIM product images for surgical instruments catalog
Merge changes from BeamLabEU/phoenix_kit upstream/dev branch.

Key changes from upstream:
- Add registry-driven admin navigation system (replaces manual nav items)
- Add new admin_sidebar component for modular navigation
- Refactor invoice_detail.ex into submodules to fix slow compilation
- Add admin_tabs.ex for new tab system
- Update dashboard registry and documentation
- Prep for v1.7.36 release

Conflict resolution:
- Accepted upstream version of layout_wrapper.ex (use new admin_sidebar component)
- Replaced manual navigation (1600+ lines) with registry-driven approach (7 lines)

Upstream commits merged:
- a0b4506 Merge pull request BeamLabEU#334 from mdon/dev
- 5c3861a Fix Credo nested module alias warning in dashboard registry
- 5547184 Add registry-driven admin navigation system
- 31ac72a Prep for 1.7.36 release
- 936b560 Refactor invoice_detail.ex into submodules
@ddon ddon merged commit 525d094 into BeamLabEU:dev Feb 14, 2026
6 checks passed
ddon pushed a commit that referenced this pull request Feb 14, 2026
This adds a detailed comprehensive review that validates and builds upon
the existing AI_REVIEW.md and KIMI_REVIEW.md analyses of PR #335.

The review confirms all identified issues, provides additional technical
validation of SQL improvements and architecture decisions, and offers
prioritized recommendations for follow-up work.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
ddon pushed a commit that referenced this pull request Feb 14, 2026
timujinne added a commit to timujinne/phoenix_kit that referenced this pull request Feb 14, 2026
- Add Scope.admin? authorization checks to all 5 entity bulk action handlers
- Rewrite bulk_update_category to use single jsonb_set query instead of N updates
- Extract available_categories before category filter for correct dropdown display
- Fix admin_edit_url: product.id → product.uuid, add missing /edit suffix
- Replace silent rescue with Logger.warning in product_counts_by_category
ddon added a commit that referenced this pull request Feb 14, 2026
timujinne added a commit to timujinne/phoenix_kit that referenced this pull request Feb 15, 2026
- Add admin auth checks for single-record handlers in data_navigator
- Move require Logger to module level in shop.ex
- Filter only active products in category featured product dropdown
- Add recursive circular reference validation for category parents
- Prevent ancestor cycles in bulk category parent update
- Split load_categories into static data cache and filtered query
- Remove unused noop event handler and phx-click attributes
- Remove unused MIM demo images (8.2MB)
ddon added a commit that referenced this pull request Feb 15, 2026
Fix remaining review issues from PR #335 and #338
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