feat: extract Work address card from DashboardFlow into standalone management block#2007
Open
serikjensen wants to merge 1 commit into
Open
feat: extract Work address card from DashboardFlow into standalone management block#2007serikjensen wants to merge 1 commit into
serikjensen wants to merge 1 commit into
Conversation
…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>
krisxcrash
approved these changes
Jun 3, 2026
jeffredodd
approved these changes
Jun 3, 2026
| "method": "GET", | ||
| "path": "/v1/employees/:employeeId/pay_stubs" | ||
| }, | ||
| { |
Contributor
There was a problem hiding this comment.
I love this code verification of the work
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
Migrates the Work address card off the monolithic
DashboardFlowinto a self-containedEmployeeManagement.WorkAddressblock, 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; theWorkAddressblock 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 inshared/, wrappinguseEmployeeAddressesGetWorkAddresses.WorkAddressCard— self-fetching card with{ employeeId, onEvent }shape, firesEMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTED.WorkAddressEditForm— the existing edit screen, renamed from the old top-levelWorkAddress.tsxto 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 prefixedemployee/management/workAddress/...):EMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_REQUESTEDEMPLOYEE_MANAGEMENT_WORK_ADDRESS_CREATEDEMPLOYEE_MANAGEMENT_WORK_ADDRESS_UPDATEDEMPLOYEE_MANAGEMENT_WORK_ADDRESS_DELETEDEMPLOYEE_MANAGEMENT_WORK_ADDRESS_EDIT_CANCELLEDNo 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):
dashboardStateMachineretargeted to the scoped events.DashboardComponents.WorkAddressContextualnow rendersWorkAddressEditForm.BasicDetailsViewsimplified to a layout wrapper composing the three self-fetching cards (Profile, Home address, Work address).BasicDetailsViewWithDataand the tab-scopeduseEmployeeBasicDetailshook are deleted — every Basic-details card now self-fetches.Dashboard.test.tsxupdated 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 ofEmployee.Dashboard:workAddress.*into the block's own namespace; partner override supported viauseComponentDictionary.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 passingnpm run lint:check— 0 errors (26 pre-existing warnings)npm run buildcleannpm run sdk-appthatEmployeeManagement.WorkAddress,EmployeeManagement.WorkAddressCard, andEmployeeManagement.WorkAddressEditFormappear under the Employee Management section and render against demo datanpm run sdk-appthatEmployeeManagement.DashboardFlowstill wires the Work address card through to the edit form via the dashboard state machine, with Back returning to the cardDomain/Employee/Dashboard/BasicDetailsView(now a singleDefaultstory composing three self-fetching cards)Screen.Recording.2026-06-03.at.4.29.09.PM.mov
Made with Cursor