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

Added No records found in ABDM and button placement adjusted in Investigation Reports Page #8999

Merged

Conversation

nithish1018
Copy link
Contributor

@nithish1018 nithish1018 commented Nov 5, 2024

Proposed Changes

Before Changes:
WhatsApp Image 2024-11-05 at 16 41 18_2d5458ac
WhatsApp Image 2024-11-05 at 16 40 54_b3706859

After Changes:

image

WhatsApp Image 2024-11-05 at 16 41 40_b06be6fb

@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
    • Added a message to indicate when no consent records are available, enhancing user experience.
  • Style
    • Updated the "Previous Sessions" button with improved styling for better visibility.
  • Localization
    • Standardized the capitalization of the "No records found" message to "No Records Found" for consistency.

@nithish1018 nithish1018 requested a review from a team as a code owner November 5, 2024 11:19
Copy link
Contributor

coderabbitai bot commented Nov 5, 2024

Walkthrough

The changes in this pull request introduce conditional rendering in the ABDMFacilityRecords component to display a message when no consent records are found. Additionally, a cosmetic update is made to the "Previous Sessions" button in the InvestigationReports component by adding a new class for styling. Lastly, the localization file is updated to change the capitalization of the "No records found" message for consistency.

Changes

File Path Change Summary
src/components/ABDM/ABDMFacilityRecords.tsx Added conditional rendering to display a message when no consent records are available.
src/components/Facility/Investigations/Reports/index.tsx Added className="ml-3" to the "Previous Sessions" button for styling purposes.
public/locale/en.json Updated the string for "no_records_found" from "No records found" to "No Records Found" for consistency.

Assessment against linked issues

Objective Addressed Explanation
Display "No Records Found" message when no data is available on the ABDM page (#8997)

Possibly related PRs

Suggested reviewers

  • rithviknishad

Poem

🐇 In the land of records, so bright and clear,
A message now shines, for all to hear.
"No Records Found," it boldly proclaims,
Guiding the users, no more guessing games!
With buttons adorned, and styles that gleam,
A better experience, like a sweet dream! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e746991 and cd694d3.

📒 Files selected for processing (3)
  • public/locale/en.json (1 hunks)
  • src/components/ABDM/ABDMFacilityRecords.tsx (1 hunks)
  • src/components/Facility/Investigations/Reports/index.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • public/locale/en.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/ABDM/ABDMFacilityRecords.tsx
  • src/components/Facility/Investigations/Reports/index.tsx

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 Nov 5, 2024

Deploy Preview for care-ohc failed.

Name Link
🔨 Latest commit cd694d3
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/672b7fcbd86426000812bbc2

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/ABDM/ABDMFacilityRecords.tsx (2)

187-193: Consider improving the empty state UX and accessibility.

While the implementation addresses the basic requirement, there are a few suggestions to enhance the user experience:

  1. The h-screen class might cause unnecessary vertical scrolling as it forces the container to be 100vh tall. Consider using a more appropriate height.
  2. The empty state message should be wrapped in a semantic HTML element with proper ARIA attributes for better accessibility.

Consider applying this improvement:

 {consentsResult?.results.length === 0 && (
-  <div className="flex h-screen items-center justify-center p-4">
-    <p className="text-2xl font-bold text-secondary-600">
+  <div className="flex min-h-[200px] items-center justify-center p-4">
+    <p 
+      className="text-2xl font-bold text-secondary-600"
+      role="status"
+      aria-live="polite"
+    >
       {t("no_records_found")}
     </p>
   </div>
 )}

187-193: Consider adding a refresh button in the empty state.

Since the component already has a refresh functionality (via the refetch function), consider adding a refresh button in the empty state to allow users to easily retry loading the data.

 {consentsResult?.results.length === 0 && (
   <div className="flex h-screen items-center justify-center p-4">
-    <p className="text-2xl font-bold text-secondary-600">
-      {t("no_records_found")}
-    </p>
+    <div className="flex flex-col items-center gap-4">
+      <p className="text-2xl font-bold text-secondary-600">
+        {t("no_records_found")}
+      </p>
+      <ButtonV2
+        onClick={() => refetch()}
+        ghost
+        className="text-sm text-secondary-700 hover:text-secondary-900"
+      >
+        <CareIcon icon="l-refresh" /> {t("refresh")}
+      </ButtonV2>
+    </div>
   </div>
 )}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6b57124 and c95c6a4.

📒 Files selected for processing (3)
  • src/Locale/en.json (1 hunks)
  • src/components/ABDM/ABDMFacilityRecords.tsx (1 hunks)
  • src/components/Facility/Investigations/Reports/index.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/Locale/en.json
  • src/components/Facility/Investigations/Reports/index.tsx
🔇 Additional comments (1)
src/components/ABDM/ABDMFacilityRecords.tsx (1)

187-193: Verify translation key existence.

The code uses the translation key "no_records_found". Let's verify that this key exists in the localization files to prevent missing translation issues.

✅ Verification successful

Translation key 'no_records_found' is properly defined in the English locale file

The key exists in src/Locale/en.json with the translation "No Records Found". Let's verify if it's also defined in other locale files to ensure complete translation coverage.


Translation key 'no_records_found' needs to be added to non-English locale files

The translation key is only defined in the English locale file (src/Locale/en.json). Let's check if there are other locale files that need this translation added.


Translation key 'no_records_found' is properly defined

The key exists in the English locale file (src/Locale/en.json) and since no other locale files were found in the repository, there are no missing translations to be concerned about. The translation system appears to be correctly set up for this key.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the translation key in localization files
rg -g '*.json' -g '*.ts' '"no_records_found"'

Length of output: 108


Script:

#!/bin/bash
# Find all locale files and check for the translation key
fd -e json -p 'Locale/' --exec rg -l '"no_records_found"' {}

Length of output: 83


Script:

#!/bin/bash
# List all locale files to identify missing translations
fd -e json 'Locale/'

Length of output: 20

@nihal467
Copy link
Member

nihal467 commented Nov 6, 2024

LGTM

Copy link

github-actions bot commented Nov 6, 2024

👋 Hi, @nithish1018,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Nov 6, 2024
Copy link

github-actions bot commented Nov 6, 2024

👋 Hi, @nithish1018,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added Deploy-Failed Deplyment is not showing preview and removed merge conflict pull requests with merge conflict labels Nov 6, 2024
@rithviknishad rithviknishad merged commit acfc8a0 into ohcnetwork:develop Nov 6, 2024
16 of 21 checks passed
Copy link

github-actions bot commented Nov 6, 2024

@nithish1018 Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deploy-Failed Deplyment is not showing preview needs review tested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ABDM Page: 'No Records Found' Message Not Displaying When No Data is Available
3 participants