-
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: manage collections in component sidebar [FC-0062] #1373
feat: manage collections in component sidebar [FC-0062] #1373
Conversation
Thanks for the pull request, @navinkarkera! 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. 🔘 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. |
@navinkarkera Can you please add a description and screenshots to the PR? Also don't forget |
5f5ae2b
to
a57cf0e
Compare
@bradenmacdonald Done. I still need to add tests but everything else should be ready for review. |
It only happens when we are removing the LAST collection from an object. This works: This doesn't: But this also works: I created a small PR that circumvents this here: open-craft/edx-platform#695 This seems to be a bug upstream. Maybe related to this: meilisearch/meilisearch#4848 |
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
src/search-manager/data/api.ts
Outdated
@@ -129,6 +129,7 @@ export interface ContentHit extends BaseContentHit { | |||
breadcrumbs: [{ displayName: string }, ...Array<{ displayName: string, usageKey: string }>]; | |||
content?: ContentDetails; | |||
lastPublished: number | null; | |||
collections?: { displayName?: string[], key?: 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.
nit
collections?: { displayName?: string[], key?: string[] }, | |
collections: { displayName?: string[], key?: string[] }, |
src/search-manager/data/api.ts
Outdated
/** | ||
* Fetch a content hit by usage key | ||
*/ | ||
export const fetchContentByUsageKey = async ( |
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.
Wouldn't adding the collection data to the getLibraryBlockMetadata
return be better?
It will make things simpler on this side (we wouldn't need another context only for 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.
@rpenido Yes, updated the API include collections data along with component.
<Button | ||
onClick={onClose} | ||
variant="outline-primary" | ||
> | ||
{intl.formatMessage(messages.manageCollectionsToComponentCancelBtn)} | ||
</Button> |
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.
Nit: The style here is a bit different than the one used in the Manage Tags feature
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.
@navinkarkera CC @rpenido Within this PR, if you have time, could you please make sure the "Manage Collections" button (and ideally the "Manage Tags" too ) is hidden when the library is read-only for the current user? I've noticed we haven't been supporting the read-only mode very carefully with some of the new features. |
@rpenido Ah, nice! I was kind of thinking of doing that actually. Looks good. |
52ef2c8
to
7e4d568
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1373 +/- ##
==========================================
+ Coverage 93.01% 93.04% +0.02%
==========================================
Files 1035 1036 +1
Lines 19632 19729 +97
Branches 4172 4185 +13
==========================================
+ Hits 18261 18356 +95
- Misses 1306 1308 +2
Partials 65 65 ☔ View full report in Codecov by Sentry. |
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 good 👍
Select related collections
43707d2
to
44c4c25
Compare
Description
Adds "Manage collections" section to component sidebar as described in #1287
vokoscreenNG-2024-10-10_16-58-05.mp4
Supporting information
Private-ref
: https://tasks.opencraft.com/browse/FAL-3848Depends on:
Testing instructions
tutor images build openedx-dev && tutor dev launch -I --skip-build
tutor dev run cms ./manage.py cms reindex_studio --experimental
.Concerns