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(ESSNTL-5418): Trim group name before validate #2105

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

gkarat
Copy link
Contributor

@gkarat gkarat commented Nov 22, 2023

Fixes https://issues.redhat.com/browse/ESSNTL-5418.

How to test

  1. Go to /groups and click create a new group
  2. Try to add a name of existing group and also add some whitespaces before/after the name
  3. The modal should not allow you to create a group

@gkarat gkarat added the bug Something isn't working label Nov 22, 2023
@gkarat gkarat self-assigned this Nov 22, 2023
@gkarat gkarat requested a review from a team as a code owner November 22, 2023 15:57
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (198049d) 59.29% compared to head (12d868b) 59.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2105      +/-   ##
==========================================
+ Coverage   59.29%   59.31%   +0.01%     
==========================================
  Files         186      186              
  Lines        5918     5918              
  Branches     1665     1665              
==========================================
+ Hits         3509     3510       +1     
+ Misses       2409     2408       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mkholjuraev mkholjuraev left a comment

Choose a reason for hiding this comment

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

LGTM! I have tried creating groups that had white space before and after, also with existing name. Modal did not allow me. Nice work!

throw 'Group name already exists';
}

return undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: why would we need to return undefined explicitly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the requirement of data-driven-forms. In order to mark that the validator succeeds, it shouldn't return nothing or just undefined 😄

@gkarat gkarat merged commit 36d8403 into RedHatInsights:master Nov 23, 2023
2 checks passed
@gkarat gkarat deleted the essntl-5418 branch November 23, 2023 14:41
@gkarat
Copy link
Contributor Author

gkarat commented Nov 23, 2023

🎉 This PR is included in version 1.58.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants