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

Added validation for keyword #937

Merged
merged 1 commit into from
Jan 23, 2021
Merged

Added validation for keyword #937

merged 1 commit into from
Jan 23, 2021

Conversation

DigneshGujarathi
Copy link
Contributor

Summary

Test Plan

@DigneshGujarathi DigneshGujarathi linked an issue Jan 20, 2021 that may be closed by this pull request
@DigneshGujarathi DigneshGujarathi self-assigned this Jan 20, 2021
@codecov-io
Copy link

Codecov Report

Merging #937 (f34f7ad) into master (0d1fe5a) will decrease coverage by 0.21%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #937      +/-   ##
==========================================
- Coverage   68.07%   67.85%   -0.22%     
==========================================
  Files         146      146              
  Lines        3871     3898      +27     
  Branches      791      799       +8     
==========================================
+ Hits         2635     2645      +10     
- Misses        966      976      +10     
- Partials      270      277       +7     
Impacted Files Coverage Δ
src/containers/Flow/Flow.tsx 63.33% <100.00%> (+0.62%) ⬆️
...ners/Chat/ChatMessages/ChatMessage/ChatMessage.tsx 62.63% <0.00%> (-9.74%) ⬇️
...tainers/Chat/ChatSubscription/ChatSubscription.tsx 72.61% <0.00%> (-2.39%) ⬇️
src/graphql/queries/Search.ts 100.00% <0.00%> (ø)
src/graphql/subscriptions/Chat.ts 100.00% <0.00%> (ø)
...ChatConversations/ChatConversations.test.helper.ts 100.00% <0.00%> (ø)
src/mocks/Chat.tsx 84.00% <0.00%> (+1.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d1fe5a...f34f7ad. Read the comment docs.

const FormSchema = Yup.object().shape({
name: Yup.string().required('Name is required.'),
keywords: Yup.string().matches(regex, 'Only lowercase are allowed.'),
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
keywords: Yup.string().matches(regex, 'Only lowercase are allowed.'),
keywords: Yup.string().matches(regex, 'Only lowercase are allowed.'),

Can we have a generic error message as currently if we press space then also we get the same error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Space is also not a valid input for this, it only allows comma separated lowercase keywords. We also have helper text for this.

@mdshamoon mdshamoon added this to the v0.9.6 milestone Jan 22, 2021
@mdshamoon
Copy link
Member

Looks good

@mdshamoon mdshamoon merged commit 25966bf into master Jan 23, 2021
@mdshamoon mdshamoon deleted the keyword-validation branch January 23, 2021 10:45
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.

Validation of keywords in a flow
3 participants