Problem/Motivation
The Media Library field widget has no way of creating media inline. Currently, the widget suggests that users open a new tab or window, create media, then come back to the view to select it. This is not an ideal user experience.
Proposed resolution
We should add the ability to upload media in the media library modal, and use that media for the widget.
The upload functionality will need to validate the cardinality of the field, as well handle uploads that apply to multiple media types. For instance, if a field accepts "Image" and "Animated GIF" media, and you upload a .gif file, the upload form will need to prompt the user to see what type they want to create. This won't be common on most sites, but we need to support the flow.
The current patch handles file validation and media type resolution already, yay!
For a recent recording of the upload form's functionality, please watch https://www.youtube.com/watch?v=AYL0ujucjtY
Remaining tasks
Review the patch, from a code and UX perspective.
User interface changes
The Media Library modal now has an "Add media" link, if the current user has access to create media of a type that the field allows.
API changes
None.
Data model changes
None.