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

Change error statement colour from black to red in patient creation form #4882

Closed
wants to merge 2 commits into from

Conversation

siva-balan
Copy link
Contributor

Proposed Changes

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@siva-balan siva-balan requested a review from a team February 25, 2023 06:03
@siva-balan siva-balan requested a review from a team as a code owner February 25, 2023 06:03
@vercel
Copy link

vercel bot commented Feb 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 25, 2023 at 6:06AM (UTC)

@netlify
Copy link

netlify bot commented Feb 25, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 941aca2
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/63f9a4bf8cbedc00088491a8
😎 Deploy Preview https://deploy-preview-4882--care-egov-staging.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sonarcloud
Copy link

sonarcloud bot commented Feb 25, 2023

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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@@ -537,7 +549,9 @@ export const PatientRegister = (props: PatientRegisterProps) => {
state.form.nationality === "India" &&
!Number(state.form[field])
) {
errors[field] = "Please select ward";
errors[field] = (
<span className="text-red-500">Please select ward</span>
Copy link
Member

Choose a reason for hiding this comment

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

@siva-balan wouldn't the FormField component apply the colors automatically?

You can make use of SelectFormField for gender select.

Suggested change
<span className="text-red-500">Please select ward</span>
<span className="text-red-500">Please select ward</span>
Suggested change
<span className="text-red-500">Please select ward</span>
Please select ward

@siva-balan siva-balan deleted the fix_4867 branch February 25, 2023 06:17
@siva-balan
Copy link
Contributor Author

@rithviknishad I am unable to use SelectFormField for the States and districts. I am getting some errors, can you help with that... I am able to use that for gender but not for others.

@rithviknishad
Copy link
Member

Hey @siva-balan 👋🏼 sure, happy to help you out.

Have a look at src/Components/Users/UserAdd.tsx where similar State and District select menus were implemented using SelectFormField.

Let me know if you are still facing issues after looking at this.

image

@siva-balan
Copy link
Contributor Author

@rithviknishad I already had a look at that, and I tried to implement it similarly but I am not able to click the states in the drop-down. Could you take a look at this?
0d62c76b-532c-4814-9e17-70aeecaf40bb
e385ad7e-9c8d-4626-98ea-777363133cfb

Tell me if there's anything I need to change.. Thanks for the help.

@rithviknishad
Copy link
Member

@siva-balan I'm guessing that you are using handleChange which is for old components and wouldn't work with FormField components. For FormField components you shall use handleFormFieldChange.

@rithviknishad
Copy link
Member

@siva-balan once there are no more legacy input fields that's using handleChange, you may remove that old handleChange altogether.

@siva-balan
Copy link
Contributor Author

siva-balan commented Mar 2, 2023

@rithviknishad Thanks for the fix, I was able to implement them, but the drop-down options are not fully visible due to using the select form field. They are being hidden by the below component. Any idea on how to solve that?
image
In the case of localbody, only one option is visible.

@rithviknishad
Copy link
Member

@siva-balan this is probably because the parent container has overflow-clip class.

@rithviknishad
Copy link
Member

@siva-balan the Material UI's Card component can be replaced with a div if Card is causing the clipping.

You may remove these if so:

image

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.

Change error statement colour from black to red in patient creation form
2 participants