changes in new-allocation-card - #654
Open
conwelld wants to merge 24 commits into
Open
Conversation
fritzj2
requested changes
Jul 21, 2026
fritzj2
reviewed
Jul 21, 2026
Author
|
Thanks for looking into this. I have fixed the comments you have made (removed code from other branches and added comments to logic) |
fritzj2
reviewed
Jul 21, 2026
fritzj2
requested changes
Jul 21, 2026
Contributor
|
No logic file and tests needed yet because the logic related to pulling allocations and allocation utilization will be standardized by another team, whereupon this will have to be modified to use those functions. |
…everything touching the 202500
…rvice. See #657 but beyond that we created allo files
MImran2002
requested changes
Jul 22, 2026
MImran2002
requested changes
Jul 29, 2026
…tract countWorkers/getBreakHours with FormHistory approval filter, dynamic term in departmentPortal.html, and revert environment-specific path edits in base_data.py/demo_data.py. Add integration test coverage for the new logic functions.
…ve conflicts with the new Members card feature
…llocation.py, excluding denied forms from countWorkers and the used count. Update tests to cover the new behavior.
…wording, and aligned Primary/Secondary table Replace the raw "AY 2025-2026" term name with a computed current-semester label (e.g. "Fall 2025") derived from the term's own year and today's month, matching the Fall/Spring termCode convention used elsewhere. Reword ratios as "X of Y" instead of "X/Y", rename the card title to "Current Allocation", and rebuild the Primary/Secondary breakdown as a single table so every row (term info, headers, hour buckets, break hours) shares the same column alignment and stays legible down to mobile widths.
…ment-portal-base merge The base branch (department-portal-base) moved managePositions out of main_routes.py into its own departmentPortal.py with proper permission checks (commit ee19d87), but merging that branch in and accepting both sides left the old, now-dead copy in main_routes.py alongside the new file, so Flask registered two view functions under the same endpoint name and crashed on startup with "View function mapping is overwriting an existing endpoint function: main.managePositions". Remove the stale duplicate (it also referenced an unimported Tracy class) and the duplicate departmentPortal import in __init__.py from the same merge.
…s)" format and drop Break Hours
Match the supervisor's whiteboard mockup: each Primary/Secondary hour
bucket now reads as two lines ("10 hr: 2 contracts" / "(out of 5
allocations)") with correct singular/plural wording, via a small Jinja
macro to avoid repeating the format six times. Break Hours is removed
from the card entirely. Column alignment (left edges shared across the
term row, headers, and hour rows) is unchanged, and the pinch-zone
media query is retuned for the new, longer per-row text so nothing
clips or overflows at narrow widths.
MImran2002
requested changes
Aug 3, 2026
…solidated tests - Rename allocation_summary and its snake_case keys/locals to camelCase (allocationSummary, currentSemester, usedPositions, breakHours, used10, usedSecondary5, ...) across the logic, route, template, and tests - Shorten the getCurrentSemesterLabel docstring - Reword the card to Contracted/Allocated in both the tooltip and the position count - Stack Secondary below Primary (and the count below the term) on narrow cards by splitting the paired table into two, instead of shrinking the font - Point the not-yet-built View Allocations page at "#" like the Members card, so the button no longer 404s - Collapse the per-scenario tests into one test per function, drop the leading underscore from createFormHistory, and mark the unit test so run_tests.sh stops deselecting it - Cover the used-count denial filter and make the term filter and the getBreakHours other-term assertion actually meaningful - Revert unrelated whitespace/formatting churn in main_routes.py
MImran2002
requested changes
Aug 4, 2026
MImran2002
requested changes
Aug 4, 2026
…SoftwareDevTeam/lsf into new-allocation-card # Conflicts: # database/demo_data.py
getDepartmentAllocationSummary now calls allocationManager's getTotalAllocations/getContractedAllocations instead of reimplementing the same counts, removing countWorkers/getBreakHours and the manual Allocation SUM query. Falls back to zeroed defaults for a most-recent term that only has a draft allocation (no final row yet), and coalesces getContractedAllocations' break_hours since its SQL SUM() can return None. Updated test_getAllocation.py to match: removed the now-redundant countWorkers/ getBreakHours unit tests, updated the multi-row-allocation expectation to reflect final-only summing, and added coverage for the draft-only fallback.
database/demo_data.py called LaborReleaseForm.insert(...) but never imported the model, so any fresh database/reset_database.sh run failed with a NameError partway through seeding demo data. Pre-existing bug from the department-portal-base merge, unrelated to the allocation card changes.
…llocation Root cause: allocationManager's getContractedAllocations called getAllocation (isFinal=True only) for a value it never used, so any department whose most recent term only has a draft (not yet final) Allocation row raised DoesNotExist. getAllocation.py's earlier try/except caught that and fell back to zeroed defaults, which is why real demo data (departments with only draft allocations) started rendering 0s instead of their actual numbers. - allocationManager.py: removed the dead getAllocation() call from getContractedAllocations. Also folded its break-hours query to filter by department directly in SQL instead of fetching every department's totals and picking the first match after grouping by (department, termCode) - that grouping meant a department with approved break hours under both the specific term and the academic-year "00" bucket term would silently keep only whichever row came back first instead of summing them. Coalesces the SQL SUM() to 0 instead of leaving it None. - getAllocation.py: "allocated" is now summed directly from the Allocation rows already fetched for the most recent term (draft + final, matching the original pre-refactor behavior) instead of going through getTotalAllocations, which only looks at the final row. Dropped the DoesNotExist fallback - no longer needed now that the crash source is fixed at the root. - Updated test_getAllocation.py's multi-row and draft-only cases to expect the correct summed/draft values instead of the zeroed fallback. - Added two regression tests to test_allocationManger.py: getContractedAllocations without any Allocation row present, and break hours summed across a specific term and its academic-year bucket term.
munsakad
force-pushed
the
new-allocation-card
branch
from
August 5, 2026 18:53
102ee32 to
77eabdf
Compare
munsakad
force-pushed
the
new-allocation-card
branch
from
August 5, 2026 19:10
77eabdf to
f3b43c6
Compare
MImran2002
requested changes
Aug 5, 2026
| departments = departments, | ||
| department = dept, | ||
| allocation = allocation, | ||
| allocated = allocationSummary["allocated"], |
Contributor
There was a problem hiding this comment.
I believe I have comment on this before if we are rendering allocationsummary with multiple variables we can just send the allocationsummary to jinja and use {{ allocatedsummary.allocated }} to access the elements inside while in the macros like {% macro allocationRow(hours, used, allocationsummary) -%}
you just use allocationsummary instead
| margin: 10px 0; | ||
| } | ||
| .allocation-columns { | ||
| display: flex; |
Contributor
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.


Allocation card revert merge
Changes
Testing