Skip to content

fix(console): validate add member email#6315

Merged
gustavosbarreto merged 1 commit into
shellhub-io:masterfrom
kekius-maximus45:add-member-email-validation
May 15, 2026
Merged

fix(console): validate add member email#6315
gustavosbarreto merged 1 commit into
shellhub-io:masterfrom
kekius-maximus45:add-member-email-validation

Conversation

@kekius-maximus45
Copy link
Copy Markdown
Contributor

Summary

Fixes #6296.

Adds client-side email validation to the Add Member drawer so invalid email strings are blocked before the API request is sent.

Changes

  • Added the same email validation regex used by InvitationDrawer
  • Shows an inline Enter a valid email address. message for invalid input
  • Disables the Add Member button until the trimmed email is valid
  • Sends the trimmed email value to the add-member API
  • Added regression tests for invalid email blocking and trimmed valid submission

Testing

  • AddMemberDrawer.test.tsx passes
  • eslint src passes via local ESLint binary
  • tsc -b passes
  • Vite production build passes

Note: the full Vitest suite has unrelated existing failures in MFA/public-key/secure-vault tests; the new focused AddMemberDrawer tests pass.

@kekius-maximus45 kekius-maximus45 requested a review from a team as a code owner May 12, 2026 19:34
@kekius-maximus45
Copy link
Copy Markdown
Contributor Author

@danielgatis check the pr.

@otavio otavio requested a review from luizhf42 May 12, 2026 21:53
@otavio
Copy link
Copy Markdown
Member

otavio commented May 12, 2026

/review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

Claude finished @otavio's task in 4m 27s —— View job


Code Review Complete

Reviewed 2 files across code quality, security, testing, TypeScript patterns, and architecture — no issues found. The code looks good as-is.

The implementation correctly mirrors the established validation pattern from InvitationDrawer.tsx, with proper accessibility attributes (htmlFor/id, aria-invalid, aria-describedby), state reset on drawer open, and trimmed email submission. Tests cover both the invalid-email blocking path and the trimmed valid-email submission path.


If you push additional changes and want a new review, tag @shellhub-io/admin and a team member can trigger it.

@orihamama
Copy link
Copy Markdown

@claude Can you give a brief summary of what files were changed in this PR?

@gustavosbarreto gustavosbarreto merged commit 4de6aa2 into shellhub-io:master May 15, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui-react: AddMemberDrawer accepts invalid email addresses

5 participants