Skip to content

Conversation

@leekelleher
Copy link
Member

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 fileUploadPreview extension 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 fileUploadPreview component (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.

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.
Copilot AI review requested due to automatic review settings May 15, 2025 18:48
@leekelleher leekelleher requested review from iOvergaard and removed request for Copilot May 15, 2025 18:48
Copy link
Contributor

Copilot AI left a 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.

…e-cropper-editor/image-cropper-editor-modal.element.ts

Co-authored-by: Copilot <[email protected]>
@iOvergaard iOvergaard enabled auto-merge (squash) May 16, 2025 09:56
@iOvergaard iOvergaard merged commit e62e55d into main May 16, 2025
25 of 27 checks passed
@iOvergaard iOvergaard deleted the v16/feature/media-picker-modal-preview branch May 16, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants