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

hide location filter if facility is not selected #6688

Merged
merged 4 commits into from
Nov 29, 2023

Conversation

ayush-seth
Copy link

@ayush-seth ayush-seth commented Nov 22, 2023

WHAT

🤖[deprecated] Generated by Copilot at c3bb44d

This pull request introduces some improvements and new features for the form and filter components in the frontend. It adds a LocationSelect component and a SelectMenuV2 component, which allow users to select locations and other options more easily. It also fixes some issues with error handling and code style in FormField.tsx and PatientFilter.tsx.

Proposed Changes

  • Fixes Advanced filter on patient: Location (Improvement) #6671
  • 50080e6 Make the error field in LocationSelect optional instead of required and make the error component in FormField render only if an error is present. This now makes sure that we don't have an empty span taking up space on the screen even if there is no error. This was causing extra space below the location filter and negative margin was being used to fix that earlier.
  • 431cf7b Remove unnecessary tailwind classes and negative margin mentioned above as the extra space issue is now fixed by not rendering the error span. No reason to use grid/flex properties for a simple top-down form.
  • c3bb44d Render the location filter only if a facility is selected

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

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

HOW

🤖[deprecated] Generated by Copilot at c3bb44d

  • Make errors prop optional in LocationSelectProps interface (link)
  • Reorder and group import statements in LocationSelect.tsx and PatientFilter.tsx (link, link, link, link)
  • Conditionally render FieldErrorText component in FormField component (link)
  • Change className prop of AccordionV2 component to rounded-md and use space-y-4 for accordion content in PatientFilter.tsx (link)
  • Conditionally render LocationSelect component in PatientFilter.tsx and remove unnecessary props (link)
  • Remove unused className props from div elements containing FieldLabel components in PatientFilter.tsx (link, link)

Copy link

vercel bot commented Nov 22, 2023

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

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2023 5:06am

Copy link

netlify bot commented Nov 22, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 9e253d4
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/655d8c1c4ec7af0008389de1
😎 Deploy Preview https://deploy-preview-6688--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 configuration.

@ayush-seth ayush-seth marked this pull request as ready for review November 22, 2023 04:42
@ayush-seth ayush-seth requested a review from a team November 22, 2023 04:42
@ayush-seth ayush-seth requested a review from a team as a code owner November 22, 2023 04:42
Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

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

Nice work!

@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit f5bc741 into ohcnetwork:develop Nov 29, 2023
28 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Advanced filter on patient: Location (Improvement)
4 participants