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

Added AJAX validation for folders in File manager; #3818 #4013

Open
wants to merge 15 commits into
base: 7.dev
Choose a base branch
from

Conversation

Yulyaswan
Copy link
Collaborator

Added validation to "New Folder" dialog in the Files area to prevent users from trying to create folders with unacceptable symbols in a file name
Resolved #3818

…to prevent users trying to create folders with spaces in file name
@Yulyaswan Yulyaswan added the enhancement New feature or request label Jan 23, 2024
@Yulyaswan Yulyaswan added this to the 7.x milestone Jan 23, 2024
@intoeetive
Copy link
Contributor

@Yulyaswan can you resolve conflict here as well?

@intoeetive intoeetive modified the milestones: 7.x, 7.4.3 Feb 19, 2024
# Conflicts:
#	themes/ee/asset/javascript/src/common.js
Copy link
Contributor

@intoeetive intoeetive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the comments in code.

Also, this seems to be very specific (used only on Files controller) and yet included into common.js

I think we need to either have it included on Files page only, or (and I think that would be better) rewrite it in the way so it could be applied to any form in modal.

themes/ee/asset/javascript/src/common.js Outdated Show resolved Hide resolved
themes/ee/asset/javascript/src/common.js Outdated Show resolved Hide resolved
@intoeetive intoeetive modified the milestones: 7.4.3, 7.x Feb 20, 2024
Copy link
Contributor

@intoeetive intoeetive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yulyaswan sorry, I wasn't clear enough.

We don't need to call validation on every form on popup. We just need a way to be able to call it on the forms where we need that. For the time being, we only need validation for "new folder" and "rename folder" dialog. I think on channel entry form, the validation is triggered by the class class="ajax-validate", so perhaps we could do the same here

@intoeetive intoeetive modified the milestones: 7.x, 7.4.5 Mar 12, 2024
@intoeetive intoeetive changed the title Added validation to "New Folder" dialog in Files area to prevent users trying to create folders with unacceptable symbols in file name; Resolved #3818 Added AJAX validation for folders in File manager; #3818 Mar 14, 2024
Copy link
Contributor

@intoeetive intoeetive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yulyaswan this works fine - however what I noticed is that the validation is only triggered when you blur out of the field.

This is same as with the "regular" forms, but because we have just 1 field here, this might never happen

So I wonder if we need to change the init for validation, so that of there's just one text input from _textInputSelectors it would trigger ajax not just on blur but also on like "when they make a pause in typing"

@intoeetive intoeetive modified the milestones: 7.4.5, 7.4.6 Mar 19, 2024
Copy link
Contributor

@intoeetive intoeetive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Yulyaswan this now seems to be sending multiple requests each time I type

@bryannielsen bryannielsen modified the milestones: 7.4.6, 7.x Mar 28, 2024
@intoeetive
Copy link
Contributor

@Yulyaswan just a reminder on this one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants