feat(admin): WorkOS Users list page (1.0.5)#20
Merged
Conversation
New "WorkOS → Users" admin submenu mounts a paginated, searchable React
list of WorkOS users for the active environment. Each row exposes an
"Open in WorkOS" deep-link to dashboard.workos.com/{env}/users/{id}/details
so admins can re-enable a suppressed email (and otherwise triage the user)
in the Dashboard's Emails tab.
Backed by GET /wp-json/workos/v1/admin/users (manage_options) which
proxies Api\Client::list_users() with sanitized limit (1..100), cursor
(after/before, after wins), email substring and organization_id
pass-through. Each user record is enriched server-side with a
dashboard_url so the React client doesn't reconstruct it.
No bulk re-enable in this release: WorkOS exposes the "Re-enable email"
action only through the Dashboard. Verified against the API reference,
the User schema, the Events catalogue, and the public workos-node /
-python / -ruby / -go SDK sources — there is no email-suppression API,
no email_disabled field, and no email.suppressed webhook event as of
2026-05-18. The page is built so a future bulk action wires in without
a UI rewrite.
Refs CONS-273.
rahulacaleffi
approved these changes
May 18, 2026
12 tasks
bordoni
added a commit
that referenced
this pull request
May 19, 2026
Now that the WorkOS Users admin page from #20 has landed in main, wire the per-row "Send password reset" trigger that was deferred until the two PRs converged. - `Admin\Users\RestApi::shape_user()` now resolves the linked WP user id via `_workos_user_id` user-meta and includes it as `wp_user_id` on every row. Empty (0) when the WorkOS user has no WP counterpart yet. - `Admin\Users\AdminPage::maybe_enqueue_assets()` enqueues the shared `PasswordResetAdmin\Assets` script + style so the page already has the click handler when the row buttons mount. - React row in `src/js/admin-users/index.tsx` renders a `.workos-pwreset-trigger` button next to the "Open in WorkOS" link whenever `wp_user_id > 0`. The shared delegated click handler picks it up and posts to the admin endpoint exactly like the row action on wp-admin/users.php. No new tests — the row resolution path is covered by the existing `AdminUsersRestApiTest` (the shape exporter is the only changed surface), the click handler by `PasswordResetAdminRestApiTest`, and both files have been re-run green locally.
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.
Summary
dashboard.workos.com/{env}/users/{id}/detailsso admins can re-enable a suppressed email (and otherwise triage the user) from the Dashboard's Emails tab.GET /wp-json/workos/v1/admin/users(gated bymanage_options), a thin sanitizing proxy overApi\Client::list_users(). Cursor pagination (after/before, after wins when both supplied),limitclamped to 1..100,emailsubstring +organization_idpass-through. Each user record is enriched server-side with adashboard_url.Refs CONS-273 — Re-enable WorkOS emails for affected portal users. Targets the
1.0.5milestone.Why list-only — no bulk re-enable
This PR intentionally does not ship a bulk re-enable action. WorkOS exposes the "Re-enable email" suppression-clear action only through the Dashboard UI as of 2026-05-18. Verified against:
workos.com/docs/emailandworkos.com/docs/reference— Dashboard-only flow, no curl example.workos.com/docs/reference/user-management/user— the User schema has noemail_disabled,suppressed, oremail_statusfield.workos.com/docs/events— noemail.suppressed/user.email.bouncedevent.workos/workos-node,workos-python,workos-ruby,workos-goon GitHub — zero matches forsuppression,reenable, oremail_disabled.email-suppression-managementchangelog announcing the Dashboard feature, with no API counterpart mentioned.The deep-link UI gets admins one click closer to the action they need today. Once WorkOS ships a public suppression endpoint, a row + bulk "Re-enable email" action wires into the existing list page without a UI rewrite.
Architecture notes
admin-profilesprecedent end-to-end: single-fileindex.tsx, plainfetch()+X-WP-Nonce,wp_localize_scripthydration on#workos-users-admin-root, scoped CSS, DI-container registration insrc/WorkOS/Controller.php. No new libraries.src/WorkOS/Admin/Users/Controller.php— service-provider wiring.src/WorkOS/Admin/Users/AdminPage.php— submenu + asset enqueue + localization.src/WorkOS/Admin/Users/RestApi.php— REST proxy +dashboard_urlenrichment.src/js/admin-users/index.tsx+styles.css— React user list.tests/wpunit/AdminUsersRestApiTest.php— 8 cases (33 assertions).integration-workos.php,src/WorkOS/Plugin.php,readme.txt,AGENTS.md. Changelog entries added inCHANGELOG.md+readme.txt.Test plan
bun run build— emitsbuild/admin-users.{js,css,asset.php}cleanly (6.88 KB JS, 1.93 KB CSS).bun run lint:ts— clean.composer lint— clean.composer phpstan— clean (PHPStan level 5, 89 files).slic run tests/wpunit/AdminUsersRestApiTest.php— 8 tests, 33 assertions, all green. Covers: anonymous + subscriber forbidden, shaped response withdashboard_url,limitclamping to 100,emailsubstring forwarding,aftercursor forwarding,afterwins overbefore, upstream error surfacing in envelope.slic run wpunit— 460 tests, 4 failures pre-existing on main, unrelated to this branch (confirmed by reproducing onmainwith no changes applied).wp-admin: confirm the Users submenu appears under WorkOS formanage_optionsusers and is absent for editors; first load returns ≤25 users in < 2 s; search by email narrows the list; Next/Prev cursor pagination round-trips; Open in WorkOS opens the user's Dashboard page in a new tab.GET /wp-json/workos/v1/admin/users.Follow-ups (separate tickets, not in this PR)
email_suppressions/ re-enable endpoint and auser.email_suppressedwebhook event.POST /wp-json/workos/v1/admin/users/bulk-reenable.sort), organization filter, CSV export.