Skip to content

Adding the Manage Members Page#649

Open
brightfietsop-ux wants to merge 33 commits into
department-portal-basefrom
Bright_Artem_manage_people
Open

Adding the Manage Members Page#649
brightfietsop-ux wants to merge 33 commits into
department-portal-basefrom
Bright_Artem_manage_people

Conversation

@brightfietsop-ux

@brightfietsop-ux brightfietsop-ux commented Jul 20, 2026

Copy link
Copy Markdown

We have added the Manage Members page, which can be accessed through the Members card on the Department Portal.

WHAT'S WORKING:

  • The names of supervisors are correctly pulled from the demo data.
  • Supervisees are properly displayed (on the table, active means the student has approved their labor status form, and - pending means they have not done that yet).
  • The Assign Coordinator switch works!
  • The Ban/Unban Button also works!
  • You can remove members by clicking on the trash icon to the right
  • The Add Members dropdown/button technically works.
  • The Ban/Unban button and the Remove Member button are displayed ONLY FOR ADMINS (as it is supposed to be).

WHAT'S NOT WORKING:

  • we cannot directly access the page using the manage member button
  • When supervisors are assigned as LC, they get assigned in every department.
  • We cannot add department members who are not supervisors
  • All staff members are supervisors

@ArtemKurasov ArtemKurasov changed the title Bright artem manage people Adding the Manage Members Page Jul 20, 2026
@BhushanSah

Copy link
Copy Markdown
Contributor

I added tests for the new Manage Members helper logic.

The tests cover the smaller helper functions separately so the behavior is easier to verify and debug:

  • supervisorsDbToDict

    • Checks that supervisor data is converted into the expected dictionary format.
    • Verifies that extra spaces are stripped from fields.
    • Confirms that the username is created correctly from the supervisor email.
  • currentAcademicYear

    • Tests the academic year calculation before July.
    • Tests the academic year calculation starting in July.
    • I used monkeypatch so the test does not depend on the actual current date.
  • attachPositionCounts

    • Tests that active/pending primary and secondary counts are added correctly when count data exists.
    • Tests that missing count data defaults to 0, so the Manage Members page does not break when a supervisor has no matching labor forms.
  • getStudentCounts

    • Tests that active primary, pending primary, active secondary, and pending secondary positions are counted correctly.
    • Uses test department, supervisor, student, term, and labor status form records to verify the actual database query behavior.
  • Released labor forms

    • Added a test to confirm that released labor forms are excluded from the active/pending position counts.
    • This is important because the Manage Members page should not count positions that have already been released.

I marked the database-dependent tests with @pytest.mark.integration, while the smaller pure helper tests were left as normal unit tests because they do not touch the database or Flask session.

All tests in tests/code/test_manageMembers.py are passing.

Comment thread app/templates/main/managepositions.html Outdated
@@ -0,0 +1,90 @@
{% extends "base.html" %}

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 page shouldn't even be here outside your issue scope

<br>
<div style="position: relative; z-index: 1;" id="sortOptions">
<div class="container-fluid" style="margin-bottom: -40px; float: right;">
<div class="container-fluid" style="margin-bottom: 15px; float: right;">

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.

we revert this as this is beyond the scope.

Comment thread database/reset_database.sh.bak Outdated
@@ -0,0 +1,67 @@
#!/bin/bash

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.

we don't create new scripts for the database, this is outside of your scope

Comment thread database/reset_database.sh Outdated

cd database;

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.

we can remove those spaces.

Comment thread db_test.py
Comment thread app/static/js/addSupervisorsToDepartment.js
Comment thread app/static/css/managepositions.css Outdated
.width-12{
width:12%;
}

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.

these codes are outside of your issue scope

Comment thread app/models/supervisor.py
Comment thread app/logic/tracy.py Outdated
students = STUDATA.query.filter(STUDATA.ID.like(bnum_search)).all()
return students

def getSupervisorsFromBNumberSearch(self, bnum_part: str):

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.

no longer needed

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.

4 participants