feat: Add component to Unit [FC-0083] - #1784
Conversation
|
Thanks for the pull request, @ChrisChV! 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. DetailsWhere 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. |
c5db5e6 to
8835817
Compare
to avoid confusion with library containers. The AddContent is used to add content to libraries, collections and containers.
8835817 to
ca6f216
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1784 +/- ##
=======================================
Coverage 93.54% 93.55%
=======================================
Files 1136 1136
Lines 23205 23241 +36
Branches 5000 5008 +8
=======================================
+ Hits 21708 21742 +34
- Misses 1421 1431 +10
+ Partials 76 68 -8 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
bradenmacdonald
left a comment
There was a problem hiding this comment.
Code looks good! Two minor optional suggestions. Merge whenever you're ready.
I didn't test this since it was already tested in open-craft#82.
| addComponentsToCollectionMutation.mutateAsync([usageKey]).catch(() => { | ||
| showToast(intl.formatMessage(messages.errorAssociateComponentToCollectionMessage)); | ||
| }); | ||
| } else if (unitId) { |
There was a problem hiding this comment.
| } else if (unitId) { | |
| } | |
| if (unitId) { |
These don't necessarily have to be exclusive - you could perhaps create a component in a container in a collection.
| */ | ||
| export async function addComponentsToContainer(containerId: string, componentIds: string[]) { | ||
| const client = getAuthenticatedHttpClient(); | ||
| await client.post( |
There was a problem hiding this comment.
Just suggesting a comment here to make things more clear, since I was a bit unsure about how this worked:
| await client.post( | |
| // POSTing to this URL will append children; PATCHing to it will replace the children. | |
| await client.post( |
Description
Supporting information
Testing instructions
Add contentbutton.Other information
N/A