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

Fix: hide Monitors without a patient checkbox filter is not toggling #6992

Merged
merged 6 commits into from
Jan 8, 2024

Conversation

GokulramGHV
Copy link
Member

Proposed Changes

@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

@GokulramGHV GokulramGHV requested a review from a team as a code owner January 7, 2024 11:44
Copy link

vercel bot commented Jan 7, 2024

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 Jan 8, 2024 11:21am

Copy link

netlify bot commented Jan 7, 2024

Deploy Preview for care-egov-staging ready!

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

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.

why is a state required? query params itself holds the state and it worked before that way.

@GokulramGHV
Copy link
Member Author

why is a state required? query params itself holds the state and it worked before that way.

If I don't use a state then the checkbox doesn't get checked or unchecked quickly, there's some noticeable delay when you do so.

@rithviknishad
Copy link
Member

why is the noticeable delay being caused?

@GokulramGHV
Copy link
Member Author

why is the noticeable delay being caused?

Sorry my bad, the delay was seemed to have caused because of my computer slowing down.
I tried again and the checking and unchecking the checkbox works without any delay.
I'll update the PR with the suggested changes.

@GokulramGHV
Copy link
Member Author

But there's still a noticeable delay when you click the checkbox and the monitors (without patients) appearing and reappearing due to the api call.
Do you want me to add a loading icon for this?

} else {
removeFilter(name);
}
updateQuery({ [name]: value });
Copy link
Member

@rithviknishad rithviknishad Jan 7, 2024

Choose a reason for hiding this comment

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

are you sure this is right? we don't want to filter by bed_is_occupied==False when unchecked, rather we don't want to perform the filter itself based on bed_is_occupied altogether when unchecked right?

@rithviknishad
Copy link
Member

rithviknishad commented Jan 7, 2024

But there's still a noticeable delay when you click the checkbox and the monitors (without patients) appearing and reappearing due to the api call.
Do you want me to add a loading icon for this?

Yup that sounds good! We can show the CARE loading icon when the useQuery's loading is true.

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.

@GokulramGHV

I've pushed the fix (and also shows the loading component when refetching) as this had to be fixed by today evening. cc: @nihal467

The issue was the query param variable is of type string, but the checkbox expected value of type boolean. Hence the issue.

@GokulramGHV
Copy link
Member Author

I've pushed the fix (and also shows the loading component when refetching) as this had to be fixed by today evening. cc: @nihal467

The issue was the query param variable is of type string, but the checkbox expected value of type boolean. Hence the issue.

@rithviknishad Thanks for pushing a fix. I'm so sorry for not seeing your comment earlier and fixing it.

@nihal467
Copy link
Member

nihal467 commented Jan 8, 2024

LGTM

@khavinshankar khavinshankar merged commit 37b451a into ohcnetwork:develop Jan 8, 2024
35 of 36 checks passed
Copy link

github-actions bot commented Jan 8, 2024

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

Hide Monitors without a Patient checkbox filter is not toggling state
4 participants