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

Status: Closed
Project: Magnolia DAM Module
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.10

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

Issue Links:
Cloners
clones MGNLUI-6390 allowedMimeTypePattern property doesn... Closed
is cloned by MGNLPN-567 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 Assets
Sprint: UI FW 34
Story Points: 0

 Description   
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 05:05:12 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.