feat: Add component to Unit [FC-0083] - #82
Closed
ChrisChV wants to merge 27 commits into
Closed
Conversation
Adds block tiles to the Unit card to indicate type and quantity of children in the container.
to avoid confusion with library containers. The AddContent is used to add content to libraries, collections and containers.
ChrisChV
marked this pull request as draft
April 9, 2025 01:23
pomegranited
approved these changes
Apr 9, 2025
pomegranited
left a comment
There was a problem hiding this comment.
👍 Working great @ChrisChV ! Just one missing button and a code organization nit.
- I tested this using the PR test instructions.
- I read through the code
- I checked for accessibility issues by using my keyboard to navigate
- Includes documentation of new functions and tests.
- User-facing strings are extracted for translation
| onClick={openAddContentSidebar} | ||
| > | ||
| {intl.formatMessage(messages.newContentButton)} | ||
| </Button> |
There was a problem hiding this comment.
From the ticket, it looks like we need to show an additional "Add New Component" button under the list of blocks in a unit (in addition to the "Add Content" button at the top).
| @@ -0,0 +1,21 @@ | |||
| /** | |||
There was a problem hiding this comment.
nit: Could you move this code to src/generic/key-utils.ts (and add a test)?
navinkarkera
force-pushed
the
navin/fal-4049/library-unit-page
branch
4 times, most recently
from
April 11, 2025 06:54
c14509d to
ea853aa
Compare
rpenido
approved these changes
Apr 11, 2025
| return undefined; | ||
| }, | ||
| onSettled: () => { | ||
| queryClient.invalidateQueries({ queryKey: containerQueryKeys.children(containerId) }); |
Member
There was a problem hiding this comment.
Since we show the component count on the ContainerCard, we need to invalidate the whole library here.
Also, it is unrelated to this task, but adding a component does not update the search index. cc @pomegranited

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Supporting information
Testing instructions
Add contentbutton.Other information
N/A