Skip to content

changes in new-allocation-card - #654

Open
conwelld wants to merge 18 commits into
department-portal-basefrom
new-allocation-card
Open

changes in new-allocation-card#654
conwelld wants to merge 18 commits into
department-portal-basefrom
new-allocation-card

Conversation

@conwelld

Copy link
Copy Markdown

Allocation card revert merge

  • There was no way to access an allocation card from the department portals page, where one could view a summary of their allocations and click a view allocation button.

Changes

  • Added summary to the view allocation card that changes based on demo data
  • Added CSS styling to the HTML file
  • added allocation logic to the main routed file that iterates through labor status forms
  • Changed HTML to have card space for all three cards to be added
  • added demo data to students and forms so data looked more presentable
  • added information icon to AY as well as the break hours to give more context to what users are seeing.
  • added CSS styling to make the information icon
  • added JavaScript to allow for Bootstrap tooltips
  • added css styling that changes based on window size
image image image

Testing

  • Used 'flask run' to load the page, and everything shows up as it should
  • Reset the database, and no errors arose

@conwelld conwelld self-assigned this Jul 21, 2026
@conwelld
conwelld requested review from BetterRocket and fritzj2 July 21, 2026 14:59
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
@conwelld conwelld changed the title added changes from previous branch to avoid all files being commited new-allocation-card changes in new-allocation-card Jul 21, 2026
Comment thread app/static/css/departmentPortal.css Outdated
@conwelld

Copy link
Copy Markdown
Author

Thanks for looking into this. I have fixed the comments you have made (removed code from other branches and added comments to logic)

Comment thread app/static/css/departmentPortal.css Outdated
fritzj2

This comment was marked as outdated.

Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread database/demo_data.py Outdated
@BetterRocket

Copy link
Copy Markdown
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.

…rvice.

  See #657 but beyond that we created allo files
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread database/reset_database.sh
Comment thread app/templates/main/departmentPortal.html Outdated
Comment thread app/templates/main/departmentPortal.html Outdated
Comment thread app/templates/main/departmentPortal.html Outdated
Comment thread app/templates/main/departmentPortal.html Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/logic/getAllocation.py
Comment thread app/logic/getAllocation.py Outdated
Comment thread app/logic/getAllocation.py Outdated
Comment thread app/logic/getAllocation.py Outdated
Comment thread database/base_data.py Outdated
Comment thread database/demo_data.py Outdated
Comment thread database/demo_data.py
Comment thread database/demo_data.py
Comment thread app/logic/getAllocation.py
…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
@DanielRukwasha
DanielRukwasha requested review from MImran2002 and removed request for fritzj2 July 30, 2026 14:21
DanielRukwasha and others added 5 commits July 30, 2026 11:12
…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.
Comment thread app/static/css/departmentPortal.css
Comment thread app/templates/main/departmentPortal.html Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py
Comment thread app/logic/getAllocation.py Outdated
Comment thread app/logic/getAllocation.py Outdated
Comment thread tests/code/test_getAllocation.py Outdated
Comment thread tests/code/test_getAllocation.py Outdated
Comment thread tests/code/test_getAllocation.py Outdated
…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
Comment thread app/controllers/main_routes/main_routes.py
"usedSecondary10": 0,
},
"breakHours": 0,
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when Chris's allocationManager is merge you will have to revisit the logic

@@ -1,4 +1,6 @@

export FLASK_APP="$(cd "$(dirname "$0")/.." && pwd)/app.py"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you should remove this as touching tracy is out of your scope

# Weekly-hours form (contractHours=None) - should be excluded regardless
formC = LaborStatusForm.create(
termCode=term, studentSupervisee=student, supervisor=supervisor, department=dept,
jobType="Primary", WLS="10", POSN_TITLE="Weekly Job", POSN_CODE="S022",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when chris merge his logic in some of these test might become irrelevant so just to take notes and prepare for that

@MImran2002 MImran2002 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image make sure the 5 hours and 10 hours stick to the top too instead of spread out

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.

6 participants