V15: Show server configuration when configuring the Upload Field#18185
V15: Show server configuration when configuring the Upload Field#18185leekelleher merged 49 commits intov15/devfrom
Conversation
…mick the OpenAPI generator
…cate upload status
… able to show the progress in percent
…re/temporary-file-configuration
…ary-file-configuration
…function.ts Co-authored-by: Lee Kelleher <[email protected]>
# Conflicts: # src/Umbraco.Web.UI.Client/src/packages/property-editors/multiple-text-string/property-editor-ui-multiple-text-string.element.ts
leekelleher
left a comment
There was a problem hiding this comment.
Tested out, all working great. 🚀
I've renamed the property-editor to be "Accepted Upload Types", as "Accepted Types" felt too general.
|
Hi @iOvergaard and @leekelleher Just want to mention that I spotted the changes in this PR regarding property-editor-ui-multiple-text-string.element.ts, and I have to mention that it is a bit off, in regards to how we are supposed to do Validation for Property Editors. I know we are missing documentation, but I just wanted to make sure we handle this correctly going forward. We should not add the So we do not need a Valication Context unless we like to scope the validation messages for a component, and in this cases that is not needed. So what should be done instead is to make the Property Editor UI a Form Control. and append the input as a form control of it. Once that is done the rest of what was added as part of this PR can go away. Addition: |
Description
Adds a notice and validation to the data type configuration of Upload Field to notify the CMS developer about the effects of the current server configuration on the Accepted file extensions on the Upload Field. For good measure, we also mention the maximum file size in the notice, even though it does not affect the extensions. This is to help the developer understand all of the limitations at once.
The server allows setting
Content::AllowedUploadedFileExtensionsandContent::DisallowedUploadedFileExtensions, which can have an inverse effect on the configured Accepted file extensions on the Upload Field. You may end up in a situation where you allow too much on the client that will then ultimately end up being denied on the server.The CMS developer is first notified of potential conflicts with the server. Note, however, if the server only disallows certain types, as in the example above, you can set whatever you want in the accepted types below.
If you type one of the disallowed extensions in the field, you will now be prevented from saving:
To accomplish this, I have created a new property editor UI called "Accepted Types" that extends the multiple text string editor. This type adds its validation based on the newly created UmbTemporaryFileConfigRepository.
How to test