Add logic to switch between sections in navigation bar - #60537
#60537Merged
Merged
Add logic to switch between sections in navigation bar#60537
Conversation
# Conflicts: # apps/src/templates/teacherNavigation/TeacherNavigationBar.tsx
lfryemason
marked this pull request as ready for review
August 21, 2024 20:40
kobryan0619
reviewed
Aug 21, 2024
| sectionProviderName, | ||
| setSections, | ||
| setShowLockSectionField, | ||
| setStudentsForCurrentSection, // DCDO Flag - show/hide Lock Section field |
Contributor
There was a problem hiding this comment.
I think this comment got moved to the wrong line?
kobryan0619
reviewed
Aug 21, 2024
| await screen.findByText(i18n.classSections()); | ||
| screen.getByRole('combobox'); | ||
| screen.getByText('Period 1'); | ||
| expect(screen.getByText('Period 1')).toBeVisible(); |
Contributor
There was a problem hiding this comment.
Can I ask why you added the .toBeVisible line here?
Contributor
Author
There was a problem hiding this comment.
Very slight improvement, this tests that the period 1 is visible and selected in the dropdown. The other options should be invisible because the dropdown is not open.
kobryan0619
approved these changes
Aug 21, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds logic to switch sections using react-router. This is done by using a loader that will fetch data from a new endpoint
/dashboardapi/section/:section_idabout the selected section. A loader is a<Route>prop function that gets called whenever the url changes to that<Route>. This is also called on initial load, so we don't need to set anything that will be set by this function.Additions:
useNavigateanduseLocationto switch paths for sections and pages from the sidebar.Follow ups needed:
anyStudentHasProgressto the selected section data and into redux - this is necessary so that switching to a different section will not show the same error if the first section does not have studentsLinks
TEACH-1236