enhance: migrate admin dashboard list tables to Plugin UI DataViews#3192
enhance: migrate admin dashboard list tables to Plugin UI DataViews#3192MdAsifHossainNadim wants to merge 3 commits into
Conversation
Migrating admin tables from AdminDataViews wrapper to plugin-ui DataViews loses the wrapper's setLocaleData call. Lifting it to the Layout component ensures DataViews UI strings (Search, No items, pagination labels) remain translated for every admin Dashboard page registered via the dokan-admin-dashboard-routes filter. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…verrides Restores icon-in-popover pattern that @wordpress/dataviews drops by default when migrating to plugin-ui DataViews. Wrapping action labels in JSX with the corresponding lucide icon gives parity with the legacy AdminDataViews dropdown menu and bulk-action toolbar. Adds row min-height + bulk-action button border + pagination padding overrides for the new .pui-root-dataviews wrapper so admin tables match pre-migration visual rhythm. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Plugin UI's WordPress styles (background, radius) are scoped under .dokan-admin-dashboard-layout. The admin Layout component never added that class, so plugin-ui's defaults didn't apply to admin tables and the tabs/filter sat on the bare gray page background instead of the shared card with the table. Wraps the admin Dashboard Layout children in <div className="dokan-admin-dashboard-layout"> so plugin-ui scoped styles apply to every admin page (vendors, withdraw, refunds, …) — not just the dashboard page that already wrapped itself with the class. Companion CSS in style.scss promotes the .pui-root-dataviews wrapper to a white card with shadow + 10px radius and clears the duplicate card styling on the inner .dataviews-wrapper so we don't double-paint. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
All Submissions:
Changes proposed in this Pull Request:
This is the parent/coordination PR for migrating every admin (React) dashboard list table off the legacy
AdminDataViewswrapper (dokan/src/components/dataviews/AdminDataViewTable.tsx) and onto the unifiedDataViewscomponent re-exported from@dokan/components(sourced from@wedevs/plugin-ui) — the same component the vendor dashboard already uses since v5.Shared infrastructure landed on this branch:
getActionLabel()helper indokan/src/components/dataviews/getActionLabel.tsx— wraps icon + label JSX so@wordpress/dataviewsMenuItemTriggerand bulk-actionActionTriggerkeep rendering icons (the underlying components only renderaction.label, so icons must live inside the label callback).setLocaleData( getTranslatedStrings(), 'default' )lifted once into the admin DashboardLayout.tsx, so every migrated page picks up DataViews i18n without duplicating the call.dokan/src/components/dataviews/style.scss— restores the single white-card look (background, 10px radius, shadow), the 65px row rhythm, the bulk-action bar buttons with borders, and the pagination layout.Layout.tsxwraps children in a.dokan-admin-dashboard-layoutdiv so plugin-ui's WordPress-scoped CSS (:is(#dokan-vendor-dashboard-root, .dokan-admin-dashboard-layout, …) .pui-root-dataviews { … }) applies to every admin route — not just the dashboard root.Sub-PRs (one per page) target this branch and contain the per-page migration for each admin table.
Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
npm install && npm run build.view.status, search debounces, pagination works, every row action shows its icon + label, bulk actions appear with icons + borders, custom buttons (Export on Withdraw) still appear in the right spot.Changelog entry
Migrate admin dashboard list tables to Plugin UI DataViews
Replaces the legacy
AdminDataViewswrapper with the unifiedDataViewscomponent already used by the vendor dashboard. Adds shared infrastructure: agetActionLabelhelper that preserves row + bulk action icons, a singlesetLocaleDatacall in the admin Dashboard layout, scoped CSS overrides that restore the admin table polish (65px row rhythm, single white-card look, bulk-action bar, pagination), and a.dokan-admin-dashboard-layoutwrapper so plugin-ui's scoped WordPress styles apply on every admin route. Per-page migrations land via stacked sub-PRs.Before Changes
Admin tables used the in-house
AdminDataViewswrapper (dokan/src/components/dataviews/AdminDataViewTable.tsx), diverging from the vendor dashboard which already usesDataViewsfrom@wedevs/plugin-ui. Tabs, filter, and table did not share a unified card. Action icons relied on a JSX-wrapped label.After Changes
Admin tables now use the same
DataViewscomponent as the vendor dashboard. Tabs + filter + table render in a single white card on every admin page. Row + bulk action icons render via the dedicatediconprop wrapped throughgetActionLabel.Feature Video (optional)
n/a
PR Self Review Checklist:
getActionLabel,dokan-admin-dashboard-layout)..pui-root-dataviewsunder.dokan-admin-dashboard-datatable.FOR PR REVIEWER ONLY:
getActionLabelis a 7-line helper; SCSS overrides are commented.