-
Couldn't load subscription status.
- Fork 2.8k
Image cropper modal import missing component #20651
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
base: main
Are you sure you want to change the base?
Image cropper modal import missing component #20651
Conversation
|
Hi there @bjarnef, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
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 missing component import that was causing the image cropper modal to fail. The fix adds an explicit import for the file upload preview component and addresses related TypeScript non-null assertion issues where the mimeType is guaranteed to be defined.
Key Changes:
- Added missing import for
file-upload-preview.element.jsin the image cropper editor modal - Added non-null assertions for mimeType usage to satisfy TypeScript checks
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Umbraco.Web.UI.Client/src/packages/media/media/modals/image-cropper-editor/image-cropper-editor-modal.element.ts | Adds missing import statement for file upload preview component |
| src/Umbraco.Web.UI.Client/src/packages/media/media/components/input-upload-field/file-upload-preview.element.ts | Adds non-null assertions for mimeType variable usage |
Prerequisites
If there's an existing issue for this PR then this fixes #20596
Description
The SVG preview didn't work in image cropper modal because the component wasn't imported in modal, so it only rendered
<umb-file-upload-preview></umb-file-upload-preview>in DOM.This includes the missing component.
Furthermore a SVG without dimensions also need a width/minimum width, otherwise the width was calculated to zero.
SVG image with width/height
SVG image without width/height
We can possible make
<umb-input-upload-field-svg>fill more of width/height - at least in image cropper modal even SVG contains dimensions as we know this is used specific for SVG files.. furthermore icons uploaded by content editor often may contain a small size like 16x16, 24x24 or 32x32 .. so it would be nicer with a larger preview.with
height: 100%onumb-input-upload-field-svgelement.