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

CareUI: Adds UserAutocompleteFormField and used it in "Assigned To" filter field of Shifting #5626

Merged
merged 12 commits into from
Jun 13, 2023

Conversation

rithviknishad
Copy link
Member

@rithviknishad rithviknishad commented Jun 8, 2023

WHAT

🤖 Generated by Copilot at 2e4a9c0

This pull request enhances the useAsyncOptions hook to support custom query options extraction, refactors the ListFilter component to use the new UserAutocompleteFormField component for user filtering, and makes some minor cosmetic changes to the UserModel type and the models.tsx file. These changes improve the flexibility, reusability, and user experience of the shifting module.

Proposed Changes

  • CareUI: Adds UserAutocompleteFormField to select users. (we could add features like filter by online or filter by facility later on when using in other places.
  • useAsyncOptions now supports custom query response extractor (since response format is not same for list api's)
  • Pre-requisite of / required by Replace Material UI components in src/Components/Shifting/ListFilter.tsx. Fixes #4996 #5572
  • As an example, it has been added to the Assigned To field of the Shifting Filter
  • Deletes no longer used component: UserSelect2

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 2e4a9c0

  • Add a new component UserAutocompleteFormField that wraps the Autocomplete component and uses the useAsyncOptions hook to fetch and display user options based on a query (link)
  • Modify the useAsyncOptions hook to accept an optional queryResponseExtractor function that can extract the relevant data from the query response object (link,link)
  • Replace the UserSelect component with the UserAutocompleteFormField component in the ListFilter component, and remove the unnecessary loading state variables and function calls (link,link,link,link,link,link)
  • Change the UserModel interface to a type alias and terminate it with a semicolon in the models.tsx file (link,link)

@rithviknishad rithviknishad requested a review from a team June 8, 2023 17:26
@rithviknishad rithviknishad requested a review from a team as a code owner June 8, 2023 17:26
@vercel
Copy link

vercel bot commented Jun 8, 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 Jun 13, 2023 9:45am

@netlify
Copy link

netlify bot commented Jun 8, 2023

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit f9b0387
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/64883a5ce95aa80008be07d4
😎 Deploy Preview https://deploy-preview-5626--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.

@github-actions github-actions bot added the cypress failed pull request with cypress test failure label Jun 8, 2023
@nihal467
Copy link
Member

@rithviknishad fix the cypress test

@rithviknishad rithviknishad removed changes required cypress failed pull request with cypress test failure labels Jun 13, 2023
@github-actions github-actions bot added the cypress failed pull request with cypress test failure label Jun 13, 2023
@github-actions github-actions bot added cypress failed pull request with cypress test failure and removed cypress failed pull request with cypress test failure labels Jun 13, 2023
@rithviknishad rithviknishad removed the cypress failed pull request with cypress test failure label Jun 13, 2023
@github-actions github-actions bot added cypress failed pull request with cypress test failure and removed cypress failed pull request with cypress test failure labels Jun 13, 2023
@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit cc8017a into develop Jun 13, 2023
29 checks passed
@khavinshankar khavinshankar deleted the tailwind/userautocompleteformfield branch June 13, 2023 10:05
@github-actions
Copy link

@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.

None yet

3 participants