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

fix(FilePicker): Make the validity strings more specific #1072

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"

msgid "\"{name}\" is an invalid file name."
msgid "\"{name}\" is an invalid folder name."
msgstr ""

msgid "\"{name}\" is not an allowed filetype"
msgid "\"{name}\" is not an allowed folder name"
msgstr ""

msgid "\"/\" is not allowed inside a file name."
msgid "\"/\" is not allowed inside a folder name."
msgstr ""

msgid "All files"
Expand Down Expand Up @@ -38,9 +38,6 @@ msgstr ""
msgid "Favorites"
msgstr ""

msgid "File name cannot be empty."
msgstr ""

msgid "Filepicker sections"
msgstr ""

Expand All @@ -53,6 +50,9 @@ msgstr ""
msgid "Filter file list"
msgstr ""

msgid "Folder name cannot be empty."
msgstr ""

msgid "Home"
msgstr ""

Expand Down
8 changes: 4 additions & 4 deletions lib/components/FilePicker/FilePickerBreadcrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ function validateInput() {

let validity = ''
if (name.length === 0) {
validity = t('File name cannot be empty.')
validity = t('Folder name cannot be empty.')
} else if (name.includes('/')) {
validity = t('"/" is not allowed inside a file name.')
validity = t('"/" is not allowed inside a folder name.')
} else if (['..', '.'].includes(name)) {
validity = t('"{name}" is an invalid file name.', { name })
validity = t('"{name}" is an invalid folder name.', { name })
} else if (window.OC.config?.blacklist_files_regex && name.match(window.OC.config?.blacklist_files_regex)) {
validity = t('"{name}" is not an allowed filetype', { name })
validity = t('"{name}" is not an allowed folder name', { name })
}
if (input) {
input.setCustomValidity(validity)
Expand Down