Repository navigation
Add frontend lint and build to CI and fix lint errors - #1
Merged
Merged
Conversation
CI only built and tested the .NET solution; the React frontend was never validated, and npm run lint failed with two react-hooks/set-state-in-effect errors. - Add a frontend job (npm ci, lint, build) next to the .NET job and run CI on pull requests to any base branch - Load initial dashboard and weekly schedule data in effects that only set state in promise callbacks - Refresh after generating or resetting a schedule without replacing the dashboard with the full-page loading state - Reload employee preference profiles after a demo reset; previously they stayed empty or stale until a browser reload Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
.github/workflows/dotnet.ymlrestored, built and tested the backend. The React/TypeScript frontend (about 2,100 lines) was never installed, type-checked, linted or built in CI.npm run lintfailed onmainwith 2 ×react-hooks/set-state-in-effect(inApp.tsxandWeeklyScheduleTable.tsx), so lint could not simply be added to CI.loadOverview()setisLoading = true. The whole dashboard was replaced by "Henter data..." and the weekly schedule was unmounted and remounted.Solution
CI):frontendjob:npm ci→npm run lint→npm run build(tsc -b+ Vite), Node 24 with npm cache.pull_requestnow runs for every base branch, so stacked PRs are validated too. Addedpermissions: contents: readand concurrency.App.tsx:true.refreshAfterDataChange(), which updates the data without the full-page loading state and still bumps the schedule refresh key.WeeklyScheduleTable.tsx: data is loaded in the effect (keyed onrefreshKeyplus a retry counter). The current week stays visible while it refreshes, and "Prøv igen" still shows the loading state.No changes to the scheduling logic, API or backend.
Test results
GitHub Actions: see the checks on this PR (backend + frontend jobs).
Limitations
http://localhost:5026in eachapi/*.tsfile. The follow-up PR centralizes it.🤖 Generated with Claude Code