-
Notifications
You must be signed in to change notification settings - Fork 178
feat: Add Sidebar for course outline [FC-0114] #2775
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
feat: Add Sidebar for course outline [FC-0114] #2775
Conversation
|
Thanks for the pull request, @navinkarkera! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. 🔘 Update the status of your PRYour PR is currently marked as a draft. After completing the steps above, update its status by clicking "Ready for Review", or removing "WIP" from the title, as appropriate. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
783f859 to
6e5e65e
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2775 +/- ##
==========================================
+ Coverage 94.99% 95.01% +0.02%
==========================================
Files 1256 1260 +4
Lines 28800 28949 +149
Branches 6538 6606 +68
==========================================
+ Hits 27358 27507 +149
+ Misses 1384 1372 -12
- Partials 58 70 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
0c909ac to
8e4c9a1
Compare
144c41a to
a412e9c
Compare
rpenido
left a comment
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.
LGTM 👍
Thank you for your work, @navinkarkera!
- I tested this using the instructions from the PR
- I read through the code
- I checked for accessibility issues
- Includes documentation]
Great work on the refactor.
I was not super thrilled with the useLibraryContext(false), but as you said, we could refactor that later. Maybe splitting the context?
| // instanbul ignore next | ||
| return `/course/${courseId}/container/${locator}`; | ||
| } | ||
| return `${getConfig().STUDIO_BASE_URL}/container/${locator}`; |
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.
Do we still need this? Wasn't the studio unit outline deprecated?
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.
@rpenido Did not change the actual implementation, just moved it into the context.
Me too, but there is no clean way without requiring a lot of refactoring. I thought about splitting the context but even that would not be helpful as most of the components should work in both cases i.e., inside and outside a single library context. |
| export type LibraryIdOneOrMore = { | ||
| libraryId: string; | ||
| libraryIds: string[]; | ||
| }; |
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 we should not change the LibraryContext to support multiple libraryIds. It makes things too messy. The context is already storing too much data and needs to be simplified, and this makes it even more complex.
Instead, if you really have a page where you need to render content from multiple libraries, wrap each individual component in its own <LibraryContextProvider> for just one library. You can even nest them if you ever need to have a component from a second library displayed inside a main library.
But, to render this sort of view (in mockup below), no LibraryContext should be required at all! All the relevant data comes from Meilisearch, and the <ComponentCard>/<BaseCard> etc. should not depend on a library context. (I think right now it's used for showOnlyPublished but that should be moved to ComponentPickerContext instead of LibraryContext.)
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.
Makes sense. I have updated #2778 to create new contexts for showOnlyPublished and multiple library case.
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.
Looks much cleaner to me in the new PR. Thanks!
e7b11eb to
9e915d2
Compare
|
@rpenido @ChrisChV @bradenmacdonald I am closing this in favor of #2778 as it is much easier to refactor context related code in that PR which contains both |
Closed in favor of #2778
Description
Add flow in course outline sidebar. Allows author to add new section/subsection/unit or any container from existing libraries via sidebar.
NOTE: The containers can only be added to the last parent block in this flow.
Useful information to include:
Screenshots
Supporting information
Addbutton Flow) #2629Private-ref: https://tasks.opencraft.com/browse/FAL-4295Testing instructions
All librariesfilter. It is a dummy and will be implemented in a separate PR as part of Course Outline: Filter by Library (Add Sidebar) #2633Other information
Include anything else that will help reviewers and consumers understand the change.
Best Practices Checklist
We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:
.ts,.tsx).propTypesanddefaultPropsin any new or modified code.src/testUtils.tsx(specificallyinitializeMocks)apiHooks.tsin this repo for examples.messages.tsfiles have adescriptionfor translators to use.../in import paths. To import from parent folders, use@src, e.g.import { initializeMocks } from '@src/testUtils';instead offrom '../../../../testUtils'