FEATURE: Render asset usage counter inside inspector action buttons#221
Open
soee wants to merge 1 commit intoFlowpack:mainfrom
Open
FEATURE: Render asset usage counter inside inspector action buttons#221soee wants to merge 1 commit intoFlowpack:mainfrom
soee wants to merge 1 commit intoFlowpack:mainfrom
Conversation
ea2342c to
d66d3ef
Compare
d66d3ef to
fa55467
Compare
Sebobo
requested changes
Nov 6, 2023
Member
Sebobo
left a comment
There was a problem hiding this comment.
Thx, but see my comment regarding usage performance.
| const AssetUsagesToggleButton: React.FC = () => { | ||
| const { isInUse } = useSelectedAsset(); | ||
| const asset = useSelectedAsset(); | ||
| const { assetUsageDetails, loading } = useAssetUsagesQuery( |
Member
There was a problem hiding this comment.
I intentionally didn't do this due to performance reasons with the default usage strategy implementation. You could do it though if you check for the feature flag queryAssetUsage first before you query the usageDetails.
For that you could put the Badge also into a small component and only load it if the feature flag is active.
| @@ -0,0 +1,3 @@ | |||
| .assetUsageBadge { | |||
| color: var(--theme-blue); | |||
Member
There was a problem hiding this comment.
I don't think the blue on white for the badge fits well with the rest of the module.
I would rather use white on one of our grey colors.
Member
|
I think we can finally do this with Neos 9. Let's see after we released v3.0 which will support Neos 9 |
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.
What I did
AssetUsageToggleButtoncomponent to show also asset udage counterAssetUsageSectionstyles so the table rendered inside dialog window looks a bit betterHow I did it
AssetUsageToggleButtonandAssetUsageSectioncomponentsHow to verify it
Show usgaesbutton inside inspector actions/tasksIf asset has no usages
If asset has usages
Table inside modal with asset usages
before
after