feat(applications): PATCH history entries and Stage History editor (#11)#17
Merged
feat(applications): PATCH history entries and Stage History editor (#11)#17
Conversation
Add PATCH endpoint and UI to edit application history entries. Backend: introduce ApplicationHistoryUpdate schema, implement update_history_entry with validation and current_stage recalculation, factor out _get_latest_history_entry and reuse it in delete_history_entry. Frontend: add updateHistoryEntry API and types, extend StageHistoryDialog with an edit dialog (fields: stage, date, notes) and wire up save/cancel flows, plus related UI/type fixes across components (ApplicationDetailDialog variable usage, ApplicationTable ColumnDef typing, calendar/appointment locale/timeFormat propagation, timezone label display, and a minor api-client typing fix).
Add unit tests for applications UI (ApplicationTable, StageHistoryDialog, ApplicationsPage) using Vitest and Testing Library with mocks for services and hooks. Introduce vitest.config.ts and vitest.setup.ts (jsdom environment, jest-dom, ResizeObserver stub and pointer-capture shims). Add test scripts and testing devDependencies to the web package.json and a workspace test script in frontend/package.json. Also add accessibility improvements: aria-label on the Stage history button and pass-through of aria-describedby in the shared Dialog component.
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
Adds PATCH support for application history entries (API + validation +
current_stagehandling), a Stage History edit flow in the UI, Vitest coverage for key applications surfaces with jsdom setup and Radix-friendly polyfills, small a11y tweaks and env example cleanup aligned with the current stack and setup.Changes
Application history (backend + frontend)
PATCHfor application history updates;ApplicationHistoryUpdateschema;update_history_entrywith validation and current stage recalculation after edits._get_latest_history_entryextracted and reused from delete (and related history logic).updateHistoryEntryinapplications.service.ts; OpenAPI-generated types updated (api.generated.ts, exports).StageHistoryDialog— secondary dialog to edit stage, date, notes; save/cancel, toasts, refetch /onStageChangedbehavior.Related UI / typing fixes
ApplicationDetailDialog— variable usage fixes.ApplicationTable—ColumnDeftyping adjustments.timeFormatpropagation where needed.localeandtimeFormatintoAppointmentCardfor consistent formatting.api-client— minor typing fix.Tests and tooling
frontend/apps/web:vitest.config.ts(jsdom, aliases),vitest.setup.ts(@testing-library/jest-dom/vitest,ResizeObserverstub, pointer-capture /scrollIntoViewshims for Radix Select).__tests__/ApplicationTable.test.tsx,StageHistoryDialog.test.tsx,applications-page.test.tsx(mocked services/hooks; assertions on calls, refetch, validation paths).package.json:webtest script + devDependencies;frontendroot script to run web tests.pnpm-lock.yamlupdated for new deps.Accessibility
aria-labelon the trigger button.Dialog(packages/ui): forwardaria-describedbyfor better descriptions with screen readers.Config samples
backend/.env.example: local vs Docker blocks with{placeholder}tokens (pick one block in real.env).frontend/apps/web/.env.example: documented (e.g.NEXT_PUBLIC_API_URL) as applicable.Notes