Skip to content

feat!: migrate Employee.Profile to hook architecture and add steady-state edit mode#1674

Open
dmortal wants to merge 2 commits intomainfrom
feat/da/profileState
Open

feat!: migrate Employee.Profile to hook architecture and add steady-state edit mode#1674
dmortal wants to merge 2 commits intomainfrom
feat/da/profileState

Conversation

@dmortal
Copy link
Copy Markdown
Contributor

@dmortal dmortal commented May 5, 2026

Summary

Migrates Employee.Profile to the hook architecture established by FederalTaxes and HomeAddress — relocating the existing onboarding variant into an onboarding/ subdirectory and adding a new management/ variant for steady-state editing within DashboardFlow.

Changes

  • Profile/onboarding/ — existing AdminProfile and EmployeeProfile relocated here; no behavioral changes
  • Profile/management/Profile.tsx — new steady-state edit component using useEmployeeDetailsForm (update-only); shows first/middle/last name, email, SSN, DOB with Cancel/Save actions and an inline success alert
  • DashboardFlowemployee/update event now transitions to a profile state; returns to index on CANCEL (success stays in-place, matching FederalTaxes pattern)
  • employeeOnboarding.ts / employeeManagement.ts — explicit variant exports added; Profile/index.ts barrel removed; all internal consumers updated to direct paths

Testing

# All Profile tests
npm run test -- --run src/components/Employee/Profile/onboarding/Profile.test.tsx

# Dashboard integration
npm run test -- --run src/components/Employee/Dashboard/

# Full build
npm run build

All 49 Profile tests and 7 Dashboard tests pass. Build clean.

Related

dmortal and others added 2 commits May 5, 2026 16:46
…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>
@dmortal dmortal marked this pull request as ready for review May 5, 2026 20:58
Copilot AI review requested due to automatic review settings May 5, 2026 20:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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/Profile for in-place profile edits (Cancel/Save + success alert) and wired DashboardFlow to navigate to it on employee/update.
  • Relocated onboarding Profile implementation into Profile/onboarding/ and updated onboarding/self-onboarding flows and exports to import the new paths.
  • Updated Employee.Profile i18n 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' },
}),
),
),
const Components = useComponentContext()

const employeeDetails = useEmployeeDetailsForm({
companyId: '',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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?

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