Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

feat(imaging): add ability to search imaging requests #2522

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

FanciestW
Copy link
Contributor

  • feat: filter and search field added
  • feat: added filter and search functionality

Fixes #2491.

Changes proposed in this pull request:

  • Using existing useSearch hook, added filtering and searching to imagings table view

Newly added dependencies with Bundlephobia links:*

  • None

Note: pull requests without proper descriptions may simply be closed without further discussion. We appreciate your contributions, but need to know what you are offering in clearly described format. Provide tests for all code that you add/modify. If you add/modify any components update the storybook. Thanks! (you can delete this text)

@vercel
Copy link

vercel bot commented Dec 16, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/5vx92g037
✅ Preview: https://hospitalrun-fr-git-fork-fanciestw-feature-2491-imaging-s-13092d.hospitalrun.vercel.app

@jackcmeyer jackcmeyer changed the title feature 2491 imaging search filter feat(imaging): add ability to search imaging requests Dec 17, 2020
Comment on lines +83 to +90
<SelectWithLabelFormGroup
name="type"
label={t('imagings.filterTitle')}
options={filterOptions}
defaultSelected={filterOptions.filter(({ value }) => value === searchFilter)}
onChange={(values) => setSearchFilter(values[0] as ImagingFilter)}
isEditable
/>
Copy link
Member

Choose a reason for hiding this comment

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

need to add the following tests related to this field:

  • make sure that it gets rendered on the page
  • make sure that when its value changes that it performs a search

Comment on lines +93 to +100
<TextInputWithLabelFormGroup
name="searchbox"
label={t('imagings.search')}
placeholder={t('imagings.searchPlaceholder')}
value={searchText}
isEditable
onChange={onSearchBoxChange}
/>
Copy link
Member

Choose a reason for hiding this comment

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

need to add the following tests related to this field:

  • make sure that it gets rendered on the page
  • make sure that when its value changes that it performs a search

Copy link
Contributor

@blestab blestab left a comment

Choose a reason for hiding this comment

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

Should be all set once the requested tests have been added.

@FanciestW
Copy link
Contributor Author

@blestab @jackcmeyer I finished added the tests for the filter and search components in the imaging search view. I used the ViewLabs.test.tsx

I noticed that in the LabsView tests, it checks that the search is called 1 time. But for my test it consitently calls the search function 2 times. I'm not sure if I implemented the search and filter incorrectly or if I set up the tests incorrectly. I would imagine the search is called once when the table is first populated with the default search/filter parameters. Then one more time when I add a filter/search parameter. Let me know what you think. Thank you very much! Happy Holidays 🎄 🥳

@blestab blestab added imaging in progress indicates that issue/pull request is currently being worked on 🚀enhancement an issue/pull request that adds a feature to the application labels Dec 30, 2020
@blestab blestab added this to In progress in Version 2.0 via automation Dec 30, 2020
@blestab blestab added this to the v2.0 milestone Dec 30, 2020
@CLAassistant
Copy link

CLAassistant commented Jan 30, 2021

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🚀enhancement an issue/pull request that adds a feature to the application imaging in progress indicates that issue/pull request is currently being worked on
Projects
Version 2.0
  
In progress
Development

Successfully merging this pull request may close these issues.

Imaging: Add search and filter to the list of imaging requests
5 participants