Annual Position Review Button - #662
johnlolonga19 wants to merge 34 commits into
Conversation
…tion added my name to the contributor list
…ed logic file for annual position review
… email template page
…eview btn AND annualPositionReview.html handles the confirmation
ArtemKurasov
left a comment
There was a problem hiding this comment.
The code is good overall, but I saw several print statements in the code. You should consider deleting them if they serve no purpose other than debugging
| @@ -0,0 +1,14 @@ | |||
| from app.models import * | |||
There was a problem hiding this comment.
we should try to work off from positionhistory model
There was a problem hiding this comment.
we don't need a positionreview table. we can base off the logic and insert data with positionhistory
…BCStudentSoftwareDevTeam/lsf into annual-position-review-John
|
There is a merge conflict happening |
| existingReview.requestedOn = datetime.now() | ||
| existingReview.requestedBy = requestingUser | ||
| existingReview.save() | ||
| else: |
There was a problem hiding this comment.
I don't think reviewing means creating a positionhistory
| @@ -0,0 +1,14 @@ | |||
| from app.models import * | |||
There was a problem hiding this comment.
we don't need a positionreview table. we can base off the logic and insert data with positionhistory
| // Running this cascade immediately on page load (unlike a human clicking | ||
| // through the dropdowns) can race ahead of that, so wait for the editor | ||
| // to be ready before touching it. | ||
| function runPrefill() { |
There was a problem hiding this comment.
run prefill function should be outside of this function because it restricts the scope of how the function can be used.
7b55a87 to
54282c1
Compare
Fixes issue #618
The Labor Office should be able to initiate the annual position review process for every department from the Manage Departments page.
This workflow requests departments to review their position descriptions and submit any necessary updates before the next academic year.
Additions
A working "Annual Position Review" button on the Manage Departments page. Clicking it opens a confirmation window explaining what's about to happen.
An "Edit Email Template" option in that confirmation window, so an admin can review or change the wording of the email before sending it.
A "Submit Request" button that actually sends the request. Once sent, every active department's supervisors and Labor Coordinators receive an email asking them to review their positions for the current academic year.
A confirmation message on screen after sending, showing how many departments the request went out to.
The system now keeps a record of when a review was requested for each department and academic year, and who requested it, so re-sending a request updates that record instead of creating duplicates.
Changes
annualPositionReview.html— the previously-stubbed confirmation modal (empty onclick="" on every button) is now fully wired: Submit Request calls the new JS, Edit Email Template links toemailTemplateslinked to this templatemanageDepartments.htmlloadsannualPositionReview.js; the trigger button now carries data-academic-year so the JS knows which academic year is selected.manageDepartments() view now also passes the chosenAY Term object into the template context (previously only chosenAY.termName was passed), needed for the data-academic-year attribute above.
emailTemplates.jsadded prefillFromQueryParams() so the Email Templates editor can be linked with Recipient/Form Type/Action pre-selected (used by the Edit Email Template link above)The confirmation page and its buttons (Cancel, Edit Email Template, Submit Request) previously did nothing when clicked they're now fully functional.
The email template editor page can now be opened directly from the confirmation window with the right template already selected, instead of requiring the admin to fill it manually.
Added the test suite for
annualPositionReview.pyMoved the logic from
annualPositionReview.pytoemailHandler.pyto avoid duplicating the functionTesting
ALWAYS_SEND_MAIL was set to False in local secret_config.yaml (untracked, not part of this PR) so local testing doesn't attempt a real SMTP send.
To submit an annual position review, on the sidebar menu, click Admin
Then click the " Manage Department " that will take you to the page
On the page click "Annual Position Review" and then " Submit Request"
A message will show that the request has been sent to x departments out of y.
Two ways to edit email template through Manage Department and Manage Email Template: