Skip to content

Conversation

@robinnedergard
Copy link
Owner

@robinnedergard robinnedergard commented Dec 2, 2025

Note

Adds a protected, permission-based admin area (dashboard, product CRUD, order management), lazy-loaded with Suspense; batches product reviews and passes average ratings to cards.

  • Admin:
    • Protected Routes & Permissions: Introduce AdminProtectedRoute, usePermissions, and utils/permissions; show Admin link in header for authorized users.
    • Pages: Add AdminDashboardPage, AdminProductsPage (list/create/update/delete via ProductForm), and AdminOrdersPage (filter and update status).
    • GraphQL: Add admin product and checkout queries/mutations (GET_ADMIN_PRODUCTS, CREATE_PRODUCT, UPDATE_PRODUCT, DELETE_PRODUCT, GET_ADMIN_CHECKOUTS, UPDATE_CHECKOUT_STATUS).
  • Product Reviews:
    • Batch fetch product reviews with GET_REVIEWS_BY_PRODUCT_IDS, compute average ratings, and pass averageRating to ProductCard; remove rating from Product type.
  • Routing/UI:
    • Lazy-load admin pages in routes.tsx and wrap app routes in Suspense with LoadingState; minor layout spacing tweaks.
  • Tests:
    • Update useCart test data to align with Product type changes.

Written by Cursor Bugbot for commit f25aede. This will update automatically on new commits. Configure here.

@robinnedergard robinnedergard changed the title Admin page feat: admin page Dec 2, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 27

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@robinnedergard robinnedergard merged commit 2a731f1 into main Dec 2, 2025
6 checks passed
@robinnedergard robinnedergard deleted the admin-page branch December 2, 2025 10:34
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