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

Show username validation error messages #6398

Closed
wants to merge 4 commits into from

Conversation

SHestres
Copy link

Changes

  • Validates the username input field against the same regex used by the backend. The regex was modified to not allow usernames that are all spaces.
  • This is done by adding a "validator" attribute to InputElement which has a regex pattern and an error message.
  • The error message is only shown when the input is invalid, and after the input has been changed (to prevent immediate error messages before a single character has been entered)
  • Styles for the error message are in a new scss file
  • Shows errors returned by the api in a toast notification, such as when another user already has that name
  • These changes were all made to the forms for creating a new user and editing an existing user
  • Hides loading spinner when submitting user profile edits with errors. Previously the spinner would stay until the page was refreshed if the api returned an error

Issues
Closes #6384

Any errors returned by the API when submitting edits to a user caused the loading spinner to stay on screen. This hides the spinner and makes the error message visible to the user
Any errors returned by the API when submitting edits to a user caused the loading spinner to stay on screen. This hides the spinner and makes the error message visible to the user
@SHestres SHestres requested a review from a team as a code owner December 18, 2024 07:35
@jellyfin-bot
Copy link
Collaborator

Cloudflare Pages deployment

Latest commit 8fb07de
Status 🔄 Deploying...
Preview URL Not available
Type 🔀 Preview

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

ESLint doesn't pass. Please fix all ESLint issues.

@@ -2,23 +2,30 @@ import React, { type FC, useCallback, useEffect, useMemo, useRef } from 'react';

import globalize from 'lib/globalize';

import './InputElement.scss';
Copy link
Contributor

Choose a reason for hiding this comment

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

Unable to resolve path to module './InputElement.scss'. import/no-unresolved

@SHestres SHestres closed this Dec 18, 2024
@dmitrylyzo
Copy link
Contributor

FYI, you can fix the branch and force-push it - no need to close-open the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants