-
Notifications
You must be signed in to change notification settings - Fork 216
update/link-dokan-admin-vendor #2926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update/link-dokan-admin-vendor #2926
Conversation
…date navigation logic
|
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 You can disable this status message by setting the WalkthroughIntroduces a new admin “Vendors” experience: adds vendor list navigation changes, vendor create/edit React pages with media/cropping utilities, a vendor detail page with tabs (overview, general, withdraw), new vendors data store, payment-management modals, payment icons, shared components, TypeScript definitions, and supporting PHP REST/settings/localization and asset registrations. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Admin
participant UI as Admin Dashboard (Create Vendor)
participant Store as Vendors Store
participant API as /dokan/v1/stores
Admin->>UI: Click "Add Vendor"
UI->>Store: validateForm(vendor)
alt valid
UI->>API: POST /dokan/v1/stores (vendor)
API-->>UI: 201 Created (vendor)
UI->>Store: setCreateOrEditVendor(vendor)
UI->>UI: Navigate to /vendors/edit/:id
else invalid
UI->>Store: setCreateOrEditVendorErrors(missingFields)
end
sequenceDiagram
autonumber
actor Admin
participant UI as Vendors Single → Withdraw Tab
participant API as /dokan/v1/settings
participant Store as Vendors Store
Admin->>UI: Click "Manage" on a method
UI->>UI: Open modal (Bank/PayPal/Skrill/Custom)
Admin->>UI: Submit details
UI->>API: PUT /dokan/v1/settings?vendor_id={id} (payload)
API-->>UI: 200 OK (settings)
UI->>Store: setVendor(updatedVendor)
UI->>UI: Close modal
sequenceDiagram
autonumber
actor Client
participant REST as StoreSettingController
participant Vendor as Vendor Resolver
Client->>REST: GET /dokan/v1/settings?vendor_id=123
REST->>Vendor: get_vendor(request)
Vendor-->>REST: Vendor (id=123) or current user
REST-->>Client: Settings + payment methods (connected/disconnected/active)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
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 |
…puts for improved performance
…r customization in HeaderCard
…or better maintainability
| */ | ||
| public function add_localize_data( $localize_data ) { | ||
| $localize_data['is_vendor_switching_enabled'] = $this->is_feature_active(); | ||
| $localize_data['is_vendor_legacy_page'] = get_transient( 'dokan_legacy_vendors_page' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this line.
|
Need to implement |
* feat: add VendorsSingle page and routing to admin dashboard * WIP: Vendor Store * WIP: Vendor single display header section * WIP: Vendor single display Sidebar section * enhance: Add social links and email functionality to vendor profile * enhance: Implement send email button and popup for vendor communication. * enhance: Redesign vendor overview with tabbed interface and new card components * enhance: Refactor vendor tabs to use hooks for dynamic configuration * enhance: Integrate top products fetching and loading state in vendor overview * enhance: Remove unused tabs from vendor overview and streamline tab configuration. * enhance: Remove unused Badges tab and optimize vendor stats fetching in tab sections * enhance: Add position property to tabs and implement sorting for dynamic tab order * enhance: Update ProductCard and StatCard to use dangerouslySetInnerHTML for dynamic content rendering * enhance: Refactor InfoCard to use slots for email functionality integration * enhance: Refactor InfoCard to use slots for email functionality integration * enhance: Remove vendorStats from tab components for simplified data handling * enhance: Update OverviewTab and TabSections to include new slots for vendor data integration * enhance: Add TopProductSkeleton for loading state in OverviewTab and update localization strings * enhance: Integrate NoInformation component for empty state in OverviewTab * enhance: Refactor import statement for NoInformation component in OverviewTab * enhance: Update OverviewTab to handle empty product image and category states * Admin dashboard general tab, withdraw tab, verification tab, subscription tab. (#2772) * enhance: Verification tab & withdraw tab done. * enhance: General tab done. * Moded verification codes to pro * enhance: Remove unused tabs from vendor dashboard * enhance: Add dokan-react-components dependency and localize frontend script in admin dashboard * Moved eu fields to pro. * enhance: Refactor GeneralTab to use SlotFillProvider and PluginArea * enhance: Add NoInformation component export to index * enhance: Rename NoInformation component file for improved structure * Moved subscription tab component to pro * enhance: Improve dependency handling and add fallback for country/state retrieval * enhance: Reorder tab positions in TabSections for improved navigation * enhance: Update GeneralTab and NoInformation components for improved default value handling and localization * enhance: Adjust responsive grid classes in GeneralTab for better layout on small screens * enhance: Implement Popover component for vendor redesign * enhance: Implement send email button and popup for vendor redesign * enhance: Refactor payment methods handling and add new payment forms for vendor settings * enhance: Add payment method descriptions and improve layout in WithdrawPaymentRow * enhance: Add nonce to dashboard data and improve NoInformation component styling * enhance: Add customizable class names for NoInformation component elements * enhance: Add vendor creation and editing functionality with form validation * enhance: Add success toast notification and extend form with customizable slots for vendor creation * enhance: Remove unused imports from Create component for cleaner code * enhance: Add LoaderCircle icon to Form component and import Card in Create component * enhance: Update vendor creation page with improved navigation and button functionality * enhance/react-edit-vendor (#2842) * enhance: Add vendor editing functionality with form validation and navigation * enhance: Improve layout and add social information slots in vendor edit form * feat: add CategoryBasedCommissionPure component with hierarchical category management and commission input handling * feat: rename CombineInputPure to FixedCommissionInput for clarity and consistency * enhance: Refactor vendor form handling with validation and API request utilities * feat: refactor components to use lucide-react icons and improve type definitions * feat: enhance FixedCommissionInput to conditionally render title and description * feat: optimize className handling in FixedCommissionInput using twMerge * enhance: Refactor vendor form handling with validation and API request utilities * feat: enhance vendor form with commission type selection and modal confirmation * feat: export additional components including DokanModal, DataViews, and error layouts * feat: integrate commission types via filters in vendor form --------- Co-authored-by: Osman Goni Sufy <[email protected]> * fix: update success message for vendor edit action * WIP: add withdraw management with new admin dashboard page * enhance: Update webpack configuration for Dokan dependency mapping * enhance: Update webpack configuration for Dokan dependency mapping * enhance: Update comments for React utilities and hooks registration in Assets.php * enhance: Refactor import statements and improve code formatting in Bootstrap.js * feat: enhance withdraw admin dashboard with improved formatting, styling, and eligibility conditions - Improved handling for `dokanAdminDashboard.currency` fallback in `Accounting.ts`. - Implemented `processDetails` for detailed render of withdrawal methods. - Replaced custom buttons with `DokanButton` for better consistency. - Added eligibility conditions for bulk actions (approve, cancel, delete). - Introduced `formatPrice` utility for consistent price formatting. - Updated table styling with new borders and rounded corners in SCSS. - Corrected TSPath alias in `tsconfig.json`. * enhance: Refactor withdrawal actions to utilize modal for approval, cancellation, and deletion * enhance: Improve withdrawal admin list with filter options and tooltip for details * enhance: Add option to download PayPal mass payment file in withdrawal admin list * enhance: Update withdrawal actions with new icons and improve button styling * feat: add DokanSelect component with customizable styles and indicators * enhance: update DokanSelect component to improve cursor styles for indicators and options * enhance: update indicator separator visibility in DokanSelect component * enhance: improve component composition and style precedence in DokanSelect * feat: add DokanAsyncSelect and VendorAsyncSelect components for enhanced vendor selection * feat: add ProductAsyncSelect component for enhanced product selection * feat: add WcDateRangePicker component for date range selection * feat: add WpDateTimePicker component for date and time selection * feat: refactor ProductAsyncSelect for improved loading and option handling * feat: add OrderAsyncSelect component for enhanced order selection * feat: add SearchInput component for enhanced search functionality * feat: add CouponAsyncSelect component for coupon selection * feat: add Test component with various Dokan UI elements and functionality * feat: remove DokanSelect export from index.tsx * feat: remove DokanSelect component from Test.tsx * feat: enhance Test component with ProductAsyncSelect and VendorAsyncSelect * feat: remove unused imports from Test component * feat: rename DokanAsyncSelect to AsyncSelect and update imports * feat: rename DokanAsyncSelect to AsyncSelect and update imports * feat: add Select component and update AsyncSelect usage in Test component * feat: refactor AsyncSelect and related components to use BaseSelectProps for improved type safety * feat: enable multi-select functionality in Test component * feat: integrate SimpleInput for date input in WcDateRangePicker, WpDatePicker, and WpDateTimePicker components * feat: add documentation for AsyncSelect, CouponAsyncSelect, OrderAsyncSelect, ProductAsyncSelect, VendorAsyncSelect, WpDateTimePicker, SearchInput, and Select components * feat: add prefetch and strict validation options to AsyncSelect components * feat: update AsyncSelect components to improve fetching logic and add unique instance IDs * feat: enhance AsyncSelect components with unique merging logic for prefetched options * feat: implement skip merging logic for AsyncSelect components on dependency changes * feat: replace Test component with Status component in routing * feat: add Vendors management page and related components * feat: enhance vendor admin list with avatar display and action buttons * feat: update vendor admin list with improved URL handling and status display * feat: add confirmation modal for vendor approval and disable actions * feat: add selection state management for bulk actions in vendor admin list * feat: rename WcDateRangePicker and WpDateTimePicker components to DateRangePicker and DateTimePicker * feat: enhance AsyncSelect components with Tailwind CSS styling and improve option label formatting * feat: update documentation for Props API and enhance WpDatePicker with unique instance IDs * feat: enhance AsyncSelect component with icon support and update documentation * feat: update ProductAsyncSelect endpoint and enhance SearchInput with stable debouncing * feat: remove onClose handler from DateRangePicker component * feat: replace Test component with Status in Dokan routes * Finish select components * feat: enhance AsyncSelect components with onMenuOpen handling and loading optimization * feat: add filter button and toggle functionality to Vendors page * feat: add seller badge and subscription filters to Vendors page * feat: improve loading states and optimize rendering for vendor fields * feat: add SellerBadgeSelect component and update vendor list layout * fix: update import paths for components to use relative paths * feat: enhance withdraw admin page with new filters and UI updates - Added `VendorAsyncSelect` and `DateRangePicker` components for improved filtering. - Updated SCSS to fix z-index and add relative positioning. - Refactored filter handling logic for better clarity and usability. * feat: enhance vendor filtering with dynamic fields and improved query handling * feat: add payment method filter and improve withdraw filtering UI - Introduced `AsyncSelect` with payment method filter support. - Enhanced UI components for filtering, including updated placeholders and button styles. - Added `loadPaymentMethods` function to dynamically fetch payment methods. - Improved filter reset functionality with additional cleanup actions. * fix: bind payment method value to AsyncSelect in withdraw filter UI * feat: integrate WooCommerce export system with new Dokan export controllers - Added `ExportController` and `WithdrawExportController` to manage export functionality. - Registered `WithdrawExportController` with WooCommerce under `withdraws` type. - Created comprehensive usage documentation for the export controller. - Enhanced `REST/Manager` to support export controllers seamlessly. * feat: enable withdraw export functionality with enhanced WooCommerce integration - Added support for withdraw data export via WooCommerce export system. - Introduced `register_data_endpoint` method to map withdraw export endpoint. - Updated `ExportController` and `WithdrawExportController` for endpoint structure alignment. - Enhanced admin withdraw page with bulk export options and improved pagination. * Fix comments * Fix comments * fix: standardize i18n domain to 'dokan-lite' and update component imports * fix: standardize i18n domain to 'dokan-lite' and update component imports * fix: standardize i18n domain to 'dokan-lite' and update component imports * fix: standardize i18n domain to 'dokan-lite' and update component imports * refactor: rename `CategoryBasedCommissionPure` to `CategoryBasedCommission` and update all references * refactor: rename `CategoryBasedCommissionPure` to `CategoryBasedCommission` and update all references * Update Edit.tsx functionality. * chore: apply WordPress hooks for social platforms and payment gateways mapping, and fix SkeletonLoader component rename * feat: implement reusable admin data table component and enhance withdraw admin UI - Created `AdminDataViewTable` component for reusable, filterable, and responsive data tables. - Integrated new data table in withdraw admin page for better UX. - Added new SCSS styles to support component styling. - Enhanced withdraw page functionality with improved tabs, export options, and filtering. * feat: add filter button enhancements and improve admin filters behavior - Introduced `openSelectorSignal` and `buttonRef` states in `AdminDataViewTable` for better filter button management. - Enhanced `AdminFilter` with new props: `openOnMount`, `openSelectorSignal`, `onFirstFilterAdded`, and `buttonPopOverAnchor` for improved flexibility. - Adjusted filter popover logic for dynamic anchoring and better user experience. - Updated withdraw admin page tab icons for better readability. * feat: auto-hide filters panel when no active filters - Added `hasActiveFilters` state in `AdminDataViewTable` to track active filters. - Implemented logic to auto-hide filter area when no filters are active. - Enhanced `AdminFilter` with `onActiveFiltersChange` prop for notifying parent components about active filter count changes. - Improved filter button behavior by conditionally toggling filter visibility. * feat: improve withdraw filters UX with enhanced clearing and removal functionality - Refactored `clearSingleFilter` method to improve filter clearing logic for vendors, payment methods, and date ranges. - Added UI for removing individual active filters in `AdminFilter` using a close button with `lucide-react` `X` icon. - Updated filter management to ensure state consistency and reset view pagination on filter changes. * feat: enhance AdminDataViewTable with new empty state and styles - Introduced reusable `ListEmpty` component to standardize empty state UI. - Added support for customizable empty state (`empty`, `emptyIcon`, `emptyTitle`, `emptyDescription`) in `AdminDataViewTable`. - Updated `dataviews` SCSS with improved layouts, spacing, and styles for empty states and table paddings. - Enhanced withdraw admin page with updated tab and status badge styles for better readability. - Added comprehensive documentation for `AdminDataViewTable` usage in `frontend/admin-dataview-table.md`. * feat: add bulk action toolbar and improve data view styles - Added `BulkActionToolbar` component in `AdminDataViewTable` for managing bulk actions. - Updated SCSS to include box-shadow for `.dataviews-wrapper` to enhance visual hierarchy. * refactor: update REST Manager to simplify controller loading - Commented out redundant code checking/loading `WithdrawExportController`. - Added `ExportController` to `get_registered_controllers` method for enhanced export functionality. * fix: update bulk action callback to map item IDs - Modified `handleBulkAction` usage to map `items` to their `id` values for better data handling in bulk PayPal actions. * refactor: simplify withdraw export argument structure - Updated `report_args` to directly use `ids` instead of `include` for better clarity and consistency. * fix: add per_page export argument and ensure integer pagination headers - Added `per_page` argument to withdraw export API for controlling items per page. - Ensured `X-WP-Total` and `X-WP-TotalPages` headers return integers in withdraw export responses. * fix: update filter panel visibility logic in AdminDataViewTable - Applied `!hidden` class for proper handling of `showFilters` state to ensure consistent filter panel visibility. * fix: improve withdraw modal UI and localization support - Added `_n` import for handling singular/plural translations in withdraw modal. - Refined modal styling with better section separation using borders. - Updated `dialogTitle` to display amount and store name for clarity. - Replaced repetitive header code with streamlined component structure. * update/link-dokan-admin-vendor (#2926) * refactor: replace `router-link` with `<a>` tags in Vendors.vue and update navigation logic * feat: add support for admin commission settings when creating a vendor. * refactor: replace `MaskedInput` with `DebouncedInput` in CommissionInputs for improved performance * refactor: centralize DebouncedInput component and update references accordingly * refactor: extract StoreName to a separate component and add filter for customization in HeaderCard * feat: add PluginArea to InfoCard for extending vendor details via plugins * refactor: restructure vendor form sections into distinct components for better maintainability * feat: add discard changes functionality to Edit vendor page and update button labels * feat: add unsaved changes warning when navigating away from Edit vendor page * feat: add confirmation modal for unsaved changes on Edit vendor page navigation * fix: ensure tab component is rendered correctly in Form component * refactor: improve layout and styling of vendor forms and info sections * refactor: update tab navigation implementation and improve component rendering * refactor: change categories state initialization to an object and update data handling * fix: adjust vendor management for legacy page handling and update minor UI classes --------- Co-authored-by: Md Asif Hossain Nadim <[email protected]> * fix: enhance withdraw export status handling and data updates - Updated `checkStatus` function to use Promises for improved async handling and status check resolution. - Added `payable` field to withdraw export data for more comprehensive reporting. - Refined `AdminDataViewTable` tab selection logic to reset selection state. - Updated dependencies to the latest versions for improved stability and features. * fix: filter PayPal items in bulk action callback - Updated `handleBulkAction` to process only items with the `paypal` method before mapping their IDs. * refactor: enhance vendor admin list with dynamic filters and improved UI elements - Updated filters to allow dynamic field injection and better customization. - Improved UI for status tabs and filters with consistent theming. - Refactored filter logic and replaced redundant methods for better clarity. - Integrated search and tab selection into the main table component for enhanced usability. * refactor: remove unused components and redundant state logic in Vendors page - Removed `DokanTab` and `Filter` components. - Deleted `showFilters` state and unnecessary `useEffect` for filter visibility. - Simplified and cleaned up markup and filter methods for improved readability. * fix: enhance withdraw modal logic and UI - Added `selectedAction` state to manage action selections in the withdraw modal. - Improved action initialization for the "view" modal based on item status. - Simplified conditional rendering and cleaned up modal structure for better readability. - Refined button handling, ensuring appropriate action execution and modal behavior. * feat: add 'vendors' to supported keys in PanelSwitch filter * feat: add 'vendors' to supported keys in PanelSwitch filter * refactor: Update hash handling in PanelSwitch to enhance URL change detection and reactivity * fix: add 'withdraw' to panel switch supported keys filter - Extended `supportedKeys` filter to include 'withdraw' for better panel switch handling. * refactor: Remove unused `shouldRender` state and legacy redirect logic from PanelSwitch and LegacySwitcher * fix: update vendor navigation path in Vendors page * refactor: replace `wp.hooks.applyFilters` with `applyFilters` and update `wp_localize_script` usage - Used `@wordpress/hooks`'s `applyFilters` for consistency. - Replaced `wp_localize_script` with `wp_add_inline_script` for better script handling. * fix: set `dokanAdminDashboard` as a global window object for script access * fix: update vendor creation navigation path in Vendors page * refactor: replace `AsyncSearchableSelect` with `Select` in Vendor form - Switched to using the `Select` component for country and state fields. - Removed `defaultOptions` in favor of `options` for better compatibility. * feat: add delay prop to store name and email fields in Vendor form * fix: update vendor navigation links to use the correct dashboard path * fix: downgrade `@wordpress/dataviews` to version 6.0.0 for compatibility --------- Co-authored-by: Shazahanul Islam Shohag <[email protected]> Co-authored-by: Md Asif Hossain Nadim <[email protected]> Co-authored-by: Md. Asif Hossain Nadim <[email protected]> Co-authored-by: Osman Goni Sufy <[email protected]>
All Submissions:
Related Pull Request(s)