-
Notifications
You must be signed in to change notification settings - Fork 479
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
On teacher feedback review state change, reload progress bubbles on page #41708
On teacher feedback review state change, reload progress bubbles on page #41708
Conversation
2318c4c
to
3ea8b94
Compare
assert_response :forbidden | ||
end | ||
|
||
# test "" do |
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.
Missing test?
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.
Ooops, will remove this.
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.
Would you mind just removing this test for me so we can avoid having to coordinate commits?
script_level = script.script_levels.find do |sl| | ||
sl.level_ids.include?(params[:level_id].to_i) | ||
end | ||
return head :bad_request if script_level.nil? |
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.
Is it worth returning some kind of message describing the issue?
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'm thinking no? This would be mostly for debugging purposes and it seems like this would be easy enough to diagnose with just the error code? (famous last words)
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.
Wow, this looks like a huge step forward!
I need to take another pass, but posting some initial comments.
@@ -126,40 +77,48 @@ export class SelectedStudentInfo extends React.Component { | |||
/> | |||
<div style={styles.studentInfo}> | |||
<div style={styles.name}>{selectedStudent.name}</div> | |||
{userLevel.paired && ( | |||
{levelWithProgress?.paired && ( |
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.
In what scenarios do we have / not have a levelWithProgress object? What is shown when levelWithProgress is not present? (I'm wondering whether it would make sense to split that out as a specific case because all of these elements are shown only if levelWithProgress being present.)
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.
Now that level/progress data is being loaded async, there is a moment while data is loading when this value will be undefined. However, the student data is available on load so we can immediately show the student name which is why this component is rendered. We could wait until the level data is loaded to render this component, I don't have a strong opinion.
if (this.props.userLevels) { | ||
url = this.props.userLevels[0].bonus | ||
let url; | ||
if (this.props.levelsWithProgress?.length) { |
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.
Just curious, when will this.props.levelsWithProgress be undefined/null?
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.
When level/progress data is being loaded.
assert_response :forbidden | ||
end | ||
|
||
# test "" do |
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.
Ooops, will remove this.
@@ -262,6 +265,13 @@ export default function reducer(state = initialState, action) { | |||
}; | |||
} | |||
|
|||
if (action.type === SET_RELOAD_TEACHER_PANEL_PROGRESS) { |
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.
Could you elaborate a bit on why we need this value in redux? Is there a scenario where we need to re-render but redux-managed state doesn't change? (Usually, we just update the underlying data and the appropriate components re-renders, right?)
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.
Right - we're not storing the teacher panel bubble data in redux, it's stored in the TeacherPanel component state, since that's the only component that needs to know about the data. However when a teacher makes a change in the feedback component we need to communicate to the TeacherPanel component that it needs to refresh it's data so that's what's happening here.
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.
Ah, ok, I think I understand now. Do we use this pattern anywhere else? (This feels potentially simpler than putting the data in redux but it also feels a bit non-standard.) Let's chat tomorrow.
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 I understand this change now. Let's chat tomorrow and see if we can wrap this up! :-)
(Sorry for the off-hours review, I'm working slightly strange hours this week.)
viewAs === ViewType.Teacher && sectionData && sectionData.level_examples; | ||
|
||
const displayLockInfo = | ||
hasSections && unitHasLockableLessons && viewAs === ViewType.Teacher; |
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.
(very minor) Maybe move the viewAs condition to be the first in the list to be more consistent with the other two checks above? That should make it clear that all of these only apply to ViewType.Teacher
.
We probably don't want to fix this now, but I'm also wondering how sectionData relates to hasSections (i.e. can one be derived from the other)?
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 created this ticket https://codedotorg.atlassian.net/browse/LP-1987, there are still many aspects of the teacher panel logic and how data is included that are confusing, hopefully I'll get a chance to address some of this there.
@@ -262,6 +265,13 @@ export default function reducer(state = initialState, action) { | |||
}; | |||
} | |||
|
|||
if (action.type === SET_RELOAD_TEACHER_PANEL_PROGRESS) { |
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.
Ah, ok, I think I understand now. Do we use this pattern anywhere else? (This feels potentially simpler than putting the data in redux but it also feels a bit non-standard.) Let's chat tomorrow.
@@ -18,7 +18,8 @@ module.exports = { | |||
(item.type === 'ExportDefaultDeclaration' && | |||
item.declaration.type === 'ClassDeclaration') || | |||
(item.type === 'ExportNamedDeclaration' && | |||
item.declaration?.type === 'ClassDeclaration') | |||
item.declaration && |
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 was getting some linting errors related to this.. just going to clean that up so it doesn't happen to anyone else.
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.
Yay!
Screen.Recording.2021-07-22.at.5.01.12.PM.mov
Links
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: