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

Signup form validation #22

Merged
merged 4 commits into from
Oct 1, 2020
Merged

Signup form validation #22

merged 4 commits into from
Oct 1, 2020

Conversation

binh-dam-ibigroup
Copy link
Contributor

This PR introduces form validation for new API users using Formik and yup.

The PR also fixes #21 and removes an unwanted message shown when a new API user clicks Create Account.

@vercel
Copy link

vercel bot commented Sep 10, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/ibi-group/otp-admin-ui/jz6l998fu
✅ Preview: https://otp-admin-ui-git-signup-form-validation.ibi-group.vercel.app

Copy link
Contributor

@evansiroky evansiroky left a comment

Choose a reason for hiding this comment

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

Looks great!

@evansiroky evansiroky removed their assignment Sep 11, 2020
Copy link
Contributor

@landonreed landonreed left a comment

Choose a reason for hiding this comment

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

Approved, but on the condition that we come up with a better way to handle error checking for secureFetch.

onChange={handleChange}
type='checkbox'
/>
</Form.Group>
Copy link
Contributor

Choose a reason for hiding this comment

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

I find it somewhat weird to handle this checkbox differently than the items in field layout. I would kind of expect that the fields are either all included in the field layout object or all explicitly written out in the jsx markup. This isn't blocking though

// "detail": null
// }
const adminUser = adminUserFetchResult.data.id ? adminUserFetchResult.data : null
const apiUser = apiUserFetchResult.data.id ? apiUserFetchResult.data : null
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the right way for us to be error checking. Is it possible to use SWR here? I can't recall what led to secureFetch being called here. No need to handle here, but please create an issue referencing this block so that we fix this (a comment like the one you've included should never really be necessary).

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 dependent on a change made to secureFetch in commit 14c2972. Issue #26 created.

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.

All logged-in users see the admin dashboard!!
3 participants