Skip to content

Add a Position card (fixed) into department Portal#652

Open
fritzj2 wants to merge 15 commits into
department-portal-basefrom
position-card-604
Open

Add a Position card (fixed) into department Portal#652
fritzj2 wants to merge 15 commits into
department-portal-basefrom
position-card-604

Conversation

@fritzj2

@fritzj2 fritzj2 commented Jul 20, 2026

Copy link
Copy Markdown

Issue Description

Fixes issue #604

  • The department portal needs to have a summary view of the positions that each department has.
  • This should include only a small subset of the positions
  • This should display the WLS and position Title.

Additions

image image
  • Added 3 Cards to the manage department page
  • The position card has a list of positionHistory Positions and their WLS level
  • The list of positions takes you to a link where the specific position info should be (but currently isn't implemented)
  • The "View all positions" button takes you to where the " Manage/View Positions page will lead.
  • Failsafe for no positions in a department ("No positions for this department" appears instead)
  • Failsafe for an overload of positions (and x amount more positions)
  • departmentPortal.css handles all of the styling for the cards.
  • added getPositions.py to handle the logic of getting positions

Additions (7/22/2026)

  • Added test suite (test_getPosition.py).
  • Updated the postitionHistory model to no longer enforce a uniqueness constraint that forced all positions to have a unique revisionDate.
  • Updated getPositions to now account for duplicate position codes that go to different departments. (Duplicates can not exist across departments are each position key is unique if active. (Duplicates are fine for inactive positions for history purposes).)

Changes

  • Department portal Department selector dropdown no longer takes up the entire screen
  • Cards have a variable size that scales with the screen
  • The cards stack on top of each other when the screen size is too small.
  • The cards do not appear if a department has not been selected.
  • migrate_db.sh contains an extra line to accommodate the positionHistory being added to the table.
  • positionHistory.py contains 1 extra line that now contains the positionTitle
  • Additional files can be found from a development PR merge, which has not yet been implemented into department-portal-base.
  • posUrl has been changed to posURL
  • The check for no positions in a department has been changed.
    • It no longer uses a if list is empty -> set list = specific string -> check for specific string
    • Now checks if the list is empty -> pass check if the list is empty
      • If the list is empty, it will say No active positions and move on
      • If the list has elements, it will print out up to 7 elements, then check if it is over, and print out the "and x more"

Testing

  • Reset the database to include the changes to the demo_data.py.
  • Booting into the portal using flask run allows you to see if the card is there.
  • 10 positions should load for the CS department ( 7 + 3 more), while 1 should load for the Mathematics department
    • The mathematics department has 2 positions assigned to it; however, only 1 is active, so only one loads.
  • The demo_data.py file has been updated to include positionHistory data within it.
    • The position info page does not yet exist and will return a 404 error when selected; however, the URL still does exist.
  • The "View All Positions" button will give you a 404 error when selected, as the webpage for it doesn't exist yet; the URL still exists.
  • Mess with the screen size to ensure that the cards do not have a static size. The 2 extra cards will go side by side when the screen is small enough.
  • Ensure that the largest size of the department doesn't extend out of the dropdown bar
  • This data will not load anything on staging data currently, as nothing has been allocated to positionHistory yet.
  • Use the test suite.

@fritzj2 fritzj2 changed the title Position card 604 Add aPosition card (fixed) into department Portal Jul 20, 2026
@zhytkovd
zhytkovd self-requested a review July 20, 2026 20:33
@fritzj2 fritzj2 linked an issue Jul 20, 2026 that may be closed by this pull request
@johnlolonga19 johnlolonga19 changed the title Add aPosition card (fixed) into department Portal Add a Position card (fixed) into department Portal Jul 21, 2026

@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.

needed to create test

</span>
</div>
<div class="media-body media-middle">
<h1>Positions</h1>

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.

<h3>

</li>
{% endfor %}
{% if (positions | length) > 7 %}
</ul><p class="card-text">and {{ (positions | length) - 7}} more...</p>

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.

more ...

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.

Create Positions Card for the Department Portal

4 participants