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

Added Export Bonner Spreadsheet Features #1388

Open
wants to merge 23 commits into
base: development
Choose a base branch
from

Conversation

WackyWeaver
Copy link
Contributor

@WackyWeaver WackyWeaver commented Jan 30, 2025

Issue Description

Fixes #1378

  • "We need more Bonner Cohort export options, to see the currently selected cohort, the last 5 years, and the current All. These spreadsheets should also show all of the bonner events and their attendees. Add columns to the sheet for each event with at least one attendee in the spreadsheet"

Changes

  • Created buttons associated with the new custom spreadsheets

  • Before
    image

  • After
    image

  • Updated look (thanks to feedback from Imran):
    image

  • Also, created an Ajax function to associate each button to a specific flask route. We pass a start year and end year into the route using a values stored in the URL request. Then, if we want to additionally change the spreadsheet range, we can simply express a different range of values for the flask route function.

  • We also wrote into the bonner spreadsheet the status of each bonner requirement. If it was completed by the cohort member, we include the date of completion. If it is incomplete, we simply write "incomplete in the column of a given bonner member row.
    image

  • Lastly, we wrote a SQL script to migrate the Requirementmatch table data. Since much of the Event table data did not insert the bonner requirement events into the proper requirement table, we created a script to migrate all bonner events that include the select names of a given Bonner requirement.

Testing

  • Use git checkout 1378-cohort-export
  • flask run
  • create a Bonner event and add a specified Bonner requirement within the drop down.
  • create a Bonner event with a given Bonner requirement name separate from the other specific requirement (simply to show two different Bonner events (e.i. make a Sophomore exchange and All Bonner Meeting))

WackyWeaver and others added 16 commits January 16, 2025 15:23
…added the events attended column, and now trying to clean up makeBonnerXls logic
…tem. Will implement new logic over comign days
… overhaul logic and get events by requirementmatch, not eventparticipant
…with event date. Need to implement for Bonner Events with frequency greater than one (All Bonner Meetings)
@WackyWeaver WackyWeaver marked this pull request as draft January 30, 2025 19:22
@ojmakinde ojmakinde requested a review from BrianRamsay January 30, 2025 22:47
@WackyWeaver WackyWeaver marked this pull request as ready for review January 31, 2025 19:38
@@ -44,6 +56,28 @@ $(document).ready(function(){
}
});

$(".export-spreadsheet").on('click', function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Some comments might be useful here.

Copy link
Contributor

@ojmakinde ojmakinde Feb 3, 2025

Choose a reason for hiding this comment

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

Yes, they might be. However, I don't think there's any single part of the logic too esoteric to warrant any comments, if you ask me.

@MImran2002
Copy link
Contributor

MImran2002 commented Jan 31, 2025

So far it's good I follow the steps and was able to download the spreadsheet. Everything works perfectly although visually the excel sheet icon and the buttons is something that I would change but its not fundamental and important so you don't have to:

  1. Front-end suggestion:
    Screenshot 2025-01-31 at 5 50 18 PM

  2. test case:
    There are two test that failed but they are not the function you guys created, but in the app/logic/bonner.py the function you have refactor def makeBonnerXls(selectedYear, noOfYears=1): has many changes but within the text file of test_spreadsheet.py there isn't any testing for makeBonnorXls function.

I am under impression that we need to create testing for every logic so I assume there should be one but if there isn't a testing needed and my assumptions are wrong please do correct me.

I hope these suggestions helps.

@MImran2002
Copy link
Contributor

Yes, i see the front-end fixed, if you want the button to be all fixed size and text center this html bootstrap chunk will work:


<div class="flex-column ms-2">  
                    <br><br>
                    <button class="btn btn-success w-100 export-spreadsheet" data-years="1"><img src="static/xls-icon-3379.png" alt="Export to Excel" height="20" width="20"/> Export Selected Years</button>
                    <br><br>
                    <button class="btn btn-success w-100 export-spreadsheet" data-years="5"><img src="static/xls-icon-3379.png" alt="Export to Excel" height="20" width="20"/> Export Last 5 Years</button>
                    <br><br>
                    <button class="btn btn-success w-100 export-spreadsheet" data-years="all"><img src="static/xls-icon-3379.png" alt="Export to Excel" height="20" width="20"/> Export All Years</button>
</div>

Copy link

github-actions bot commented Feb 4, 2025

View Code Coverage

insert into celts.requirementmatch (requirement_id, event_id) values (5, event_id);
elseif event_name like '%legacy%' then
insert into celts.requirementmatch (requirement_id, event_id) values (6, event_id);
elseif event_name like '%presentation%' then
Copy link
Contributor

Choose a reason for hiding this comment

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

Hey @BrianRamsay, what do you think of this, line 35? We're trying to catch Senior Presentation. Do you think just 'presentation' is too vague? (Asking here so I don't forget in person)

@MImran2002
Copy link
Contributor

I am going to approve this PR after talking with James that the front-end seems awesome with new additional feature and the testing of the function as it return a spreadsheet URL is something that doesn't need to be tested.

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.

Bonner Cohort Management export options
4 participants