-
Notifications
You must be signed in to change notification settings - Fork 8
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
Added context menu to editor toolbar #869
Conversation
…ions-editor-context-menu
…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
…`data-object` editor
…ctions-editor-context-menu' into 753-missing-asset-context-menu-actions-editor-context-menu
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.
Please check my 2 comments, other then that it LGTM 👍
} | ||
|
||
const clearThumbnailContextMenuItem = (node: Asset, onFinish?: () => void): ItemType => { | ||
return { |
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.
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?
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.
improved with cc3b3b0
I am currently waiting for the correct icon.
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.
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' }) |
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.
Why do we need to pass the elementType here allthough useZipDownload() is an asset specific action?
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.
That is true, I don't know why I didn't notice it in earlier PRs 😆 .
I removed the elementType
in d40ea76
…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
Quality Gate passedIssues Measures |
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:
New Hook for Clearing Thumbnails:
assets/js/src/core/modules/asset/actions/clear-thumbnails/use-clear-thumbnails.tsx
: Created a new hookuseClearThumbnails
to handle the clearing of thumbnails for assets.Zip Download Functionality:
assets/js/src/core/modules/asset/actions/zip-download/use-zip-download.tsx
:Integration into Context Menus:
Editor Toolbar Context Menu:
assets/js/src/core/modules/asset/editor/toolbar/context-menu/context-menu.tsx
: Integrated the newclearThumbnailContextMenuItem
andcreateZipDownloadContextMenuItem
into the editor toolbar context menu. [1] [2]Grid Actions:
assets/js/src/core/modules/asset/editor/types/folder/tab-manager/tabs/list/toolbar/tools/grid-actions.tsx
: Updated the zip download actions to include theelementType
property.Tree Context Menus:
assets/js/src/core/modules/asset/tree/context-menu/context-menu.tsx
: ReplacedcreateZipDownloadContextMenuItem
withcreateZipDownloadTreeContextMenuItem
for more specific context in the asset tree. [1] [2]assets/js/src/core/modules/data-object/tree/context-menu/context-menu.tsx
: Similarly updated the data object tree context menu to usecreateZipDownloadTreeContextMenuItem
. [1] [2]