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

[FILES] enforce maximum 32 char limit #1464

Merged
merged 3 commits into from
Aug 20, 2021
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
13 changes: 12 additions & 1 deletion packages/files-ui/src/Components/Modules/Settings/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,18 @@ const ProfileView = () => {
const sanitizedValue = value?.toString() || ""

setUsername(sanitizedValue)
!!sanitizedValue && debouncedOnLookupUsername(sanitizedValue)
if (sanitizedValue.length > 32) {
setUsernameData({
loading: false,
error: t`The username is too long`
})
} else {
setUsernameData({
loading: false,
error: ""
})
!!sanitizedValue && debouncedOnLookupUsername(sanitizedValue)
}
}

const onSubmitUsername = (e: React.FormEvent<HTMLFormElement>) => {
Expand Down
3 changes: 3 additions & 0 deletions packages/files-ui/src/locales/de/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ msgstr ""
msgid "The system is undergoing maintenance, thank you for being patient."
msgstr "Das System wird gerade gewartet, wir danken Ihnen für Ihre Geduld."

msgid "The username is too long"
msgstr ""

msgid "Theme"
msgstr "Farbschema"

Expand Down
3 changes: 3 additions & 0 deletions packages/files-ui/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,9 @@ msgstr "The files are already in this folder"
msgid "The system is undergoing maintenance, thank you for being patient."
msgstr "The system is undergoing maintenance, thank you for being patient."

msgid "The username is too long"
msgstr "The username is too long"

msgid "Theme"
msgstr "Theme"

Expand Down
3 changes: 3 additions & 0 deletions packages/files-ui/src/locales/es/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ msgstr ""
msgid "The system is undergoing maintenance, thank you for being patient."
msgstr "El sistema está en mantenimiento, gracias por su paciencia."

msgid "The username is too long"
msgstr ""

msgid "Theme"
msgstr "Tema"

Expand Down
3 changes: 3 additions & 0 deletions packages/files-ui/src/locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ msgstr "Les fichiers sont déjà dans ce dossier"
msgid "The system is undergoing maintenance, thank you for being patient."
msgstr "Le système est en cours de maintenance, merci d’être patient."

msgid "The username is too long"
msgstr ""

msgid "Theme"
msgstr "Thème"

Expand Down
3 changes: 3 additions & 0 deletions packages/files-ui/src/locales/no/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ msgstr ""
msgid "The system is undergoing maintenance, thank you for being patient."
msgstr ""

msgid "The username is too long"
msgstr ""

msgid "Theme"
msgstr "Drakt"

Expand Down