feat!: migrate Employee.Profile to hook architecture and add steady-state edit mode#1674
Open
feat!: migrate Employee.Profile to hook architecture and add steady-state edit mode#1674
Conversation
…tate edit mode Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…es and remove barrel index Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates Employee.Profile to the hook-based architecture and introduces a new steady-state management edit variant for use inside DashboardFlow, while relocating the legacy onboarding variant under Profile/onboarding/ and updating exports/import paths accordingly.
Changes:
- Added
Employee.Profile/management/Profilefor in-place profile edits (Cancel/Save + success alert) and wiredDashboardFlowto navigate to it onemployee/update. - Relocated onboarding Profile implementation into
Profile/onboarding/and updated onboarding/self-onboarding flows and exports to import the new paths. - Updated
Employee.Profilei18n types and English strings to support the management variant’s Save CTA and success alert.
Reviewed changes
Copilot reviewed 15 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/i18next.d.ts | Adds new Employee.Profile translation keys (saveCta, successAlert) to generated typings. |
| src/i18n/en/Employee.Profile.json | Adds English strings for Save CTA and success alert. |
| src/components/Employee/SelfOnboardingFlow/SelfOnboardingComponents.tsx | Updates Profile import path to the onboarding variant. |
| src/components/Employee/Profile/onboarding/Profile.tsx | Fixes relative import after relocation; retains onboarding Profile API/exports. |
| src/components/Employee/Profile/onboarding/Profile.test.tsx | Relocated/added onboarding Profile test suite under the new directory. |
| src/components/Employee/Profile/onboarding/EmployeeProfile.tsx | Updates hook imports to shared directory after restructure. |
| src/components/Employee/Profile/onboarding/EmployeeProfile.module.scss | Adds styling for onboarding EmployeeProfile layout. |
| src/components/Employee/Profile/onboarding/AdminProfile.tsx | Updates hook imports to shared directory after restructure. |
| src/components/Employee/Profile/onboarding/AdminProfile.module.scss | Adds styling for onboarding AdminProfile layout. |
| src/components/Employee/Profile/management/Profile.tsx | New management edit screen using useEmployeeDetailsForm (update-only) with Cancel/Save + success alert. |
| src/components/Employee/Profile/management/Profile.module.scss | Adds basic container styling for management Profile. |
| src/components/Employee/Profile/index.ts | Removes the prior barrel export. |
| src/components/Employee/OnboardingFlow/onboardingStateMachine.ts | Updates Profile contextual import to onboarding path. |
| src/components/Employee/OnboardingFlow/OnboardingFlowComponents.tsx | Updates ProfileDefaultValues type import path. |
| src/components/Employee/index.ts | Points root Employee.Profile export to onboarding variant. |
| src/components/Employee/exports/employeeOnboarding.ts | Exports onboarding Profile from the new onboarding path. |
| src/components/Employee/exports/employeeManagement.ts | Exports management Profile variant for steady-state use. |
| src/components/Employee/Dashboard/dashboardStateMachine.ts | Adds employee/update -> profile transition and profile state handling CANCEL. |
| src/components/Employee/Dashboard/DashboardComponents.tsx | Adds ProfileContextual that mounts the management Profile variant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+42
to
+49
| const employeeDetails = useEmployeeDetailsForm({ | ||
| companyId: '', | ||
| employeeId, | ||
| withSelfOnboardingField: false, | ||
| optionalFieldsToRequire: { | ||
| update: ['firstName', 'lastName', 'email', 'dateOfBirth', 'ssn'], | ||
| }, | ||
| }) |
Comment on lines
+23
to
+33
| transition( | ||
| componentEvents.EMPLOYEE_UPDATE, | ||
| 'profile', | ||
| reduce( | ||
| (ctx: DashboardContextInterface): DashboardContextInterface => ({ | ||
| ...ctx, | ||
| component: ProfileContextual, | ||
| header: { type: 'minimal' }, | ||
| }), | ||
| ), | ||
| ), |
serikjensen
reviewed
May 5, 2026
| const Components = useComponentContext() | ||
|
|
||
| const employeeDetails = useEmployeeDetailsForm({ | ||
| companyId: '', |
Member
There was a problem hiding this comment.
any reason we're not supplying the company id here? if there's a valid case for not having the company id maybe we need to make company id optional?
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
Employee.Profileto the hook architecture established byFederalTaxesandHomeAddress— relocating the existing onboarding variant into anonboarding/subdirectory and adding a newmanagement/variant for steady-state editing withinDashboardFlow.Changes
Profile/onboarding/— existingAdminProfileandEmployeeProfilerelocated here; no behavioral changesProfile/management/Profile.tsx— new steady-state edit component usinguseEmployeeDetailsForm(update-only); shows first/middle/last name, email, SSN, DOB with Cancel/Save actions and an inline success alertDashboardFlow—employee/updateevent now transitions to aprofilestate; returns toindexonCANCEL(success stays in-place, matching FederalTaxes pattern)employeeOnboarding.ts/employeeManagement.ts— explicit variant exports added;Profile/index.tsbarrel removed; all internal consumers updated to direct pathsTesting
All 49 Profile tests and 7 Dashboard tests pass. Build clean.
Related