[MGNLPN-567] AllowedMimeTypePattern property doesn't work as expected Created: 12/Aug/21  Updated: 31/Aug/21  Resolved: 17/Aug/21

Status: Closed
Project: Magnolia Personalization
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1, 2.0.11

Type: Bug Priority: Neutral
Reporter: Martin Drápela Assignee: Adam Siska
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
clones MGNLDAM-981 AllowedMimeTypePattern property doesn... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Epic Link: Migrate apps to new UI framework
Sprint: UI FW 34
Story Points: 0

 Description   

This ticket was created/cloned just to update field definition in Personas app


Edition   Magnolia DX Core
Version (bundle)   6.2.4 (Snapshot: 2020.10.30 12:17:37)

It should be possible to restrict the type of assets for upload.  When using the $type: uploadField with its allowedMimeTypePattern property:

  form:
    properties:
      upload:
        $type: uploadField
        allowedMimeTypePattern: image/jpeg

A warning does pop up for the unsupported type, but if the user still hits Save changes in the dialog, even the unsupported type gets eventually uploaded:

[^Kazam_screencast_00009.mp4]

Dev note

Quick check if Vaadin has API to check the mime type on client-side, but only worth a 1 SP.

 

 


Generated at Mon Feb 12 06:38:54 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.