-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[#10917] Fix unexpected behaviour when reverting to template feedback path #10975
[#10917] Fix unexpected behaviour when reverting to template feedback path #10975
Conversation
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.
@stapletonce One of the related e2e test has failed. It will be worthwhile to investigate whether to update e2e test workflow accordingly with latest change or to fix potential loophole in the current implementation.
It will be helpful to look into relevant parts of InstructorFeedbackEditPageE2ETest.java
for debugging.
…10917-visibility-no-change-with-feedback-path-change
@Derek-Hardy Hello! I believe I have finished fixing this issue though I'm not sure if I have access to get the ongoing label off. |
@madanalogy, @Derek-Hardy, @damithc This issue is no longer in progress and is ready for review (as far as I can tell!) |
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.
Sorry for the late review. I roughly get the problem and your solution which fixes the issue of isUsingOtherFeedbackPath
not being updated to true in this workflow. Can you help to address some of my doubts above?
src/web/app/components/question-edit-form/question-edit-form.component.ts
Outdated
Show resolved
Hide resolved
src/web/app/components/question-edit-form/question-edit-form.component.ts
Outdated
Show resolved
Hide resolved
…10917-visibility-no-change-with-feedback-path-change
24bb490
to
8f4788d
Compare
@moziliar I agree, both of those areas seem redundant to me. I have updated the code and re-performed the tests with those changes. |
Can I check what would happen if the user clicks |
Screen.Recording.2021-03-30.at.3.55.43.PM.movIt does not toggle back to default with the current changes @moziliar |
@moziliar What is the desired behavior here? I was under the impression that the visibility should only stay the same when switching between custom and template when the custom and template matched. In your example, you switch from Students in this course -> Giver (Self feedback) to Students in this course -> Giver's teammates so visibility resets. |
@stapletonce Sorry I didn't specify what I sensed wrong: notice how the first time I click to Giver's teammates template for the first time, the custom template part still stays, whereas the second time triggers the revert to the template display. The behaviour seems correct for people who are involved in fixing it, but might be confusing to new instructor as not much visual change has been rendered after the first click (the second is a lot more drastic than the first). Maybe we could just make them the same as discussed in the issue, i.e. not in custom template mode at all:
|
@moziliar Ah, I see. Thank you for clearing this up - I can work on this now! |
…er a custom feedback setting
@stapletonce hi, is this PR ready for review? |
yes please!
… On Apr 5, 2021, at 1:17 PM, Mo Zongran ***@***.***> wrote:
@stapletonce <https://github.com/stapletonce> hi, is this PR ready for review?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#10975 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ANJ3JJKR46XUH24ITOTMC43THHWCPANCNFSM4X7MQBXA>.
|
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.
One minor part. The rest look ok!
if (this.model.giverType === giverType && this.model.recipientType === newRecipientType) { | ||
// do not reset the visibility settings if reverting feedback path to preset template provided | ||
if (this.model.isUsingOtherFeedbackPath) { |
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.
It is perhaps not a good practice to have two such if's as they create an arrow-antipattern. You might want to just do
if (this.model.giverType === giverType && this.model.recipientType === newRecipientType) { | |
// do not reset the visibility settings if reverting feedback path to preset template provided | |
if (this.model.isUsingOtherFeedbackPath) { | |
if (this.model.giverType === giverType && this.model.recipientType === newRecipientType | |
&& this.model.isUsingOtherFeedbackPath) { |
in which the precedence of the booleans achieves the exact same effect.
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.
Wrong logic above^. Shouldn't omit the path where the function does nothing
…omponent.ts Co-authored-by: Mo Zongran <mzongran@comp.nus.edu.sg>
Sorry I take that back... it seems like the logic is wrong in this case🥲 you can revert that and the rest LGTM |
…10917-visibility-no-change-with-feedback-path-change
…f github.com:stapletonce/teammates into 10917-visibility-no-change-with-feedback-path-change
…t-form.component.ts" This reverts commit 3626115.
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. Wait for CI to complete
@moziliar success 🎉 |
@Derek-Hardy 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, thanks for the contribution.
Fixes #10917
Outline of Solution
In the changeGiverRecipientType on line 240 of /web/app/components/question-edit-form/question-edit-form.component.ts, I added an if statement that checks if a custom feedback path is currently being used the visibility settings will not change when it is reverted to its template settings.
custom_feedback_visibility.mov