Added upload new version
context menu option
#783
Draft
+2,160
−1,964
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.
Changes in this pull request
Resolves #753
Blocked by: pimcore/studio-backend-bundle#605
Blocked by: pimcore/studio-backend-bundle#633
Additional info
This pull request introduces a new feature for uploading new versions of assets and integrates it into various parts of the application. The most important changes include the addition of a new hook
useUploadNewVersion
, modifications to the existing form modal to support file uploads, and updates to the context menus to include the new upload functionality.New Feature: Upload New Version
assets/js/src/core/modules/asset/actions/upload-new-version/upload-new-version.tsx
: Added a new hookuseUploadNewVersion
to handle the logic for uploading new versions of assets. This includes functions for opening the upload modal, performing the upload, and adding context menu items.Form Modal Enhancements
assets/js/src/core/components/modal/form-modal/hooks/use-form-modal.tsx
: Enhanced the form modal to support file uploads by adding a newUploadFormProps
interface and awithUpload
function. This includes changes to theuseFormModal
hook to add anupload
method. [1] [2] [3]Context Menu Integration
assets/js/src/core/modules/asset/editor/types/folder/tab-manager/tabs/preview/flex-container.tsx
: Integrated the new upload functionality into the asset preview context menu by adding theuploadNewVersionContextMenuItem
. [1] [2] [3]assets/js/src/core/modules/asset/tree/context-menu/context-menu.tsx
: Added theuploadNewVersionTreeContextMenuItem
to the asset tree context menu. [1] [2] [3]Localization Updates
translations/studio.en.yaml
: Added new translation keys for the upload functionality, including labels and validation messages.