Skip to content

feat: home shows the Assessments assigned to you, one tap to sit them - #622

Merged
phamtruonghung merged 1 commit into
mainfrom
wt/t_7b65fe73
Nov 26, 2026
Merged

phamtruonghung merged 1 commit into
mainfrom
wt/t_7b65fe73

Conversation

@phamtruonghung

Copy link
Copy Markdown
Owner

Home now shows the Assessments assigned to the signed-in person. Each open Attempt gets its own card, and tapping it goes straight to the sitting, the same way assigned work already appears on Home.

What changed

  • HomeBloc reads the existing GET /api/people/assessment-attempts/mine, and only when the Account holds PPL_ASSESSMENT_SIT (or carries no permission codes, which is the router's own fallback). A 403, meaning no Employee is linked, is treated as an empty list. Any other failure shows its own failure state with a retry.
  • Home gets an Assessments group (VI "Bài kiểm tra") right after Actions, with one card per Attempt that is assigned or in_progress. Running Attempts come first, then the soonest deadline or due date. A running card's caption gives its deadline; any other card shows number · process · due date. Tapping a card opens Routes.assessmentSitting.
  • If nothing is open, the group is not drawn at all, and the zero still counts towards "nothing waiting".
  • AppStatTile.figure is now optional, so a task card has no number. Tiles that pass a figure render exactly as before.
  • No backend change and no migration.

Tests

frontend/test/home_test.dart, group "Assessments assigned to me":

  • two open Attempts give two cards, the running one first, and a tap opens the sitting
  • nothing open: no group and no card
  • a 403 is empty, not a failure
  • an Account without the sit code never makes the request
  • a failure shows its own state, and retry re-reads

Home now reads the caller's own Attempts (GET /api/people/assessment-attempts/mine)
when the Account may sit Assessments — it holds the sit permission or carries no
permissions at all, the same rule the sitting route's guard applies — and draws one
card per open Attempt (assigned or in progress) in an Assessments group right after
Actions. The running Attempt comes first, then the soonest deadline or due date, then
the number; a tap opens the sitting. A 403 (no Employee) is an empty list, nothing open
draws nothing, and any other failure is the section's own failure with its own retry.
No backend change. AppStatTile's figure becomes optional so an Attempt card, a task
rather than a tally, shows no count; tiles with a figure draw exactly as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@phamtruonghung
phamtruonghung merged commit 4c62938 into main Nov 26, 2026
4 of 8 checks passed
phamtruonghung added a commit that referenced this pull request Nov 26, 2026
# Conflicts:
#	frontend/lib/home_bloc.dart
#	frontend/lib/home_screen.dart
#	frontend/lib/l10n/app_en.arb
#	frontend/lib/l10n/app_localizations.dart
#	frontend/lib/l10n/app_localizations_en.dart
#	frontend/lib/l10n/app_localizations_vi.dart
#	frontend/lib/l10n/app_vi.arb
#	frontend/test/home_test.dart
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.

1 participant