feat: add DebouncedInput component and support for "dokan-seller-badge" panel#2974
Conversation
|
Warning Rate limit exceeded@MdAsifHossainNadim has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 2 seconds before requesting another review. ⌛ 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. 📒 Files selected for processing (2)
WalkthroughAdds legacy admin route support for Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Browser as Browser
participant Frontend as PanelSwitch (React)
participant Backend as LegacySwitcher (PHP)
Note over Browser,Frontend: Admin URL contains 'dokan-seller-badge'
Browser->>Frontend: Load route with 'dokan-seller-badge'
Frontend->>Frontend: isSupported? (supportedKeys includes 'dokan-seller-badge')
alt supported
Frontend->>Backend: request transient key for admin URL
Backend-->>Frontend: returns transient key 'seller-badge'
Frontend-->>Browser: render legacy seller-badge panel
else not supported
Frontend-->>Browser: fallback render
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
includes/Admin/Dashboard/LegacySwitcher.php(3 hunks)src/admin/panel-switcher/PanelSwitch.tsx(1 hunks)src/components/index.tsx(1 hunks)
🔇 Additional comments (3)
src/admin/panel-switcher/PanelSwitch.tsx (1)
17-17: LGTM! Seller badge page support added correctly.The addition of 'dokan-seller-badge' to the supported keys array properly enables panel switching for the seller badge page and aligns with the corresponding backend changes in
LegacySwitcher.php.includes/Admin/Dashboard/LegacySwitcher.php (1)
160-161: LGTM! Seller badge URL mapping added correctly.The new mapping entry for 'dokan-seller-badge' => 'seller-badge' properly enables legacy URL resolution for the seller badge page and aligns with the frontend panel switcher changes.
src/components/index.tsx (1)
47-47: No issues found—DebouncedInput component is properly implemented and correctly exported.The component exists at
src/components/DebouncedInput.tsxand is well-implemented using WordPress packages and React hooks. The export in line 47 is correct and matches the component file.
# Conflicts: # src/admin/panel-switcher/PanelSwitch.tsx
* feat: add TikTok support to social profiles and dashboard * feat: update TikTok icon SVG structure and styles for improved rendering * feat: add TikTok icon styles to store --------- Co-authored-by: Aunshon <32583103+Aunshon@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
includes/Vendor/Vendor.php (1)
86-90: Clean up minor style issues flagged by inspectionsA few existing lines are being flagged by the inspections job and are straightforward to tidy up:
Constructor block:
- Remove the blank line immediately after
if ( is_numeric( $vendor ) ) {.- Remove the extra semicolon in
get_user_by( 'id', $vendor );;.
__call()implementation:
- Normalize spacing to match coding standards, e.g.:
str_replace( 'get_', '', $name );$this->shop_data[ $function_name ](spaces around array key).
is_featured():
- Use strict comparison instead of loose:
public function is_featured() { return 'yes' === get_user_meta( $this->id, 'dokan_feature_seller', true ); }These adjustments should satisfy the reported inspections with minimal behavioral risk.
Also applies to: 116-124, 215-216
🧹 Nitpick comments (1)
src/admin/dashboard/icons/socials/TikTok.tsx (1)
1-37: TikTok SVG icon component is consistent and accessibleThe new
TikTokicon component correctly reusesSocialIconProps, provides a localized default title, and exposes aclassNamehook. The SVG structure and accessibility attributes (role="img",aria-label) look good and match typical patterns for the other social icons.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
assets/src/less/store.less(1 hunks)includes/Vendor/Vendor.php(1 hunks)includes/functions.php(1 hunks)src/admin/dashboard/config/socialPlatforms.tsx(2 hunks)src/admin/dashboard/icons/socials/TikTok.tsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/admin/dashboard/icons/socials/TikTok.tsx (1)
src/vendor-dashboard/reports/analytics/components/report-error/index.js (1)
title(16-19)
🪛 GitHub Actions: Inspections
includes/Vendor/Vendor.php
[error] 87-87: Blank line found at start of control structure
[warning] 89-89: Empty PHP statement detected: superfluous semicolon.
[error] 118-118: Expected 1 spaces after opening parenthesis; 0 found
[error] 124-124: Array keys must be surrounded by spaces unless they contain a string or an integer.
[error] 216-216: Loose comparisons are not allowed. Expected: ===; Found: ==
[warning] 118-118: Equals sign not aligned correctly; expected 1 space but found 2 spaces
includes/functions.php
[warning] 819-819: The method parameter $key is never used
[warning] 832-832: The method parameter $key is never used
[warning] 929-929: The method parameter $pro is never used
[warning] 1971-1971: The method parameter $args is never used
[warning] 2644-2644: The method parameter $product_id is never used
[warning] 2644-2644: The method parameter $category_id is never used
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: e2e tests (2, 3)
- GitHub Check: e2e tests (3, 3)
- GitHub Check: api tests (1, 1)
- GitHub Check: e2e tests (1, 3)
🔇 Additional comments (4)
includes/functions.php (1)
2342-2345: Verify TikTok icon class mapping matches Font Awesome usageThe new
tiktoksocial field looks consistent with other entries, but please double‑check how$fields[ $key ]['icon']is turned into the actual<i>class. CSS targets.fa-tiktok, while this entry sets'icon' => 'tiktok', so depending on the helper you may need either'tiktok'(if'fa-'is prefixed elsewhere) or'fa-tiktok'/'fa-brands fa-tiktok'if the value is used as‑is.assets/src/less/store.less (1)
529-534: TikTok social icon styling is consistentThe
.fa-tiktokstyling aligns with the existing per-network color rules and should integrate cleanly into the store social icon list.includes/Vendor/Vendor.php (1)
1222-1229: TikTok setter aligns with existing social setters
set_tiktok()correctly usesset_social_propwith the'tiktok'key andesc_url_raw, staying consistent with the other social setters.src/admin/dashboard/config/socialPlatforms.tsx (1)
11-11: TikTok platform config is well-integrated with existing social platformsThe new TikTok import and
tiktokentry mirror the existing platform structure (id/key, domains, placeholder, icon/getIcon). The key name is consistent with the backend (dokan_get_social_profile_fieldsandVendor::set_tiktok), so this should plug cleanly into existing forms and display components.Also applies to: 97-106
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
docs/frontend/select.md(1 hunks)src/base-tailwind.scss(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: e2e tests (3, 3)
- GitHub Check: api tests (1, 1)
- GitHub Check: e2e tests (2, 3)
- GitHub Check: e2e tests (1, 3)
🔇 Additional comments (1)
src/base-tailwind.scss (1)
105-113: Selector scope may affect unintended react-select UI elements; use design system color variable.The selector
.react-select__control spantargets all span elements within the react-select control, not just the icon placeholder. This could inadvertently style internal UI elements (e.g., placeholder text wrapper, dropdown indicator). Additionally, the hardcoded color#EAEAEAbreaks consistency with the design system approach used throughout the file (e.g.,--dokan-button-background-color,--dokan-button-border-color).Please:
- Verify whether the current selector scope is intentional or if it should be more specific (e.g., targeting only a particular child selector or data attribute if react-select provides one).
- Consider extracting
#EAEAEAinto a CSS custom property for consistency and maintainability.Reference the design system pattern shown at lines 8–10 for guidance on using CSS variables.
All Submissions:
Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
Changelog entry
No neededDetailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.
Before Changes
Describe the issue before changes with screenshots(s).
After Changes
Describe the issue after changes with screenshot(s).
Feature Video (optional)
Link of detailed video if this PR is for a feature.
PR Self Review Checklist:
FOR PR REVIEWER ONLY:
Summary by CodeRabbit
New Features
Style
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.