-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Media Picker Modal File Previews #19335
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
Merged
Merged
Conversation
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
when focal point has default value
Removing duplications from inherited class
to support File Upload Previews
to handle the logic of rendering the relevant `fileUploadPreview` extension.
Removes the `<uui-card-media>` container. Controversially removes the link, but this was inconsistent with other file previews.
Removes the `<uui-card-media>` container. Controversially removes the link, but this was inconsistent with other file previews.
Removes the `<uui-card-media>` container. Controversially removes the link, but this was inconsistent with other file previews.
To align code with the other file previews.
Contributor
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.
Pull Request Overview
This PR fixes a UI issue for non-image media items in the Media Picker by adding a file preview component and updating the Image Cropper modal.
- Updated the upload field element markup for consistency.
- Modified the media picker and image cropper modal to show a file preview when applicable.
- Adjusted file upload preview components and related manifests to improve naming and remove legacy wrappers.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/media/media/property-editors/upload-field/property-editor-ui-upload-field.element.ts | Updated element markup with explicit open/close tags. |
| src/Umbraco.Web.UI.Client/src/packages/media/media/modals/media-picker/media-picker-modal.element.ts | Removed obsolete CSS fix related to imaging thumbnails. |
| src/Umbraco.Web.UI.Client/src/packages/media/media/modals/image-cropper-editor/image-cropper-editor-modal.element.ts | Enhanced modal rendering to conditionally show image cropper or file preview, added temporary file configuration observation. |
| src/Umbraco.Web.UI.Client/src/packages/media/media/modals/image-cropper-editor/components/image-cropper-editor-field.element.ts | Simplified preview rendering and removed redundant logic. |
| Various file-upload preview components and manifests | Updated preview components to use plain markup and improved naming for consistency. |
| src/Umbraco.Web.UI.Client/src/packages/core/temporary-file/config/config.repository.ts and extension-slot element | Improved JSDoc and adjusted getter/setter ordering. |
...t/src/packages/media/media/modals/image-cropper-editor/image-cropper-editor-modal.element.ts
Outdated
Show resolved
Hide resolved
...t/src/packages/media/media/modals/image-cropper-editor/image-cropper-editor-modal.element.ts
Show resolved
Hide resolved
…e-cropper-editor/image-cropper-editor-modal.element.ts Co-authored-by: Copilot <[email protected]>
iOvergaard
approved these changes
May 16, 2025
This was referenced Jul 28, 2025
This was referenced Jul 29, 2025
This was referenced Aug 26, 2025
This was referenced Sep 8, 2025
This was referenced Oct 20, 2025
This was referenced Oct 27, 2025
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
On the Media Picker property-editor, when selecting non-image media items, the Image Cropper modal would display a blank panel.
This PR adds a preview of the media item, by reusing the
fileUploadPreviewextension types.On a controversial note, in an effort to bring consistency to the UI, some of the existing
fileUploadPreviews have been modified. Specifically the File, Image and SVG previews no longer render within an<uui-card-media>component. Meaning they no longer display the filename, nor offer a link to open the file in a new tab. Audio and Video previews did not offer this feature.How to test?
Configure a Media Picker property-editor to select different media-types, e.g. Article, Audio, File, Image, Vector Graphics and Video. Once you have a varied selection, click on the selected media item. Images should open with the Image Cropper UI, while the other media-types should display their corresponding
fileUploadPreviewcomponent (e.g. media picker for Audio or Video).For media items that do not have an upload file set, (this shouldn't be possible, but it can happen), then a "Media not found" message is displayed in the modal window.
Try using the "Change Media Item" button feature to select alternative media items and see the preview update.