-
Notifications
You must be signed in to change notification settings - Fork 523
Co-teacher bug fixes for new homepage #65802
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
Co-teacher bug fixes for new homepage #65802
Conversation
…ake-new-section-appear-in-list-after-accepting-coteacher-invite
| ); | ||
|
|
||
| // Update sectionsLoading state when asyncLoadComplete changes | ||
| React.useEffect(() => { |
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.
Why do we need to use the state and a useEffect here instead of just using the redux value from asyncLoadComplete?
| section[key as keyof Section] === undefined && | ||
| prevSection[key as keyof Section] !== undefined | ||
| prevSection[key as keyof Section] !== undefined && | ||
| !window.location.pathname.includes('/teacher_dashboard/home') |
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 don't love basing logic on the URL. If there's another solution using props or arguments, I think that would be much more resilient, but understand if this is by far the easiest way.
| await screen.findByText(i18n.deleteSection()); | ||
| const deleteModalButton = screen.getByLabelText(i18n.delete()); | ||
| fireEvent.click(deleteModalButton); | ||
| await act(async () => fireEvent.click(deleteModalButton)); |
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.
This fixes an error that was popping up during the test due to an async update happening during this event.
| coteacherInvite, | ||
| coteacherInviteForPl, | ||
| // This prop is used to allow asyncLoadSectionData to be run in a way that might remove data | ||
| destructiveLoad = false, |
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.
Fantastic! I also love the name that you went with
This update fixes a couple of issues with the co-teacher notification on the new teacher homepage and adds a spinner while sections are loading asynchronously.
setSectionsmethod inteacherSectionsReduxto prevent the errorSET_SECTIONS called multiple times in a way that would remove datafrom appearing when reloading data on the new teacher homepage. This was preventing async loading and was also preventing the section list from updating unless the page was fully refreshed.Recording.2025-05-14.100618.mp4
Links
TEACH-1849
TEACH-1683
TEACH-1851
Testing story
Added a new unit test for the spinner and updated other unit tests to account for the async loading.
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: