Skip to content

feat(vendor-settings): complete the reactive Store settings page#3312

Open
MdAsifHossainNadim wants to merge 8 commits into
feat/vendor-store-settings-react-wiringfrom
feat/vendor-store-settings-page
Open

feat(vendor-settings): complete the reactive Store settings page#3312
MdAsifHossainNadim wants to merge 8 commits into
feat/vendor-store-settings-react-wiringfrom
feat/vendor-store-settings-page

Conversation

@MdAsifHossainNadim

Copy link
Copy Markdown
Contributor

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)

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_map finished — 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.
  • Schema — subpage titled "Store" so the content header no longer duplicates the "Store Settings" page title.

Related Pull Request(s)

Closes

  • Completes the Lite side of getdokan/plugin-internal-tasks#2115

How to test the changes in this Pull Request:

Verified end-to-end on a Pro-active local site:

  1. PUT /dokan/v1/vendor-settings/store with an empty store name → 400 { errors: { store_name: ["Store name is required."] } } (merges into the field's error state).
  2. A real save (schedule toggle on) flipped dokan_store_time_enabled no → yes, kept all 47 dokan_profile_settings keys with vendor_biography and payment byte-identical (shallow-merge proof), and synced the dokan_store_name mirror meta.
  3. The legacy ?settings=store form immediately rendered the change (schedule checkbox checked, per-day rows visible) — both UIs read/write the same bytes.
  4. Manual: switch map_api_source between 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

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>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cd47a041-3e82-4e4b-9d6f-2aa3a5ea51fb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/vendor-store-settings-page

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MdAsifHossainNadim MdAsifHossainNadim marked this pull request as ready for review July 8, 2026 11:42
MdAsifHossainNadim and others added 7 commits July 8, 2026 22:00
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant