Add over-allocation warning on labor status form (#615)#646
Open
DanielRukwasha wants to merge 105 commits into
Open
Add over-allocation warning on labor status form (#615)#646DanielRukwasha wants to merge 105 commits into
DanielRukwasha wants to merge 105 commits into
Conversation
…ta to demo_data.py
…nhistory info to change the primary key field so position code shows
…_peeweeAttribute Nahom dee alpha peewee attribute
…-CG-BS Pee wee attribute cg bs
…Data_JJ Allocation demo data jj
…-card-real-data-ruk # Conflicts: # app/controllers/main_routes/main_routes.py # app/templates/main/departmentPortal.html # database/demo_data.py # database/migrate_db.sh
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
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
…ation-warning-lsf-creation # Conflicts: # app/static/css/base.css
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 #615. Shows a non-blocking allocation warning when creating a labor status form that would put the department over its allocation for the selected job type/hours band.