-
Notifications
You must be signed in to change notification settings - Fork 119
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
base: 7.dev
Are you sure you want to change the base?
Conversation
…to prevent users trying to create folders with spaces in file name
@Yulyaswan can you resolve conflict here as well? |
# Conflicts: # themes/ee/asset/javascript/src/common.js
There was a problem hiding this 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.
There was a problem hiding this 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
…pt, wrapped error message into em.ee-form-error-message to make common validation works
There was a problem hiding this 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"
There was a problem hiding this 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
@Yulyaswan just a reminder on this one |
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