Skip to content
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

V15: Show server configuration when configuring the Upload Field #18185

Open
wants to merge 46 commits into
base: v15/dev
Choose a base branch
from

Conversation

iOvergaard
Copy link
Contributor

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::AllowedUploadedFileExtensions and Content::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.

image

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:

image

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

  1. You will have to set one or more of the mentioned server settings
  2. Create an Upload Field, or edit an existing
  3. See if you can save an invalid configuration as well as the inverse

@iOvergaard iOvergaard added category/ux User experience type/feature area/frontend release/15.3.0 category/dx Developer experience and removed category/ux User experience labels Jan 31, 2025
@iOvergaard iOvergaard changed the title V15/feature/dropzone allowed types V15: Show server configuration when configuring the Upload Field Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant