enhance: migrate admin Withdraw table to Plugin UI DataViews#3193
Open
MdAsifHossainNadim wants to merge 3 commits into
Conversation
Switch withdraw/index.tsx from the legacy AdminDataViews wrapper to the
unified DataViews component already exported from @dokan/components.
- Reshape tabs prop: tabs.tabs (icon JSX with count baked in) → tabs.items
with {value,label,count}; preserves Pending / Approved / Cancelled / All
- Move action icons (Eye/Check/XCircle/MessageSquare/Trash/Download) from
the getActionLabel JSX-label helper and the duplicate icon-callback hack
into the dedicated icon prop on each action; replace the wildcard
LucideIcons import with explicit named imports
- Move the Export button from additionalComponents to tabs.headerContent
while keeping the existing tabsAdditionalContents array unchanged
- Tab selection clears current selection (parity with the wrapper)
- Wrap migrated DataViews in <div className="dokan-admin-dashboard-datatable">
so existing scoped admin table styles continue to apply
- Preserve all 6 actions (View / Approve / Cancel / Add Note / Delete /
PayPal mass payment), the insufficient-balance pre-check on Approve,
the 4 modals (approve/cancel/add-note/delete) and the View modal flow
Refs getdokan/plugin-internal-tasks#1847
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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 getActionLabel helper and DataViews CSS overrides
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 the admin Withdraw list table (
dokan/src/admin/dashboard/pages/withdraw/index.tsx) from the legacyAdminDataViewswrapper to the unifiedDataViewscomponent re-exported from@dokan/components.AdminDataViews as DataViewsalias in favour of the existingDataViewsimport.activeTabmirror state intoview.status; deletes the duplicate effect.tabsprop:{ tabs: [{ name, title, icon: <span>(count)</span> }] }→{ items: [{ value, label, count }] }(counts are now a clean field).tabs.additionalComponentsand intotabs.headerContent. Polling logic andpollExportStatusstay verbatim.getActionLabelhelper so the icon keeps rendering inside the dropdown menu and the desktop bulk-action button (the underlying@wordpress/dataviewsMenuItemTrigger/ActionTriggeronly renderaction.label).isEligible: ( item ) => 'paypal' === item?.methodkeeps the action hidden for non-PayPal rows in Approved.<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 Withdraw table to Plugin UI DataViews
Replaces the legacy
AdminDataViewswrapper on the admin Withdraw page with the unifiedDataViewscomponent already used by the vendor dashboard. Tab counts move into the cleancountfield, status state lives inview.status, and the PayPal mass-payment Export button + polling moves totabs.headerContent. Row + bulk action icons are preserved through the sharedgetActionLabelhelper. No behavioural changes — every existing feature (filters, search, pagination, polling, all 6 actions, per-tab action eligibility) carries over.Before Changes
Withdraw used the in-house
AdminDataViewswrapper. Tabs rendered counts inside an icon JSX hack. Export button lived intabs.additionalComponents. Action icons were buried inside thelabelcallback.After Changes
Withdraw uses
DataViewsfrom@wedevs/plugin-ui. Tabs use the cleancountfield. Export button sits intabs.headerContent. Row + bulk action icons render viagetActionLabelinside the label callback so@wordpress/dataviewskeeps showing them in the dropdown menu and the desktop bulk-action button.Feature Video (optional)
n/a
PR Self Review Checklist:
getActionLabel,view.status).tabsreshape + action label wrapping; everything else is mechanical.getActionLabelfrom the parent PR avoids duplicating icon-wrapping logic.FOR PR REVIEWER ONLY:
tabsandactionsblocks.