enhance: migrate admin Reverse Withdrawal tables to Plugin UI DataViews#3194
Open
MdAsifHossainNadim wants to merge 5 commits into
Conversation
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>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
…-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>
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.
All Submissions:
Changes proposed in this Pull Request:
Migrates both admin Reverse Withdrawal tables to the unified
DataViewscomponent 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:
AdminDataViews as DataViewsalias in favour of the directDataViewsimport.view.status(no separateactiveTabmirror).{ tabs: [{ name, title, icon }] }→{ items: [{ value, label, count }] }.headerContent. The list page no longer passes atabs={…}prop at all.{ id, label, field }shape carries over directly.<DataViews>in<div className="dokan-admin-dashboard-datatable">so existing SCSS keeps applying.Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
npm run build.Changelog entry
Migrate admin Reverse Withdrawal tables to Plugin UI DataViews
Replaces the legacy
AdminDataViewswrapper on both admin Reverse Withdrawal tables (main list + transaction drill-down) with the unifiedDataViewscomponent. 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
AdminDataViewswrapper, which forced a single placeholder "List of Data" tab to render. Tabs and filter sat outside the table card.After Changes
Both tables use
DataViewsfrom@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:
tabs={…}prop on the list page).FOR PR REVIEWER ONLY: