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 responsiveness of FacilityCard and ManagePatients components #9276

Conversation

ayushpatil2122
Copy link
Contributor

@ayushpatil2122 ayushpatil2122 commented Dec 2, 2024

Proposed Changes

  • Fixes fix the responsive ness #9156
  • Change 1
    image
  • fixed the in the above pic the header responsive
  • Change 2
    image
  • fixed the in the above pic the header responsive

@ohcnetwork/care-fe-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

Summary by CodeRabbit

  • New Features

    • Enhanced responsiveness and visual alignment in the Manage Patients interface.
    • Improved layout for buttons and filters for better user experience on various screen sizes.
  • Bug Fixes

    • Adjusted button layouts to ensure consistent alignment and spacing across devices.
  • Style

    • Updated styles for buttons to enhance appearance and responsiveness in the Facility Card and Manage Patients components.

@ayushpatil2122 ayushpatil2122 requested a review from a team as a code owner December 2, 2024 17:52
Copy link
Contributor

coderabbitai bot commented Dec 2, 2024

Walkthrough

The changes in this pull request involve updates to the layout and styling of components in two files: FacilityCard.tsx and ManagePatients.tsx. The FacilityCard.tsx file sees a modification in the class name of a button for improved responsiveness on medium-sized screens. In ManagePatients.tsx, several structural adjustments are made to enhance the layout and responsiveness of buttons and filters, ensuring better alignment and visual consistency across different screen sizes.

Changes

File Change Summary
src/components/Facility/FacilityCard.tsx Updated class name of ButtonV2 from "mt-2 sm:mt-0" to "mt-2 sm:mt-0 md:mt-1" for medium screens.
src/components/Patient/ManagePatients.tsx Reorganized JSX layout for buttons and filters, updated class names for responsiveness, and wrapped components for better layout control.

Assessment against linked issues

Objective Addressed Explanation
Fix responsiveness (Issue #9156)

Possibly related issues

  • Revamp Card UI in the Facilities Tab #9232: The changes in the layout and responsiveness of buttons in ManagePatients.tsx may address the issues of misalignment and lack of responsiveness in the card UI within the facilities tab.

Possibly related PRs

Suggested labels

needs review, tested

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

Poem

In the land of code where buttons play,
A rabbit hops with joy today.
With margins adjusted, they stand so tall,
Responsive and neat, they please us all.
So let’s celebrate this layout spree,
Hooray for changes, as fine as can be! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Dec 2, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 33a9645
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/674df3f84e9d270008f66800
😎 Deploy Preview https://deploy-preview-9276--care-ohc.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
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
src/components/Patient/ManagePatients.tsx (2)

799-799: Remove extra whitespace.

There's an extra whitespace character that should be removed.

-<div >
+<div>
🧰 Tools
🪛 eslint

[error] 799-799: Delete ·

(prettier/prettier)

🪛 GitHub Check: lint

[failure] 799-799:
Delete ·


Line range hint 896-921: Consider adding error handling for export functionality.

While the export implementation is good, consider adding error handling for the CSV export operation to gracefully handle potential failures.

 action: async () => {
   const query = {
     ...params,
     csv: true,
     facility: qParams.facility,
   };
   delete qParams.is_active;
-  const { data } = await request(routes.patientList, {
-    query,
-  });
-  return data ?? null;
+  try {
+    const { data } = await request(routes.patientList, {
+      query,
+    });
+    return data ?? null;
+  } catch (error) {
+    Notification.Error({
+      msg: "Failed to export patient data. Please try again.",
+    });
+    return null;
+  }
 },
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 2d9669e and 33a9645.

📒 Files selected for processing (2)
  • src/components/Facility/FacilityCard.tsx (1 hunks)
  • src/components/Patient/ManagePatients.tsx (4 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/components/Facility/FacilityCard.tsx
🧰 Additional context used
🪛 eslint
src/components/Patient/ManagePatients.tsx

[error] 799-799: Delete ·

(prettier/prettier)

🪛 GitHub Check: lint
src/components/Patient/ManagePatients.tsx

[failure] 799-799:
Delete ·

🔇 Additional comments (2)
src/components/Patient/ManagePatients.tsx (2)

799-844: LGTM! Responsive layout implementation looks good.

The flex layout structure with responsive classes (w-full md:w-1/2 lg:w-fit) provides a good mobile-first approach, ensuring the buttons stack properly on smaller screens and align horizontally on larger ones.

🧰 Tools
🪛 eslint

[error] 799-799: Delete ·

(prettier/prettier)

🪛 GitHub Check: lint

[failure] 799-799:
Delete ·


Line range hint 880-895: LGTM! Well-implemented button with analytics and accessibility.

The doctor connect button implementation includes:

  • Responsive width classes for different screen sizes
  • Proper analytics tracking with triggerGoal
  • Accessibility support with proper ID

@Jacobjeevan Jacobjeevan added the duplicate This issue or pull request already exists label Dec 2, 2024
@Jacobjeevan
Copy link
Contributor

Duplicate of #9161

@Jacobjeevan Jacobjeevan marked this as a duplicate of #9161 Dec 2, 2024
@rithviknishad
Copy link
Member

the add patient button is thrown off...

image

@rithviknishad
Copy link
Member

Closing as duplicate as mentioned in #9276 (comment)

@rithviknishad
Copy link
Member

@ayushpatil2122 avoid working on issues without getting them assigned. We can avoid duplicate PRs that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix the responsive ness
4 participants