-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[#12571] Instructors Edit Feedback Session: Instructor is able to edit submission opening time to an earlier timing #12580
[#12571] Instructors Edit Feedback Session: Instructor is able to edit submission opening time to an earlier timing #12580
Conversation
I have fixed the bug regarding the case where the save button is disabled when the user passes in an invalid submission opening time. As seen below, the fields are now editable when there is an error. fix-disabled-button-submission-opening-time.mp4 |
This PR is also now ready for review |
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.
Thank you for your PR! (And great job finding this edge case)
Left a few comments that I think should be addressed.
Also, I've discovered that when switching to the min date, the time always defaults to the min time, even when the time selected is valid (e.g. 13th Sept, 2359 is selected, but switching to 12th Sept (the minDate) causes the time to change)
Do fix the issues and re-request a review!
src/web/app/components/session-edit-form/session-edit-form.component.ts
Outdated
Show resolved
Hide resolved
src/web/app/components/session-edit-form/session-edit-form.component.ts
Outdated
Show resolved
Hide resolved
Hi @cedricongjh, thanks for reviewing my PR and pointing out the bugs in my code! I have fixed the changes pointed out and added unit tests for all the methods requested. In addition, I have also solved the problem where switching the date to min date will always cause the time to revert to min time. |
src/web/app/components/session-edit-form/session-edit-form.component.ts
Outdated
Show resolved
Hide resolved
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.
Besides that one nit, LGTM!
Hi @cedricongjh, I have changed it to triggerModelChange. Ready for review! |
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.
LGTM, thank you for your contribution!
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.
LGTM! Thank you for spotting this edge case and fixing it :)
Fixes #12571
Outline of Solution
I created a new method called
triggerSubmissionOpeningDateModelChange
which is triggered when the instructor chooses a date in the date picker for the submission opening time. When the instructor changes the date to the earliest possible date, thesubmissionStartTime
of the model will change accordingly to the earliest possible time for that date. Since the hours that the instructor are all in 0 minutes(with the exception of 23:59), I created another functionconfigureSubmissionOpeningTime
to configure the time properly.I have also fixed the bug where the saved button is disabled when there is an error message and the fields are uneditable(This bug should not be able to be replicated here since I fixed the above bug but this fix is a safeguard against future bugs)