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

Medicine: Adds type filter for medibase search #6186

Merged
merged 6 commits into from
Sep 5, 2023

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Aug 30, 2023

WHAT

🤖 Generated by Copilot at 90a26c4

This pull request adds a new feature to the Medicine module, allowing the user to filter the medicines by type (all, brand, or generic) using a new Switch component. The Switch component is a reusable UI element that renders a list of tabs that can be selected and trigger a callback function. The pull request also updates the Medibase API integration and the Redux actions to support the filtering feature.

Proposed Changes

image

@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

🤖 Generated by Copilot at 90a26c4

  • Add a new Switch component to render a list of tabs for switching between options (link)
  • Import the Switch component and the React hooks in the MedibaseAutocompleteFormField component (link)
  • Use the useState hook to store the query and the type state variables for filtering the medicines (link)
  • Use the useEffect hook to fetch the options from the Medibase API whenever the query or the type changes (link)
  • Pass the type state variable to the listMedibaseMedicines action to filter the medicines by type in the backend (link, link)
  • Render the Switch component next to the label using the labelSuffix prop of the FormField component (link)
  • Pass the tabs, the selected, and the onChange props to the Switch component using the type state variable and the setType function (link)
  • Simplify the onQuery prop of the Autocomplete component by passing the setQuery function instead of calling the fetchOptions function (link)
  • Import the MedibaseMedicine type from the types file and use it for the listMedibaseMedicines action and its parameters (link)

@rithviknishad rithviknishad requested a review from a team August 30, 2023 16:51
@rithviknishad rithviknishad requested a review from a team as a code owner August 30, 2023 16:51
@vercel
Copy link

vercel bot commented Aug 30, 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 Sep 4, 2023 1:45am

@netlify
Copy link

netlify bot commented Aug 30, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 1261de1
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/64f536a482c77600083e51e0
😎 Deploy Preview https://deploy-preview-6186--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.

@nihal467
Copy link
Member

nihal467 commented Sep 5, 2023

LGTM

@khavinshankar khavinshankar merged commit b0c61dc into develop Sep 5, 2023
29 checks passed
@khavinshankar khavinshankar deleted the medicine-type-filter branch September 5, 2023 14:32
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

@rithviknishad We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.

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.

Prescriptions: Add toggle button to filter medicines by type: "generic" only
3 participants