Organization landing route #2588
Open
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.
What are the relevant tickets?
Closes https://github.com/mitodl/hq/issues/8869
IMPORTANT: The URL added is https://learn.mit.edu/dashboard/organization, not /dashboard/organizations as requested in the issue. This fits our current path segment name and we are taking the user to a single organization, but can add a route for /dashboard/organizations if it's a specific requirement
Description (What does it do?)
Provides a dashboard organization landing route,
/dashboard/organization
, that will navigate the user to their organization. This allows a single URL. http://learn.mit.edu/dashboard/organization for all users.User loads
/dashboard/organization
:/dashboard
).Shows a not found screen at
/dashboard/organization/slug-no-exist
. Shown with the dashboard navigation, as we don't necessarily want to take them out of the dashboard.Screenshots (if appropriate):
How can this be tested?
With MITxOnline set up locally and integrated with Learn and ideally 2 or more organizations set up for your test user. Check @ChristopherChudzicki's detailed instructions, up to setting your test user to be part of the org: #2569
/dashboard/organization/university1
/dashboard/organization
in your back navigation/dashboard/organization/university2
Additional Context
Session storage is used to select the org to navigate to, so will only work on same machine and browser. The
b2b_organization
array is not sorted on the API, so are likely returned in the db insertion order (b2b contract creation, not user/contract relationship). We're selecting the first one. We do also have the contract start/end dates on the API, though these are nullable.