feat(admin): migrate resource pages to shadcn DataTable/Dialog + toasts (#77)#83
Merged
Conversation
- Add @tanstack/react-table; build components/admin/data-table (DataTable,
column header, view options, filter select) driving server pagination via
existing { page, pages, total, limit }.
- Mount Sonner <Toaster> in the admin shell.
- Add AdminConfirmDialog on the Base UI Dialog primitive.
- Migrate reviews + users pages to DataTable + Select filters + row-action
dropdowns + parseApiError toasts, preserving all filters/search/guards.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Vendors: DataTable + status-filter Select + row-action dropdown of allowed transitions; AdminConfirmDialog with moderation-note Textarea; toasts. - Coupons: DataTable (client-side search/filter) + shadcn Dialog form with Select (type) and Switch (isActive); introduce admin_coupons i18n usage; AdminConfirmDialog delete; toasts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Orders list on DataTable with toolbar (search, status + payment Selects, date-range inputs, reset). Detail Modal -> shadcn Dialog; status-update native select -> Select, textarea -> Textarea; inline alerts -> toasts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Categories tree on DataTable (preserving indentation + parent-cycle guard); shadcn Dialog form with parent Select, image upload, SEO section, Switch; AdminConfirmDialog delete; toasts; introduce admin_categories i18n usage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Products list on DataTable with toolbar (debounced search, category/status/ stock Selects). Modal -> shadcn Dialog with Tabs (basic/pricing/images/ attributes/seo); native selects -> Select, checkboxes -> Switch, textareas -> Textarea; AdminConfirmDialog delete; parseApiError toasts. Preserves image upload queue, attribute/tag editors and low-stock warnings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tegories namespaces (az/en/ru) (#77)
…able tests (#77) - Rewrite reviews/users/vendors/orders page tests against the new DataTable/ Select/Dialog structure using lightweight mocks for the Base UI portal primitives; preserve all behavioral assertions (filters, search debounce, status transitions, admin guard, order status update + tracking). - Add components/admin/data-table/data-table.test.tsx (render/loading/empty/ error/search/pagination/sort). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
CI enforces 80% global coverage (v8). The DataTable-mock page tests exercised column cells but not headers, dropping function coverage. Cover column header render fns via the test double, add AdminConfirmDialog + fuller DataTable (toolbar/selection/row-click) tests, and add data-variation cases (vendor REJECTED/SUSPENDED, review/user fallbacks, order detail branches). Coverage: statements 86.4%, branches 81.3%, functions 84.3%, lines 87.8%. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #77.
Migrates all seven admin resource pages onto a shared, TanStack-based
DataTablewith the shadcn/Base UI shell primitives, replacing bespoke tables/modals/native inputs. No backend changes — all existing data hooks are used as-is.Foundation
@tanstack/react-table; build reusablecomponents/admin/data-table/—DataTable(server pagination via{ page, pages, total, limit }, client-side sort, column visibility, toolbar search + filter slot + reset, skeleton/empty/error states, optional row selection),DataTableColumnHeader,DataTableViewOptions,DataTableFilterSelect, and acreateSelectionColumnhelper.<Toaster>in the admin shell.AdminConfirmDialogon the Base UIDialogprimitive (replaces the Modal-based confirm; supports an embedded note field).Migrated pages
Select(type) +Switch(isActive), client filteringSelectAll success/error feedback now uses
parseApiError+ Sonner toasts.i18n
admin_coupons&admin_categoriesnamespaces acrossaz/en/ru(124 keys/locale).Tests & checks
DataTableunit tests.lint✅ · clienttest✅ (58 files / 414 tests) ·next build✅.PUT 200+ success toast.🤖 Generated with Claude Code