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

[#10917] Fix unexpected behaviour when reverting to template feedback path #10975

Conversation

stapletonce
Copy link
Contributor

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

@stapletonce stapletonce changed the title [#10917] Fix unexpected behaviour when reverting to template feedback path Work in Progress [#10917] Fix unexpected behaviour when reverting to template feedback path Feb 21, 2021
@madanalogy madanalogy added the s.Ongoing The PR is being worked on by the author(s) label Feb 22, 2021
Copy link
Contributor

@Derek-Hardy Derek-Hardy left a 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.

@stapletonce stapletonce changed the title Work in Progress [#10917] Fix unexpected behaviour when reverting to template feedback path [#10917] Fix unexpected behaviour when reverting to template feedback path Mar 7, 2021
@stapletonce
Copy link
Contributor Author

@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.

@stapletonce
Copy link
Contributor Author

@madanalogy, @Derek-Hardy, @damithc This issue is no longer in progress and is ready for review (as far as I can tell!)

@Derek-Hardy Derek-Hardy added s.ToReview The PR is waiting for review(s) and removed s.Ongoing The PR is being worked on by the author(s) labels Mar 21, 2021
Copy link
Contributor

@moziliar moziliar left a 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?

Chloe Stapleton added 2 commits March 23, 2021 16:04
@stapletonce stapletonce force-pushed the 10917-visibility-no-change-with-feedback-path-change branch from 24bb490 to 8f4788d Compare March 23, 2021 20:43
@stapletonce
Copy link
Contributor Author

@moziliar I agree, both of those areas seem redundant to me. I have updated the code and re-performed the tests with those changes.

@moziliar
Copy link
Contributor

Can I check what would happen if the user clicks custom feedback path again in the dropdown when the ui is already in custom feedback path? Logically, this code looks to me that it would just toggle the template back to default?

@stapletonce
Copy link
Contributor Author

Screen.Recording.2021-03-30.at.3.55.43.PM.mov

It does not toggle back to default with the current changes @moziliar

@moziliar
Copy link
Contributor

Yup, tested locally and the change seems to solve the problem partially.

Can you help to look into this problem too?
Mar-31-2021 13-26-41

@stapletonce
Copy link
Contributor Author

@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.

@moziliar
Copy link
Contributor

moziliar commented Mar 31, 2021

@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:

User interface reverts to template display prior to selecting custom feedback path

@stapletonce
Copy link
Contributor Author

@moziliar Ah, I see. Thank you for clearing this up - I can work on this now!

@moziliar
Copy link
Contributor

moziliar commented Apr 5, 2021

@stapletonce hi, is this PR ready for review?

@stapletonce
Copy link
Contributor Author

stapletonce commented Apr 5, 2021 via email

Copy link
Contributor

@moziliar moziliar left a 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!

Comment on lines +249 to +251
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) {
Copy link
Contributor

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

Suggested change
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.

Copy link
Contributor

@moziliar moziliar Apr 5, 2021

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>
@moziliar
Copy link
Contributor

moziliar commented Apr 5, 2021

Sorry I take that back... it seems like the logic is wrong in this case🥲 you can revert that and the rest LGTM

Chloe Stapleton added 3 commits April 5, 2021 13:46
…10917-visibility-no-change-with-feedback-path-change
…f github.com:stapletonce/teammates into 10917-visibility-no-change-with-feedback-path-change
Copy link
Contributor

@moziliar moziliar left a 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

@stapletonce
Copy link
Contributor Author

@moziliar success 🎉

@moziliar moziliar added s.FinalReview The PR is ready for final review and removed s.ToReview The PR is waiting for review(s) labels Apr 6, 2021
@stapletonce
Copy link
Contributor Author

@Derek-Hardy ready for review

Copy link
Contributor

@Derek-Hardy Derek-Hardy left a 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.

@madanalogy madanalogy added c.Bug Bug/defect report s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging and removed s.FinalReview The PR is ready for final review labels Apr 12, 2021
@madanalogy madanalogy added this to the V7.15.0 milestone Apr 12, 2021
@madanalogy madanalogy self-assigned this Apr 12, 2021
@madanalogy madanalogy merged commit 0e533b2 into TEAMMATES:master Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c.Bug Bug/defect report s.ToMerge The PR is approved by all reviewers including final reviewer; ready for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unexpected behaviour when reverting to template feedback path
4 participants