Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selectively remove service transcript entry for banned programs #1176

Merged
merged 81 commits into from
Dec 11, 2024

Conversation

gahimbaref
Copy link
Contributor

@gahimbaref gahimbaref commented Apr 9, 2024

Issue: #658
Add a checkbox to the ban modal dialog to choose whether to completely remove the program from the service transcript or keep it in the service transcript (in case if the checkbox is not clicked). The checkbox on the modal should affect the service transcript directly and remove or keep the programs, whose modals were checked/unchecked.

Did:

  • Moved the checkbox outside the modal on its own column "On Trancript"
  • Added a new boolean column removeFromTranscript in programBan table
  • Added a new route to update programBan table when checkbox state changes
  • The fixes are reflected on the database and the service transcript page
  • Added a message next to the checkbox letting users know if they "added" or "removed" the program from transcript whenever they check/uncheck it
  • Modified the getTotalHours function in transcript.py to calculate hours correctly for banned/unbanned programs
  • Made the unbanned programs show on the transcript by default (checked and greyed out)

Test:

  • checkout the branch serviceTEntry658
  • reset the database and run flask
  • Go to student search and search for a student, like "khatts"
  • In the Choose Action dropdown, select view service transcript, note which programs appear on the transcript
  • Go back to the student profile, and under "Programs" in accordion, click on the pencil edit button that will open a modal Ban/Unban
  • Ban a student from another program like "Hunger Initiatives" (keep in mind that the program will show up in the service transcript only if the student earned hours for that program)
  • Now that the program is banned, you can now modify the checkmark. Try to uncheck the On Transcript box and see if the message "removed" appears
  • Go back to view the service transcript, and check if that program appears (it should not appear). Also make sure that the Total Event Hours is correct
  • Try to check the checkbox and see if the messaged "added" appears and if the program appears again on the service transcript. Also check the hours again to make sure it is correct
  • Review Code in these files: userProfile.js, userProfile.html, main/routes.py, transcript.py

@bledsoef bledsoef removed their assignment Nov 21, 2024
@bledsoef bledsoef dismissed stale reviews from ojmakinde and hoerstl November 21, 2024 18:24

stale

bledsoef
bledsoef previously approved these changes Nov 21, 2024
Copy link
Contributor

@bledsoef bledsoef left a comment

Choose a reason for hiding this comment

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

Generally LGTM. There are lots of lines changed that did not need to be changed and there are also a couple variable nitpicks that it is taking every ounce of willpower to not request changes on but it looks like it works perfectly so I will abstain. Great work!

Copy link
Contributor

@BrianRamsay BrianRamsay left a comment

Choose a reason for hiding this comment

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

This looks good! Just a couple of minor changes in addition to the code comment.

  • The edit button is a little too low, so it's not in line with the other elements in the row.
  • 'Removed' shows up on a separate line for me. Let's replace 'Added!' and 'Removed!' with 'Saved' or 'Saving...', I think. It will be the same for both cases, then.

app/logic/transcript.py Outdated Show resolved Hide resolved
app/templates/main/userProfile.html Outdated Show resolved Hide resolved
vungc added 2 commits December 5, 2024 17:05
…y the location of the pencil icon, modified the message by the checkbox
Copy link

github-actions bot commented Dec 6, 2024

View Code Coverage

@vungc vungc requested review from BrianRamsay and removed request for vungc December 6, 2024 17:57
@BrianRamsay BrianRamsay merged commit 05f7477 into development Dec 11, 2024
5 checks passed
@BrianRamsay BrianRamsay deleted the serviceTEntry658 branch December 11, 2024 13:35
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.

8 participants