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

ONI-120: Formik validation POC. #49

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

ONI-120: Formik validation POC. #49

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 3, 2023

Ticket: https://openimis.atlassian.net/browse/ONI-120

Changes:

  • Proof of concept of better form validation,
  • Formik validation has been added to the medical service form,
  • Currently working for one of the fields.

@ghost ghost requested a review from olewandowski1 July 3, 2023 07:55
serviceCode: yup.string().required('Service code is required'),
serviceName: yup.string().required('Service name is required'),
serviceType: yup.string().required('Service type is required'),
serviceCareType: yup.string().required('asdad')
Copy link
Member

Choose a reason for hiding this comment

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

Not a error message.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, I am aware of those problems, it is only a proof of concept at this moment, further development is needed. I've left this PR as a reference.

required
readOnly={readOnly}
value={edited && edited.name ? edited.name : ""}
value={values.serviceName}
Copy link
Member

Choose a reason for hiding this comment

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

This is different from the other textfield values.

@@ -1,6 +1,8 @@
import React from "react";
import { connect } from "react-redux";
import { injectIntl } from "react-intl";
import { withFormik} from 'formik';
import * as yup from 'yup';
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to import * ?

@ghost
Copy link
Author

ghost commented Sep 5, 2023

@delcroip
This code will not be merged right now, but could be useful later as a reference. I think it can remain in draft for now.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

2 participants