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

Mini Rubric: Fix comment tab resize and re-implement keep feedback when switch tabs #27548

Merged
merged 6 commits into from Mar 18, 2019

Conversation

dmcavoy
Copy link
Contributor

@dmcavoy dmcavoy commented Mar 15, 2019

1. Fixes bug where the feedback tab was not showing (but the feedback tab content was) for teachers who are not in the experiment.

Issue was that the boolean that determines when to show this tab for teachers contained statement about a rubric being present for that level.

Before

Screen Shot 2019-03-15 at 12 01 13 PM

After

Screen Shot 2019-03-18 at 10 27 19 AM

2. Re-implements #27507 which keeps the feedback that is unsaved when you switch tabs.

This had to be reverted because it used the boolean from issue 1 to determine when to show the feedback tab. Using the boolean works fine when that boolean is correct for non-experiment teachers

Before

Switch-Tabs-Teacher- Before

After

No Experiment

Switch-Tabs-Teacher-Enabled

Experiment

Switch-Tabs-Teacher-Disabled

3. Fixes bug where you could not re-size the feedback tab contents because of the way that re-sizing the feedback tab on load to show all the content was implemented.

This was a result of the fact that we were always forcing the feedback tab to be full size instead of forcing it to be full size on load and then letting the user re-size as wanted.

Before

Cant-Resize

After

No Experiment

Resize-Teacher-Disabled

Experiment

Resize-Teacher-Enabled

@dmcavoy
Copy link
Contributor Author

dmcavoy commented Mar 18, 2019

Open question @madelynkasula and @davidsbailey : Should I have a ui test that tests both the experiment off and experiment on? Right now it only tests with the experiment on.

@@ -315,7 +321,10 @@ class TopInstructions extends Component {
this.state.feedbacks.length > 0 &&
(this.state.feedbacks[0].comment || this.state.feedbacks[0].performance);
const displayFeedbackTeacher =
this.props.viewAs === ViewType.Teacher && this.state.rubric;
this.state.displayFeedbackTeacherFacing ||
(!this.state.displayFeedbackTeacherFacing &&
Copy link
Contributor

Choose a reason for hiding this comment

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

why would this.state.displayFeedbackTeacherFacing be false here (i.e., for teachers in the experiment)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so we show the feedback tab for teachers in the experiment in two cases:

  1. viewing student work
  2. viewing level normally as a teacher(not viewing student work) and there is a rubric

So the biggest reason it is false is if you are not viewing student work and there is no rubric

Copy link
Contributor

Choose a reason for hiding this comment

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

okay, that makes sense. i think some of this complexity will go away once there is no longer an experiment to deal with, but the display logic is getting pretty complex here. we should revisit when we're removing the experiment, or it may just fix itself 😄

@maddiedierker
Copy link
Contributor

@dmcavoy i think it would be useful to have a UI test and covers the case where the experiment is off, even just a simple test that checks 1) does the tab display and 2) does the content display

Copy link
Contributor

@maddiedierker maddiedierker left a comment

Choose a reason for hiding this comment

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

🥇 incredible documentation!

@davidsbailey
Copy link
Member

Should I have a ui test that tests both the experiment off and experiment on?

This is really a judgment call -- because the non-experiment version will not live forever, I'd lean toward not adding one and just manually test the non-experiment version whenever complex changes are made. but if that sounds scary then adding a simple UI test is totally fine too.

@@ -153,6 +153,10 @@ class TeacherFeedback extends Component {
}
};

componentWillUnmount() {
window.removeEventListener('beforeunload');
}
Copy link
Member

Choose a reason for hiding this comment

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

with this change, will there be a situation where our 'beforeunload' handler still gets triggered?

I'd expect this event to be added while there are pending changes and then removed when the changes are saved to the server. However, I don't have a lot of direct experience with handling this event so rather than prescribing a solution I'll just say please make sure you're getting these warnings at the times that you'd expect to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It still is triggering the warning when we would want it to.

I did this in response to the react documentation saying: "This method (componentDidMount) is a good place to set up any subscriptions. If you do that, don’t forget to unsubscribe in componentWillUnmount()."

@davidsbailey
Copy link
Member

@dmcavoy i think it would be useful to have a UI test and covers the case where the experiment is off, even just a simple test that checks 1) does the tab display and 2) does the content display

Oops, sorry to contradict you here Maddie. It really is a judgment call and given that we've already experienced a regression, perhaps adding a UI test is best.

@dmcavoy dmcavoy merged commit 202c3fc into staging Mar 18, 2019
@dmcavoy dmcavoy deleted the feedback-tab-no-showing branch March 18, 2019 18:17
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.

None yet

3 participants