Skip to content

Manage Departments Page Update - #648

Open
ACBerea wants to merge 85 commits into
department-portal-basefrom
dep_portal_ad_ManageDepartments
Open

Manage Departments Page Update#648
ACBerea wants to merge 85 commits into
department-portal-basefrom
dep_portal_ad_ManageDepartments

Conversation

@ACBerea

@ACBerea ACBerea commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Issue Description

Fixes Issue #623

  • Display the allocation of all departments on the Manage Departments page.

Changes

  • Added 4 new buttons at the top of the Manage Departments page: Upload Allocations, Download Allocation History, Annual Allocation Review, and Annual Position Review.
  • Created 3 new columns: Current Allocations, Requested Allocations, and Actions.
    • The Current Allocations column displays approved allocations for the current academic year, which includes primary positions, secondary positions, and break hours. If the department has no current approved allocation, "no current allocations" should be displayed.
    • The Requested Allocations column is supposed to display requested allocations for the next academic year.
    • The Actions column has an action button, which allows the admin to manage departments (view its positions, allocation history, faculty members, along with sending an allocation review).
  • Added modals/popups for the Annual Allocation Review and Annual Position Review buttons.

Changes (Once PR #668 Gets Merged)

  • Made the Allocation Review button work with the backend.
  • Created a new getCurrentAndNextAY() function, which returns the current and the following academic years.
  • Added an allocationExists() function, which checks whether an allocations matching certain criteria exist.

Changes (Once PR #662 Gets Merged)

  • Made the Annual Position Review button work with the backend.
  • Added an email template for annual position reviews.

To-Do List (on August 7) ❗

  • If the department does not request an allocation, the table should just show “not requested.” If it requests an allocation and the allocation is approved, it should show “approved.”

  • On the Requested Allocations column, we must display allocations requested for the next year instead of current approved allocations.

  • Inactive departments can request allocations, but labor supervisors cannot see these requests and cannot approve them unless they type the URL. It is all because the Allocation Review button is only for active departments.

  • (Possible/Optional Change) Implementing all the functions from allocationManager.py into the Manage Departments page.

image

Manual Testing

  • Check if the Status toggle properly switches between In Compliance and Not in Compliance (you can also reload the page and rerun Flask to check if the changes get saved to the database).
  • Switch between different available years in the Academic Year dropdown. As you switch between years pay attention to the URL and the Allocation Status header: they must reflect the chosen year.
  • Click on the Annual Allocation Review and Annual Position Review buttons to make sure the modals actually pop up.

Testing with Test Suites

  • Type pytest tests/code/test_manageDepartments.py in the command line to run all the test suites written for the Manage Departments page.
  • Type pytest tests/code/test_academicYearManager.py in the CLI to test the getCurrentAndNextAY() function.
  • Type pytest tests/code/test_allocationManger.py in the CLI to test the allocationExists() function.

zhytkovd and others added 30 commits July 2, 2026 20:56
…rmName to academicYear in manageDepartments.html
…website. Added commented out code for the pending variation of the Approved Button in manageDepartments.html.
…will now change based on if the allocation isFinal from either pending or approved.
@ArtemKurasov ArtemKurasov added epic A project that will require multiple sub-tasks to complete and removed draft labels Jul 29, 2026
@ArtemKurasov
ArtemKurasov requested a review from BhushanSah July 30, 2026 14:00
Comment thread app/logic/manageDepartments.py Outdated
.group_by(LaborStatusForm.department, LaborStatusForm.termCode).dicts()
)

print(list(totalBreakSum))

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.

This debug print should be removed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thank you for pointing this out

on = (LaborStatusForm.termCode == Term.termCode)
)
.where(
(FormHistory.historyType == "Labor Status Form") &

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.

Should this also filter FormHistory.historyType == "Labor Status Form"? Right now it only checks Approved status, so other approved history rows could accidentally be included in the position counts.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Honestly, I am not sure. Actually, this will probably be fully replaced

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This filter is actually in the code! It's on line 81

@@ -0,0 +1,189 @@
import pytest

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.

Could we clean this test file before merging? There are several unused imports and a large commented-out test block. It would be better to keep only the active tests and the imports they need.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I will clean this all up

Chosen AY: {{ academicYear.split(" ")[1] }}
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1" style="width: 200px; text-align: center;">

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.

Academic year dropdown opens

    but does not clearly close
before closing the dropdown div.

<td style="white-space: nowrap">
<div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu1"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">

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.

Action dropdown/table row markup looks unbalanced. There is an extra closing before .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

epic A project that will require multiple sub-tasks to complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants