mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage
synced 2026-05-18 20:08:19 +00:00
feat(onboarding/phase-6): setup wizard polish, seed script alignment, doctor visit slots
- Setup wizard: 3-pane layout with right-side live previews, resume banner, edit/copy icons on team step, AI prompt configuration - Forms: employee-create replaces invite-member (no email invites), clinic form with address/hours/payment, doctor form with visit slots - Seed script: aligned to current SDK schema — doctors created as workspace members (HelixEngage Manager role), visitingHours replaced by doctorVisitSlot entity, clinics seeded, portalUserId linked dynamically, SUB/ORIGIN/GQL configurable via env vars - Pages: clinics + doctors CRUD updated for new schema, team settings with temp password + role assignment - New components: time-picker, day-selector, wizard-right-panes, wizard-layout-context, resume-setup-banner - Removed: invite-member-form (replaced by employee-create-form per no-email-invites rule) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
src/components/setup/wizard-layout-context.tsx
Normal file
27
src/components/setup/wizard-layout-context.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { createContext } from 'react';
|
||||
|
||||
// Context that lets each WizardStep render content into the wizard
|
||||
// shell's right pane via a portal — without lifting per-step data
|
||||
// fetching up to the page. The shell sets `rightPaneEl` to the
|
||||
// `<aside>` DOM node once it mounts; child WizardStep components read
|
||||
// it and createPortal their `rightPane` prop into it.
|
||||
//
|
||||
// Why a portal and not a state-lifted prop on WizardShell:
|
||||
// - The right pane is tightly coupled to the active step's data
|
||||
// (e.g. "list of clinics created so far") which lives in the step
|
||||
// component's state. Lifting that state to the page would mean
|
||||
// duplicating the data-fetching layer, OR re-querying everything
|
||||
// from the page.
|
||||
// - Trying to pass `rightPane: ReactNode` upward via callbacks
|
||||
// either causes a one-frame flash (useEffect) or violates the
|
||||
// "no setState during render" rule.
|
||||
// - Portals are React-native, no extra render cycles, and the
|
||||
// DOM target is already part of the layout.
|
||||
|
||||
export type WizardLayoutContextValue = {
|
||||
rightPaneEl: HTMLElement | null;
|
||||
};
|
||||
|
||||
export const WizardLayoutContext = createContext<WizardLayoutContextValue>({
|
||||
rightPaneEl: null,
|
||||
});
|
||||
Reference in New Issue
Block a user