Some checks are pending
Bidi Control Character Guard / bidi-control-guard (push) Waiting to run
Circular Dependency Check / Check for new circular dependencies (push) Waiting to run
Citus Migration Smoke / Combined migrations on single-node Citus (push) Waiting to run
E2E Fresh Install Tests / fresh-install-e2e (push) Waiting to run
ext-v2 guardrails / Run ext-v2 guard and ESLint (push) Waiting to run
Integration Tests / Check for relevant changes (push) Waiting to run
Integration Tests / ${{ (github.event_name == 'schedule' || github.event.inputs.suite == 'full') && 'Full integration suite' || 'Tier-1 integration subset' }} (push) Blocked by required conditions
Mobile checks / Mobile lint + typecheck (push) Waiting to run
Mobile checks / Mobile unit tests (push) Waiting to run
Mobile checks / Mobile dependency audit (report) (push) Waiting to run
Mobile checks / Mobile reproducibility checks (push) Waiting to run
Secrets guard (env backups) / Ensure no tracked env backup files (push) Waiting to run
Temporal Readiness / fast-readiness (push) Waiting to run
Temporal Readiness / docker-parity (push) Waiting to run
TypeScript Type Check / Nx affected typecheck (push) Waiting to run
Unit Tests / Skipped-test budget (push) Waiting to run
Unit Tests / Nx affected unit tests (push) Waiting to run
Unit Tests / Server unit coverage (informational) (push) Waiting to run
Validate Tenant Management Schema / Check for relevant changes (push) Waiting to run
Validate Tenant Management Schema / Validate Tenant Management Schema (push) Blocked by required conditions
EE Workflows Build Guard / ee-workflows-build-guard (push) Waiting to run
Excluded: .git, node_modules, secrets/, compose.env, assemblyscript tgz Source: /opt/alga-psa on psa.joliet.tech
9.0 KiB
9.0 KiB
Scratchpad — Bidirectional Task-Ticket Creation
- Plan slug:
2026-02-05-bidirectional-task-ticket - Created:
2026-02-05
Decisions
- (2026-02-05) Priorities are NOT transferred between tasks and tickets — they are separate systems with separate priority tables (
item_type = 'project_task'vsitem_type = 'ticket'). - (2026-02-05) Client for ticket creation is mapped from
IProject.client_idat the project level, not the task level. Tasks don't have clients. - (2026-02-05) Auto-linking is optional via a checkbox/toggle (default: on).
- (2026-02-05) Task
estimated_hoursis stored in MINUTES in the database. Display and ticket values are in HOURS. Must convert when mapping. - (2026-02-05) Ticket
descriptionis NOT onITicketinterface but IS stored in the DB and accessible via FormData / consolidated ticket data attributes. - (2026-02-05) Use render-prop injection pattern for cross-package composition (TicketDetails → MspTicketDetailsContainerClient), consistent with
renderContactDetailsandassociatedAssetspatterns.
Progress
- (2026-02-05) Implemented
mapTicketToTaskFieldsmapping utility inpackages/projects/src/lib/taskTicketMapping.tsfor ticket→task prefill defaults (safe defaults, due date parsing, estimated hours passthrough). - (2026-02-05) Added
mapTaskToTicketPrefillinpackages/projects/src/lib/taskTicketMapping.tsto derive ticket prefill data from tasks and project client (minutes→hours conversion, client id/name). - (2026-02-05) Explicitly ignored
priority_idin both mapping directions to enforce non-mapping of priorities. - (2026-02-05) Added
PrefillFromTicketDialogcomponent with searchableTicketSelectand lazy ticket list loading. - (2026-02-05) Added auto-link checkbox (default on) to
PrefillFromTicketDialogto control link creation. - (2026-02-05) Prefill dialog now fetches consolidated ticket data and returns mapped task prefill fields via
mapTicketToTaskFields. - (2026-02-05) Added
prefillDatasupport inTaskFormto initialize fields and pending ticket link for create-mode prefill. - (2026-02-05) Added create-mode-only Ticket icon button with tooltip "Create from ticket" next to Task Name label.
- (2026-02-05) Wired
PrefillFromTicketDialogintoTaskFormto populate fields and optionally add a pending ticket link. - (2026-02-05) Added
prefilledTitlesupport inQuickAddTicketfor title initialization and resets. - (2026-02-05) Added
prefilledAssignedTosupport inQuickAddTicketfor assigned user initialization and resets. - (2026-02-05) Added
prefilledDueDatesupport inQuickAddTicketwith safe date parsing for the date picker. - (2026-02-05) Added
prefilledEstimatedHourssupport and an Estimated Hours input inQuickAddTicket. - (2026-02-05) QuickAddTicket now appends
estimated_hoursto FormData when provided. - (2026-02-05) Parsed
estimated_hoursinaddTicketand plumbed it throughticketModelcreation/schema. - (2026-02-05) Added
taskDataprop toTaskTicketLinksfor passing current task field values. - (2026-02-05) TaskTicketLinks now fetches project client data before opening QuickAddTicket.
- (2026-02-05) TaskTicketLinks now maps task data to QuickAddTicket prefill props (title/description/assignee/due date/estimated hours + client).
- (2026-02-05) TaskForm now passes edit-mode field values as
taskData(minutes) into TaskTicketLinks. - (2026-02-05) Added
CreateTaskFromTicketDialogwith project selector and supporting state for project-driven task creation. - (2026-02-05) CreateTaskFromTicketDialog now refreshes phases/statuses whenever the selected project changes.
- (2026-02-05) Phase selector now derives options from fetched phases and disables when none are available.
- (2026-02-05) Status selector now derives options from fetched statuses and disables when none are available.
- (2026-02-05) CreateTaskFromTicketDialog resets auto-link checkbox to on when opened.
- (2026-02-05) CreateTaskFromTicketDialog now opens TaskQuickAdd in a drawer with ticket-derived prefill data and optional pending link.
- (2026-02-05) TaskQuickAdd now accepts
prefillDataand forwards it into TaskForm. - (2026-02-05) Added
renderCreateProjectTaskrender prop hook inTicketDetailsheader area. - (2026-02-05) TicketDetailsContainer now forwards
renderCreateProjectTaskto TicketDetails. - (2026-02-05) MSP ticket container now injects CreateTaskFromTicketDialog via
renderCreateProjectTask. - (2026-02-05) Exported CreateTaskFromTicketDialog from projects components index.
- (2026-02-05) Added initial unit test for
mapTicketToTaskFieldstitle→task_name mapping. - (2026-02-05) Added unit test for
mapTicketToTaskFieldsdescription mapping. - (2026-02-05) Added unit test for
mapTicketToTaskFieldsassigned_to mapping. - (2026-02-05) Added unit test for
mapTicketToTaskFieldsdue_date ISO→Date conversion. - (2026-02-05) Added unit test for
mapTicketToTaskFieldsestimated hours passthrough. - (2026-02-05) Added unit test ensuring
mapTicketToTaskFieldsdefaults null/undefined safely. - (2026-02-05) Added unit test for
mapTaskToTicketPrefilltask_name→title mapping. - (2026-02-05) Added unit test for
mapTaskToTicketPrefillestimated hours minutes→hours conversion. - (2026-02-05) Added unit test verifying
mapTaskToTicketPrefillincludes project client metadata. - (2026-02-05) Added tests ensuring priority_id is not included in either mapping output.
- (2026-02-05) Added PrefillFromTicketDialog test for search input and dropdown rendering.
- (2026-02-05) Added PrefillFromTicketDialog test ensuring ticket fetch occurs on open.
- (2026-02-05) Added PrefillFromTicketDialog test for auto-link checkbox default state.
- (2026-02-05) Added PrefillFromTicketDialog test ensuring unchecked auto-link yields shouldLink=false.
- (2026-02-05) Added PrefillFromTicketDialog test verifying consolidated ticket fetch on confirm.
- (2026-02-05) Added PrefillFromTicketDialog test ensuring mapped fields returned to onPrefill.
- (2026-02-05) Added TaskForm prefill tests: task_name, description, assigned_to, due_date, estimated_hours, and pending ticket link initialization.
- (2026-02-05) Added TaskForm create-from-ticket tests: auto-link on/off link handling and field population.
- (2026-02-05) Added MSP container test for CreateTaskFromTicketDialog injection.
- (2026-02-05) Added E2E-style TaskForm create-from-ticket test (prefill + link on save).
- (2026-02-05) Added E2E-style TaskTicketLinks test for create-ticket prefill props.
- (2026-02-05) Added E2E-style CreateTaskFromTicketDialog test for drawer open flow.
- (2026-02-05) Added test ensuring priority is not prefilled in create-ticket flow.
Discoveries / Constraints
- (2026-02-05)
TicketSelectcomponent already exists atpackages/projects/src/components/TicketSelect.tsx— reusable for ticket search in Scenario 1. - (2026-02-05)
QuickAddTicketalready hasprefilledClient,prefilledContact,prefilledDescriptionprops. Need to add:prefilledTitle,prefilledAssignedTo,prefilledDueDate,prefilledEstimatedHours. - (2026-02-05)
addTicketserver action does NOT parseestimated_hoursfrom FormData (line ~220 in ticketActions.ts). Must add. - (2026-02-05)
TaskFormhasprefillData-like initialization already:useState(task?.task_name || ''). Can extend with aprefillDataprop. - (2026-02-05) No
ProjectPickerorPhasePickercomponents exist. UseCustomSelectwithgetProjects()andgetProjectTreeData(). - (2026-02-05)
useDrawerhook supports opening TaskForm in a drawer with full history management. - (2026-02-05)
TaskQuickAddwrapsTaskForm— need to passprefillDatathrough. - (2026-02-05) React synthetic events propagate through portals. QAT form submit was bubbling to TaskForm — fixed with
e.stopPropagation().
Commands / Runbooks
- Build check:
npx tsc --noEmit -p packages/projects/tsconfig.json && npx tsc --noEmit -p packages/tickets/tsconfig.json - Run dev:
npm run dev
Links / References
- Key files:
packages/projects/src/components/TaskForm.tsx— main task form (create/edit)packages/projects/src/components/TaskTicketLinks.tsx— ticket linking in task formpackages/projects/src/components/TicketSelect.tsx— searchable ticket selectorpackages/tickets/src/components/QuickAddTicket.tsx— inline ticket creationpackages/tickets/src/components/ticket/TicketDetails.tsx— ticket detail viewpackages/tickets/src/components/ticket/TicketDetailsContainer.tsx— container with injection propspackages/msp-composition/src/tickets/MspTicketDetailsContainerClient.tsx— MSP composition layerpackages/tickets/src/actions/ticketActions.ts— addTicket server actionpackages/projects/src/actions/projectActions.ts— getProjects, getProjectTreeDatapackages/projects/src/actions/projectTaskActions.ts— addTicketLinkActionpackages/types/src/interfaces/ticket.interfaces.ts— ITicketpackages/types/src/interfaces/project.interfaces.ts— IProjectTask
Open Questions
- None currently — all clarified with user.