Skip to content
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

Added context menu to editor toolbar #869

Merged

Conversation

Corepex
Copy link
Contributor

@Corepex Corepex commented Jan 14, 2025

Belongs to: #753

Additional info

This pull request introduces several enhancements and additions to the asset management functionality, particularly focusing on context menu items for asset actions. The most important changes include the creation of a new hook for clearing thumbnails, updates to the zip download functionality, and the integration of these new actions into various context menus.

Enhancements and Additions:

Integration into Context Menus:

@Corepex Corepex self-assigned this Jan 14, 2025
Corepex and others added 12 commits January 14, 2025 10:08
…ions-editor-context-menu

# Conflicts:
#	assets/js/src/core/modules/asset/editor/title/title-container.tsx
#	public/build/bc44126d-610b-4a77-ab4c-f7311953b828/core-dll.css
…ctions-editor-context-menu' into 753-missing-asset-context-menu-actions-editor-context-menu
…ctions-editor-context-menu' into 753-missing-asset-context-menu-actions-editor-context-menu
@Corepex Corepex requested a review from markus-moser January 16, 2025 09:26
@Corepex Corepex marked this pull request as ready for review January 16, 2025 09:26
Copy link
Contributor

@markus-moser markus-moser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check my 2 comments, other then that it LGTM 👍

}

const clearThumbnailContextMenuItem = (node: Asset, onFinish?: () => void): ItemType => {
return {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For permission and hidden checks take a look here:
https://github.com/pimcore/admin-ui-classic-bundle/blob/2.x/public/js/pimcore/asset/asset.js#L316

We need to do the same checks like in the classic bundle. E.g. it should also work for videos - does this work on backend side?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

improved with cc3b3b0

I am currently waiting for the correct icon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that the BE doesn't support video and pdf thumbnails right now. I created an issue to patch that. pimcore/studio-backend-bundle#699

@@ -38,8 +38,8 @@ export const GridActions = (): React.JSX.Element => {
const { page } = useListPage()
const { id } = useAsset()

const { createZipDownload: createZipFolderDownload } = useZipDownload({ type: 'folder' })
const { createZipDownload: createZipAssetListDownload } = useZipDownload({ type: 'asset-list' })
const { createZipDownload: createZipFolderDownload } = useZipDownload({ elementType: 'asset', type: 'folder' })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to pass the elementType here allthough useZipDownload() is an asset specific action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is true, I don't know why I didn't notice it in earlier PRs 😆 .
I removed the elementType in d40ea76

@Corepex Corepex requested a review from markus-moser January 16, 2025 14:39
@Corepex Corepex merged commit 55e1b4f into 1.x Jan 16, 2025
1 check passed
@Corepex Corepex deleted the 753-missing-asset-context-menu-actions-editor-context-menu branch January 16, 2025 14:47
@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants