-
Notifications
You must be signed in to change notification settings - Fork 16
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
IBX-6856: Added mimeTypes field to ImageFormMapper #1021
IBX-6856: Added mimeTypes field to ImageFormMapper #1021
Conversation
9272564
to
b114a01
Compare
{ | ||
$mimeTypeChoiceList = []; | ||
foreach ($this->allowedMimeTypes as $mimeType) { | ||
$extensions = implode(', ', $this->mimeTypes->getExtensions($mimeType)); |
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.
In my opinion we should display extensions in the following format *.png, *.jpg
to indicate the list contains actual file extensions. Also it would help to avoid displaying labels like png (png)
, instead you'll get png (*.png)
.
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.
I like this, but I will ask Ida for confirmation before I provide changes.
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.
Approved by Design Team
697a859
bfa6283
to
9efe22c
Compare
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.
Tested all the 4 PRs together.
It works well for the Image fieldtype, but there are two issues with the ImageAsset fieldtype:
Issue 1
If a non-allowed image type is uploaded to the system using the ImageAsset fieldtype then the upload fails (that's expected) but the error is not handled in a nice way
Steps:
- Create a CT with an imageasset fieldtype - set the limitation that only GIFs are allowed
- Start creating a Content Item of that type
- Select "Browse" and upload a JPG file
In other cases - for example when the image size is too big - the error is handled as it should be.
Issue 2
Entering Version comparison for an Image Asset fieldtype results in an error.
Steps:
- Create a Content Type with image asset fieldtype
- Create a Content Item of that Content Type
- Go to Versions -> Enter version comparison
- Switch to Single view
I added section with allowed mime types: ibexa/content-forms@e08900b Fix for |
Fixed: 30417e4 |
I don't like this design to be frank. @NataliaBecla can we do better here? Mime Types is a technical language. Why not just come up with a mapping and display to end user something like ".png, .jpg, .jpeg, .gif" etc. This is more understandable. @SylvainGuittard @adamwojs |
@lserwatka This is the same conclusion we came up with when @ciastektk added mime type configuration in field settings. The list also shows possible file extensions on top of mime types. |
Added JS validation to the file input, so issue 1 should be gone now. Also, mime-types were replaced by the extensions when displaying notice. Updated corresponding |
a4b9cb7
to
e38ca94
Compare
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.
I will report these issues as follow-ups, so that we can tackle them in the future - the core mechanics are in place now 👍
e38ca94
to
098d250
Compare
Quality Gate failedFailed conditions 14.8% Duplication on New Code (required ≤ 3%) |
ibexa/core#300
ibexa/content-forms#55
https://github.com/ibexa/image-editor/pull/80
Checklist:
$ composer fix-cs
)