feat(vendor-settings): complete the reactive Store settings page#3312
Open
MdAsifHossainNadim wants to merge 8 commits into
Open
feat(vendor-settings): complete the reactive Store settings page#3312MdAsifHossainNadim wants to merge 8 commits into
MdAsifHossainNadim wants to merge 8 commits into
Conversation
Completion pass for the vendor Store Settings React page (PR 3 of 3, spec: getdokan/plugin-internal-tasks#2115). - vendor_map: full Mapbox support (mapbox-gl on demand, draggable marker, Enter-to-geocode via the Mapbox places API) alongside Google; Google auth failures (gm_authFailure) and loader errors now degrade to plain coordinate inputs instead of a dead canvas. - vendor_image: Change action under the preview (Figma parity) in addition to remove; still persists attachment IDs only. - Schema: subpage titled Store so the content header no longer duplicates the page title. Verified end-to-end on dokan-core.test: PUT with empty store name returns 400 {errors:{store_name}}; a real save flips dokan_store_time_enabled, keeps all 47 profile keys byte-identical (vendor_biography/payment untouched), syncs the dokan_store_name mirror, and the LEGACY settings form immediately renders the change (schedule checkbox on, day rows visible). Snapshot restored after testing. Co-Authored-By: Claude Fable 5 <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 |
…or-store-settings-page
Reworks the page presentation to the Figma Store frames using only plugin-ui's native schema capabilities (no engine forks): - Every section is its own card with title + helper description (Branding, Store Information, Store Locations, Store Map, Store Schedule, Catalog Mode, Terms & Conditions) ordered via priority so Pro slots its cards (Store Biography lands before T&C). - Fields use layout: full-width (stacked label above a full-width control); subpage hide_heading kills the duplicated inner title; the route header reads Store. - Store schedule renders the delivery-time treatment: WeeklyTimeSlots inside a bordered box with divided weekday rows (dokan-pro#5915). - vendor_image matches the Figma media pattern: spec line, preview with pencil-Change and trash beside it, circular logo via the new shape attribute. - Footer gains Cancel (refetch + engine remount discards edits) alongside Save Changes. - Map card: on Google auth failure the search input is handed back to the vendor (Google disables it and injects an error string after gm_authFailure), and a bare ',' stored location displays empty. Field ids, storage keys, and value shapes are untouched - this is presentation only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… Cancel style
Figma re-verification findings (design agent, 21 -> 8 mismatches after the
rework; these close the two real defects and one style delta):
- vendor_image remove button: the SVG lost the fight with the theme's
button rules (same battle WeeklyTimeSlots' icon buttons solve) - inline
lucide size + important-flagged classes make the trash glyph render.
- vendor_store_schedule: override the shared component's delivery-domain
validation copy ('%s delivery time can not be empty') with store-schedule
wording via the messages prop.
- Cancel is a ghost (borderless) button per the Figma footer.
Verified live: banner row renders [pencil Change] [trash] per the design;
map search input restores after Google auth failure with the proper
placeholder, and a bare ',' stored location displays empty.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ation and page chrome - Header: "Store Settings" title with Cancel/Update Settings portaled beside it; the engine save area stays as the Figma footer, stripped of its bar chrome - Cards sit flush with the page title (dokan-tailwind ships !important utilities, so the gutter/save-bar overrides carry the flag too) - Store Title gains the red (Required) marker via a vendor_text variant - Banner/Logo reworked to the admin vendor-edit pattern: title+spec with inline Change/delete controls, full-width banner frame, default banner/logo placeholders - New vendor_multiselect renderer (SmartMultiSelect) that Pro drives for Store Category; non_meta fields skip the profile slice and persist on the new dokan_after_saving_vendor_settings seam - Store Information: email toggle (with helper copy) ahead of Phone - Page-shaped loading skeleton replacing the engine's sidebar-panel skeleton - Terms & Conditions card expanded by default Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… editor - Day rows render full-bleed in the card (horizontal rules only) instead of a second bordered/padded box - Days with no stored times show one dimmed empty pair, so disabled rows read like the delivery-time page instead of bare labels - Toggling a day off keeps its times in the form (dimmed, delivery behaviour); the server still zeroes closed days at save so storage stays legacy-identical - Errors surface on touch like the delivery page (no validate-on-mount) - Helper descriptions for the schedule toggle and open/close notices Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A Full Day slot previously hid its + button, leaving a gap beside the trash so the row didn't line up with dated rows. Render it visible-but-disabled (a full day already spans 24h, matching the disabled trash), so every row aligns in both the store schedule and the delivery-time editor. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… cross-field validation seam - New vendor_store_locations variant: DataViews locations table with add/edit/delete modals; row 0 is the pinned Default location and extra rows are gated by the sibling multiple-locations switch (Pro injects the section and owns persistence). - New vendor_rich_text variant so store_tnc can render the red (Required) marker; the schema marks it required and adds T&C field descriptions. - update_item() now applies dokan_rest_vendor_settings_validate before the 400 return so Pro modules can enforce cross-field rules (e.g. min <= max). - style.scss: seat the DataViews grid flush inside the settings card, lift the location popovers above the WP modal overlay, and pin the light input theme inside the modal (it renders outside plugin-ui's theme provider). Co-Authored-By: Claude Opus 4.8 (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:
PR 3 of 3 for the vendor Store Settings → React migration (spec: getdokan/plugin-internal-tasks#2115). Stacks on #3311 (wiring). Completes the reactive page:
vendor_mapfinished — full Mapbox provider support (mapbox-gl loaded on demand, draggable marker, Enter-to-geocode through the Mapbox places API) alongside the Google canvas; Google auth failures (gm_authFailure) and script-load errors now degrade to editable coordinate inputs instead of a dead canvas. Both providers write the identical composite{ location: "lat,lng", find_address }.vendor_image— "Change" action under the preview (Figma parity) in addition to remove; attachment-ID storage unchanged.Related Pull Request(s)
Closes
How to test the changes in this Pull Request:
Verified end-to-end on a Pro-active local site:
PUT /dokan/v1/vendor-settings/storewith an empty store name →400 { errors: { store_name: ["Store name is required."] } }(merges into the field's error state).dokan_store_time_enabledno → yes, kept all 47dokan_profile_settingskeys withvendor_biographyandpaymentbyte-identical (shallow-merge proof), and synced thedokan_store_namemirror meta.?settings=storeform immediately rendered the change (schedule checkbox checked, per-day rows visible) — both UIs read/write the same bytes.map_api_sourcebetween Google and Mapbox — the map card renders per provider; break the API key — coordinate inputs appear instead of a dead canvas.Changelog entry
Reactive vendor Store Settings page (completion)
The React Store settings page is feature-complete: both map providers work with graceful degradation, image fields support change/remove with attachment-ID fidelity, and saves have been verified byte-identical against the legacy form.
🤖 Generated with Claude Code