Display allocation warning during pending LSF approval (#622)#638
Open
DanielRukwasha wants to merge 21 commits into
Open
Display allocation warning during pending LSF approval (#622)#638DanielRukwasha wants to merge 21 commits into
DanielRukwasha wants to merge 21 commits into
Conversation
Extract allocation logic into app/logic/allocation.py (getAllocationSummary, getAllocationWarning), wire it into modal_approval_and_denial_data() to show a per-department warning box in the approval confirmation modal, and fix demo data so students/supervisors are marked active (needed for the approval checkbox to render at all).
isOverAllocated was a single combined flag, so a department over on one category but fine on the other would show the whole box the same way. Split into isPositionsOverAllocated / isBreakHoursOverAllocated so each metric line is highlighted (with an explicit warning marker, not just color) based on its own status.
Add and update models
…DevTeam/lsf into department-portal-base
Contributor
|
The warning is not popping up when i follow the steps to create that warning. |
Imran found that approving forms into a specific band (e.g. 10 Hour Primary, allocated 1) past its limit showed no warning, because isPositionsOverAllocated only compared the aggregate total across all 6 bands. A department can be under its total while one band is individually over. getAllocationWarning() now also flags any band where used > allocated, and both the pre-approval modal and the post-approval flash name the specific band(s) that are over instead of just the misleading aggregate number. Also removed docstrings that were flagged as too explicit in review.
Demo data fix dpb
…-allocation-warning-lsf-approval # Conflicts: # app/models/allocation.py # app/models/positionHistory.py # database/demo_data.py
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.
Closes #622
Adds a non-blocking over-allocation warning to the pending-LSF approval confirmation modal, so Labor Office admins can see the allocation impact before approving.
Branched off \�llocation-card-real-data-ruk\ (not \�llocation_card\ directly) since this depends on the allocation logic from #636, which hasn't merged yet.
Tested via direct API calls and in-browser: confirmed the warning shows correct numbers, confirmed the red/amber highlighting triggers independently for positions-only and break-hours-only over-allocation scenarios, and confirmed the full approve flow completes correctly end-to-end.