Skip to content

feat: extract Work address card from DashboardFlow into standalone management block#2007

Open
serikjensen wants to merge 1 commit into
mainfrom
feat/work-address-management-block
Open

feat: extract Work address card from DashboardFlow into standalone management block#2007
serikjensen wants to merge 1 commit into
mainfrom
feat/work-address-management-block

Conversation

@serikjensen
Copy link
Copy Markdown
Member

@serikjensen serikjensen commented Jun 3, 2026

Summary

Migrates the Work address card off the monolithic DashboardFlow into a self-contained EmployeeManagement.WorkAddress block, matching the shape of the just-landed Profile (#1976) and Home address (#1992) blocks. The dashboard now composes the standalone card and edit-form pieces directly; the WorkAddress block is the convenient pre-wired composition for partners who want a single drop-in.

Four standalone partner-consumable surfaces under Employee/WorkAddress/:

  • useEmployeeWorkAddressSummaryBaseHookReady-shaped data hook in shared/, wrapping useEmployeeAddressesGetWorkAddresses.
  • WorkAddressCard — self-fetching card with { employeeId, onEvent } shape, fires EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED.
  • WorkAddressEditForm — the existing edit screen, renamed from the old top-level WorkAddress.tsx to free the block name.
  • WorkAddress — orchestrated block with a local robot3 state machine wiring card ↔ edit form.

Scoped event surface (added to src/shared/constants.ts, all new strings prefixed employee/management/workAddress/...):

  • EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED
  • EMPLOYEE_MANAGEMENT_WORK_ADDRESS_CREATED
  • EMPLOYEE_MANAGEMENT_WORK_ADDRESS_UPDATED
  • EMPLOYEE_MANAGEMENT_WORK_ADDRESS_DELETED
  • EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_CANCELLED

No success-alert wiring — Work address is in the migrate skill's "don't introduce one" list. The edit screen is modal-style: create/update/delete keep the user on the edit screen so additional addresses can be managed; only the explicit Back action transitions back to the card.

Dashboard integration (this PR is the last touch for the Work address card; other cards keep the legacy path until their own migrations):

  • dashboardStateMachine retargeted to the scoped events.
  • DashboardComponents.WorkAddressContextual now renders WorkAddressEditForm.
  • BasicDetailsView simplified to a layout wrapper composing the three self-fetching cards (Profile, Home address, Work address). BasicDetailsViewWithData and the tab-scoped useEmployeeBasicDetails hook are deleted — every Basic-details card now self-fetches.
  • Dashboard.test.tsx updated to assert the scoped Work-address event; card-internal coverage moved into the new card and block tests.

i18n namespace introduced as Employee.Management.WorkAddress (using the prefix-style convention from the migrate skill, since this card's migration is the touch event for the file). Strings moved out of Employee.Dashboard:workAddress.* into the block's own namespace; partner override supported via useComponentDictionary.

Generated artifacts refreshed: i18next.d.ts, sdk-app/src/generated-registry-data.ts, and .reports/embedded-react-sdk.api.md.

Test plan

  • npm run test -- --run src/components/Employee/Dashboard src/components/Employee/WorkAddress src/components/Employee/HomeAddress — 122/122 passing
  • npm run lint:check — 0 errors (26 pre-existing warnings)
  • npm run build clean
  • Verify in npm run sdk-app that EmployeeManagement.WorkAddress, EmployeeManagement.WorkAddressCard, and EmployeeManagement.WorkAddressEditForm appear under the Employee Management section and render against demo data
  • Verify in npm run sdk-app that EmployeeManagement.DashboardFlow still wires the Work address card through to the edit form via the dashboard state machine, with Back returning to the card
  • Storybook regression check on Domain/Employee/Dashboard/BasicDetailsView (now a single Default story composing three self-fetching cards)
Screen.Recording.2026-06-03.at.4.29.09.PM.mov

Made with Cursor

…nagement block

Migrates the Work address card off the monolithic DashboardFlow into a
self-contained `EmployeeManagement.WorkAddress` block, matching the
shape of the existing PaymentMethod block and the just-landed Profile
block (#1976). The dashboard now composes the card and edit-form
pieces directly; the block is the convenient pre-wired composition for
partners who want a single drop-in.

Four standalone partner-consumable surfaces under
`Employee/WorkAddress/`:

- `useEmployeeWorkAddressSummary` — `BaseHookReady`-shaped data hook
  in `shared/`, wrapping `useEmployeeAddressesGetWorkAddresses`.
- `WorkAddressCard` — self-fetching card with `{ employeeId, onEvent }`
  shape, fires `EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED`.
- `WorkAddressEditForm` — the existing edit screen, renamed from the
  old top-level `WorkAddress.tsx` to free the block name.
- `WorkAddress` — orchestrated block with a local robot3 state
  machine wiring card ↔ edit form.

Scoped event surface (added to `src/shared/constants.ts`, all new
strings prefixed `employee/management/workAddress/...`):

- `EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED`
- `EMPLOYEE_MANAGEMENT_WORK_ADDRESS_CREATED`
- `EMPLOYEE_MANAGEMENT_WORK_ADDRESS_UPDATED`
- `EMPLOYEE_MANAGEMENT_WORK_ADDRESS_DELETED`
- `EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_CANCELLED`

No success-alert wiring — Work address is in the skill's "don't
introduce one" list. The edit screen is modal-style: create/update/
delete keep the user on the edit screen so additional addresses can
be managed; only the explicit Back action transitions back to the
card.

Dashboard integration (this PR is the last touch for the Work address
card; other cards keep the legacy path until their own migrations):

- `dashboardStateMachine` retargeted to the scoped events.
- `DashboardComponents.WorkAddressContextual` now renders
  `WorkAddressEditForm`.
- `BasicDetailsView` inline work-address markup replaced with
  `<WorkAddressCard employeeId onEvent />`.
- `useEmployeeBasicDetails` slimmed — work address fetch removed
  (the card self-fetches via the new hook).
- Card-internal coverage moved out of `Dashboard.test.tsx` into the
  new card and block tests.

i18n namespace introduced as `Employee.Management.WorkAddress` (using
the prefix-style convention from PR #2006 of the migrate skill, since
this card's migration is the touch-event for the file). Strings moved
out of `Employee.Dashboard:workAddress.*` into the block's own
namespace; partner override supported via `useComponentDictionary`.

Generated artifacts refreshed: `i18next.d.ts`,
`sdk-app/src/generated-registry-data.ts`, and
`.reports/embedded-react-sdk.api.md`.

Co-authored-by: Cursor <cursoragent@cursor.com>
@serikjensen serikjensen marked this pull request as ready for review June 3, 2026 22:56
@serikjensen serikjensen requested a review from a team as a code owner June 3, 2026 22:56
"method": "GET",
"path": "/v1/employees/:employeeId/pay_stubs"
},
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this code verification of the work

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.

3 participants