-
Notifications
You must be signed in to change notification settings - Fork 75
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 library component picker #1356
base: master
Are you sure you want to change the base?
feat: add library component picker #1356
Conversation
Thanks for the pull request, @rpenido! What's next?Please work through the following steps to get your changes 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. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by 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. |
@@ -20,6 +20,8 @@ export interface LibraryContextData { | |||
closeCreateCollectionModal: () => void; | |||
openCollectionInfoSidebar: (collectionId: string) => void; | |||
currentCollectionId?: string; | |||
componentPickerMode: boolean; | |||
enableComponentPickerMode: () => void; |
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 think this should be a function and have a state, because we don't need to toggle it on and off.
What I'd recommend is that you base this on #1345 and then instead of <LibraryProvider libraryId={libraryId}>
, for the component picker route you can use <LibraryProvider libraryId={libraryId} componentPicker>
. That is much cleaner, because it's just a prop on the context provider, and then it'll be available everywhere. You don't have to manage it as a state and call it within useEffect
.
That PR is waiting for your review btw :) Sorry that it conflicts with this one.
adb7247
to
785a830
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1356 +/- ##
==========================================
- Coverage 93.01% 92.86% -0.16%
==========================================
Files 1035 1039 +4
Lines 19632 19794 +162
Branches 4172 4210 +38
==========================================
+ Hits 18261 18381 +120
- Misses 1306 1350 +44
+ Partials 65 63 -2 ☔ View full report in Codecov by Sentry. |
5b8042d
to
5c2842a
Compare
<Routes> | ||
<Route | ||
path={TabList.home} | ||
element={( | ||
<LibraryHome tabList={TabList} handleTabChange={handleTabChange} /> | ||
)} | ||
/> | ||
<Route | ||
path={TabList.components} | ||
element={<LibraryComponents variant="full" />} | ||
/> | ||
<Route | ||
path={TabList.collections} | ||
element={<LibraryCollections variant="full" />} | ||
/> | ||
<Route | ||
path="*" | ||
element={<NotFoundAlert />} | ||
/> | ||
</Routes> |
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.
We had to change to render based on a state instead of the route because of the ComponentPicker
component
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.
Can you elaborate? Why can't we have nested routes, with three home/components/collections routes underneath /library/foo and the same three home/components/collections routes also available underneath /library-component-picker/ ?
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.
Hmm. You're right. We can. I didn't think this way when I refactored this.
Do you prefer we stick to the routing approach? We will just need to fix some places where we do absolute redirects to '/library/libraryId' to support 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.
Well what I really want is to implement #1230 ASAP, which will simplify everything. Then the "All/Collections/Components" tabs will essentially be just another filter. But yeah, I do think it should be in the route if possible.
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.
Though it doesn't need to be in the route for the content picker.
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 to be clear, it is still in the URL path as it was. I'm just using states from the context to render the child components instead of the Router
component.
I will check how far I'm from using Routes
again tomorrow.
<Routes> | ||
<Route | ||
path="collection/:collectionId" | ||
element={<LibraryCollectionPage />} | ||
/> | ||
<Route | ||
path="*" | ||
element={<LibraryAuthoringPage />} | ||
/> | ||
</Routes> |
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.
We had to change to render based on a state instead of the route because of the ComponentPicker
component
9babe85
to
7e61a2c
Compare
7e61a2c
to
cdfe3d6
Compare
Description
The component picker can be accessed here: http://apps.local.edly.io:2001/course-authoring/component-picker
Additional Information
Part of:
Private-ref: FAL-3876