-
Notifications
You must be signed in to change notification settings - Fork 8
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
Changes to the invite cohort #1297
base: development
Are you sure you want to change the base?
Conversation
@Mbeweg is this in a reviewable state? |
I tried to test this a few different ways, and I followed the testing guide. The cohort checkbox did not remained checked for either a previously saved event or a new event. Also, the date picker seemed to break in the branch. I tried to pull development into the branch, but the date picker for the start date still did not seem to function properly. This was not an issue that I was having on Development. |
It looks good! I just wanted to have Finn take one last look before approval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you guys did an excellent job getting it to save locally but I guess I have a few problems with the way this is currently being handled.
-
The checkbox state's are being stored in the session storage, but if I close out and reopen it, or if another user comes along and looks at it, they have no indication that the box was ever checked. I would recommend creating a new table in the database and creating a backend route to update that table.
-
I feel like once a checkbox has been clicked and saved it should be disabled and grayed out, I cannot really see a circumstance of when they would want to toggle the checkbox status since there is no action to take once it is unselected. If you do end up doing this it may be good to have an indicator (maybe a green "Invited" text next to the cohort names or something) that the cohort was invited.
-
Whenever we save the page, even if no changes have been made to the cohort checkboxes, it will resubmit all of them meaning that the RSVP log is constantly getting updated with duplicate values.
-
Steven recommended possibly having the checkboxes and then an "invite" button that will trigger the invitations, update the database, and disable the checkboxes. That way we don't have to worry about the save button duplicating requests. We can just have the "save" form ignore the cohort stuff. This may require us not showing the "Invite cohorts" options until the edit page since we wouldn't be able to invite for an event that hasn't been created yet.
This is a lot, and more has to do with the lack of clarity in the issue than your implementation. If you need clarification feel free to find me or Brian. Nice work guys!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking over the code it is definitely looking better. A couple things:
The database breaks when trying to reset, this is because you are missing the following line in migrate_db.sh
:
pem add app.models.eventCohort.EventCohort
I went ahead and added that line on my local machine to try and see if the rest worked and while you can successfully submit events it is not properly updating the events. This is probably due to some of the other comments I left.
Nice work guys!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just have some logic that needs to be condensed but overall I think its getting pretty close.
…vents.py file, will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good! A couple issues though:
- We should disable the checkbox once they have checked and saved it.
- Make sure your variables are camel case.
- Inviting a cohort on create works well, but inviting on edit does not seem to be working. It will sometimes overwrite existing overwritten cohorts and other times not invite the ones you select at all.
Nice work!
<label class="form-check-label text-truncate w-100" for="cohort-{{year}}">{{year}}-{{year+1}} | ||
<span class="text-muted">({{students|map(attribute='fullName')|join(", ")}})</span> | ||
<input class="form-check-input" type="checkbox" value="{{year}}" name="cohorts[]" id="cohort-{{year}}" | ||
{{ 'checked' if invited_years and year|string in invited_years }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is checked we should probably disable it so we aren't allowing people to uncheck it since we don't have the functionality to do anything then.
Issue Description
There is a bug where the Bonner cohort checkbox (
#checkBonners
) does not remain checked after creating, saving, or editing an event. While the invited Bonner scholars are successfully saved, the checkbox itself appears unchecked when revisiting the event editing page. This can cause confusion for users who may think the cohort was not properly invited.Fixes issue #1295
Changes
#checkBonners
checkbox with the previously saved state.Testing
Prepare your local development environment and run the application.
Create a new event, select the Bonner cohort checkbox, and save the event. Verify that upon reloading the page or editing the event, the checkbox remains checked.
Edit an existing event without the Bonner cohort selected, invite Bonners, save, and confirm the checkbox is checked when reopening the event edit page.