Skip to content

enhance: migrate admin Reverse Withdrawal tables to Plugin UI DataViews#3194

Open
MdAsifHossainNadim wants to merge 5 commits into
enhance/update-admin-dashboard-list-tables-using-plugin-uifrom
enhance/update-admin-dashboard-reverse-withdrawal-list-tables
Open

enhance: migrate admin Reverse Withdrawal tables to Plugin UI DataViews#3194
MdAsifHossainNadim wants to merge 5 commits into
enhance/update-admin-dashboard-list-tables-using-plugin-uifrom
enhance/update-admin-dashboard-reverse-withdrawal-list-tables

Conversation

@MdAsifHossainNadim

Copy link
Copy Markdown
Contributor

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Migrates both admin Reverse Withdrawal tables to the unified DataViews component re-exported from @dokan/components:

  • dokan/src/admin/dashboard/pages/reverse-withdrawal/index.tsx — main reverse-withdrawal list.
  • dokan/src/admin/dashboard/pages/reverse-withdrawal/ReverseWithdrawalTransaction.tsx — drill-down transactions table.

Per page:

  • Drops the AdminDataViews as DataViews alias in favour of the direct DataViews import.
  • Status state lives in view.status (no separate activeTab mirror).
  • Tabs reshape: { tabs: [{ name, title, icon }] }{ items: [{ value, label, count }] }.
  • Removes the stray "List of Data" tab that the legacy wrapper required as a placeholder; the funnel filter button still appears via plugin-ui's built-in headerContent. The list page no longer passes a tabs={…} prop at all.
  • Filter prop unchanged — { id, label, field } shape carries over directly.
  • Wraps <DataViews> in <div className="dokan-admin-dashboard-datatable"> so existing SCSS keeps applying.

Wrapper-component swap, not a redesign — stats cards, funnel filter, sorting, pagination, vendor drill-down, transaction table all preserved.

Related Pull Request(s)

Closes

How to test the changes in this Pull Request:

  1. Build assets: npm run build.
  2. WP Admin → Dokan → Reverse Withdrawal.
  3. Confirm the four stats cards still render at the top.
  4. Confirm there is no stray "List of Data" tab on the table.
  5. Use the funnel filter button (top-right of the table card) — chips render, Reset clears.
  6. Click into a vendor row to open the transactions drill-down — confirm the transactions table loads and paginates.
  7. Resize to mobile width — both tables collapse to list view.
  8. Confirm both tables share the single white card with the funnel button on the right.

Changelog entry

Migrate admin Reverse Withdrawal tables to Plugin UI DataViews

Replaces the legacy AdminDataViews wrapper on both admin Reverse Withdrawal tables (main list + transaction drill-down) with the unified DataViews component. Drops the placeholder "List of Data" tab the legacy wrapper required. Stats cards, funnel filter, sorting, pagination, and the vendor → transactions drill-down all behave the same.

Before Changes

Both Reverse Withdrawal tables used the in-house AdminDataViews wrapper, which forced a single placeholder "List of Data" tab to render. Tabs and filter sat outside the table card.

After Changes

Both tables use DataViews from @wedevs/plugin-ui. The placeholder tab is gone. Funnel filter button + table render inside a single white card matching the rest of the admin dashboard.

Feature Video (optional)

n/a

PR Self Review Checklist:

  • Follows WPCS / project conventions.
  • Removed dead helpers (the synthetic tabItems array and the tabs={…} prop on the list page).
  • DRY — both files share the same migration pattern; no duplicate helpers introduced.

FOR PR REVIEWER ONLY:

  • Correct — funnel filter, sorting, pagination, vendor drill-down all still work; placeholder tab removed.
  • Secure — no new escaping concerns; reuses existing reverse-withdrawal REST endpoints.
  • Readable — diff is small per file (import swap, view.status, tabs prop removed).
  • Elegant — cleanly drops legacy wrapper without behavioural changes.

MdAsifHossainNadim and others added 2 commits May 8, 2026 12:01
Switch reverse-withdrawal/index.tsx and ReverseWithdrawalTransaction.tsx
from the legacy AdminDataViews wrapper to the unified DataViews component
already exported from @dokan/components.

- Reshape tabs prop on both pages: tabs.tabs (icon callback) → tabs.items
  with {value,label}; the tab is decorative (no status filter) on both
- Wrap migrated DataViews in <div className="dokan-admin-dashboard-datatable">
  on both pages so existing scoped admin table styles continue to apply
- Preserve the 4-card stats panel on both pages, the Add New button +
  AddReverseWithdrawModal flow on the list page, the Back button on the
  transactions page, and the per_page: -1 transactions fetch shape

Refs getdokan/plugin-internal-tasks#1848

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The synthetic single-tab existed only to anchor the filter funnel button
under the legacy AdminDataViews wrapper. Plugin UI DataViews renders the
funnel inside its own header content area, so the tab is no longer needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 21213b5c-0194-4c13-b5d1-68f8edebd533

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enhance/update-admin-dashboard-reverse-withdrawal-list-tables

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

akzmoudud and others added 3 commits May 12, 2026 15:19
…-plugin-ui' to bring in shared Layout wrapper, getActionLabel helper, and DataViews CSS overrides
…verse Withdrawal

Plugin UI DataViews renders an empty header bar (only the filter funnel)
when no tabs are provided, so the synthetic single-item tab is needed
to anchor a left-side title. Restores `tabItems` with the 'List of Data'
label and re-passes the `tabs` prop to <DataViews>.

Also drops `rounded-md shadow-sm pt-3` from the page-level wrappers on
both ReverseWithdrawalPage and ReverseWithdrawalTransactionPage. With
.pui-root-dataviews now carrying the white card + shadow + radius from
the parent migration, the outer wrapper was double-painting and leaving
a stray top padding above the page header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Reverse Withdrawal admin page uses a one-item `tabs` prop ("List of
Data") to anchor a left-side title in the DataViews header (plugin-ui
draws an empty bar otherwise). With the default active-tab styling, that
synthetic tab rendered in the primary accent colour with a purple bottom
border — visually misleading since there's nothing to switch to.

Adds a `:only-child` rule on the tab trigger inside `.pui-root-dataviews`
that neutralises the accent: black bold heading text, no underline,
default cursor. Multi-tab pages (Withdraw, Vendors) are unaffected since
their triggers aren't `:only-child`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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