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

Remove Sample management system #9425

Merged
merged 2 commits into from
Dec 14, 2024
Merged

Remove Sample management system #9425

merged 2 commits into from
Dec 14, 2024

Conversation

bodhish
Copy link
Member

@bodhish bodhish commented Dec 14, 2024

Proposed Changes

A small clean up PR for sample mangement system.

Note to Reviewers: Please push suggestions to the PR.

@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

  • Bug Fixes

    • Removed references to sample-related functionality from various components, ensuring a cleaner user interface.
  • New Features

    • Updated localization files to enhance terminology and improve user experience in both English and Hindi.
  • Chores

    • Deleted multiple components and files related to sample tests, streamlining the application and removing outdated functionalities.

@bodhish bodhish requested a review from a team as a code owner December 14, 2024 16:05
Copy link
Contributor

coderabbitai bot commented Dec 14, 2024

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • public/External-Results-Template.csv is excluded by !**/*.csv

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request represents a comprehensive removal of sample test-related functionality across multiple components and files. The changes systematically eliminate routes, components, constants, and test files associated with sample testing. Key modifications include deleting Cypress test files, removing sample test routing configurations, eliminating sample test models and interfaces, and stripping out related UI components and localization entries. The overall effect is a significant reduction in the application's sample test management capabilities.

Changes

File Path Change Summary
cypress/e2e/sample_test_spec/ Deleted all sample test specification files: SampleTestAdvanceFilters.cy.ts, SampleTestHomepage.cy.ts, SampleTestRequest.cy.ts
src/Routers/ Removed SampleRoutes.tsx and updated AppRouter.tsx to exclude sample-related routes
src/components/Patient/ Deleted multiple sample-related components: SampleDetails.tsx, SampleFilters.tsx, SamplePreview.tsx, SampleTest.tsx, SampleTestCard.tsx, SampleViewAdmin.tsx, UpdateStatusDialog.tsx, SampleTestHistory.tsx
src/common/constants.tsx Removed constants related to sample test results, statuses, and test types
public/locale/ Updated en.json and hi.json by removing sample test-related localization entries

Suggested labels

needs testing

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

Poem

🐰 Hop, hop, away we go!
Sample tests have lost their glow
Routing paths now cleared with care
No more sample details to share
A clean slate, a fresh new start! 🧹


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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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 14, 2024

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit a0eb32f
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/675dc573479c53000881c34b
😎 Deploy Preview https://deploy-preview-9425--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

cloudflare-workers-and-pages bot commented Dec 14, 2024

Deploying care-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: a0eb32f
Status: ✅  Deploy successful!
Preview URL: https://39adfa85.care-fe.pages.dev
Branch Preview URL: https://cleanup-samples.care-fe.pages.dev

View logs

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 (1)
src/Utils/request/api.tsx (1)

Line range hint 1-1183: Overall changes look good and maintain API type safety

The modifications to api.tsx are clean, focused, and properly maintain the TypeScript type safety while removing the sample management functionality. The changes align well with the PR objective.

Consider adding a comment in the routes object to document that sample-related endpoints have been intentionally removed, which would help prevent accidental reintroduction in future changes.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8963ad and df67c37.

⛔ Files ignored due to path filters (1)
  • cypress/fixtures/external-result-sample.csv is excluded by !**/*.csv
📒 Files selected for processing (24)
  • cypress/e2e/sample_test_spec/SampleTestAdvanceFilters.cy.ts (0 hunks)
  • cypress/e2e/sample_test_spec/SampleTestHomepage.cy.ts (0 hunks)
  • cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts (0 hunks)
  • cypress/pageobject/Sample/SampleTestCreate.ts (0 hunks)
  • public/locale/en.json (2 hunks)
  • public/locale/hi.json (0 hunks)
  • src/Routers/AppRouter.tsx (0 hunks)
  • src/Routers/routes/SampleRoutes.tsx (0 hunks)
  • src/Utils/request/api.tsx (1 hunks)
  • src/common/constants.tsx (0 hunks)
  • src/components/Common/Breadcrumbs.tsx (0 hunks)
  • src/components/Common/Sidebar/Sidebar.tsx (0 hunks)
  • src/components/Patient/PatientDetailsTab/SampleTestHistory.tsx (0 hunks)
  • src/components/Patient/PatientDetailsTab/index.tsx (0 hunks)
  • src/components/Patient/PatientHome.tsx (1 hunks)
  • src/components/Patient/SampleDetails.tsx (0 hunks)
  • src/components/Patient/SampleFilters.tsx (0 hunks)
  • src/components/Patient/SamplePreview.tsx (0 hunks)
  • src/components/Patient/SampleTest.tsx (0 hunks)
  • src/components/Patient/SampleTestCard.tsx (0 hunks)
  • src/components/Patient/SampleViewAdmin.tsx (0 hunks)
  • src/components/Patient/UpdateStatusDialog.tsx (0 hunks)
  • src/components/Patient/models.tsx (0 hunks)
  • src/hooks/useActiveLink.ts (0 hunks)
💤 Files with no reviewable changes (21)
  • src/components/Common/Sidebar/Sidebar.tsx
  • src/components/Patient/PatientDetailsTab/index.tsx
  • src/hooks/useActiveLink.ts
  • cypress/e2e/sample_test_spec/SampleTestAdvanceFilters.cy.ts
  • cypress/e2e/sample_test_spec/SampleTestHomepage.cy.ts
  • src/Routers/routes/SampleRoutes.tsx
  • src/components/Patient/PatientDetailsTab/SampleTestHistory.tsx
  • src/components/Common/Breadcrumbs.tsx
  • src/components/Patient/SampleTestCard.tsx
  • src/components/Patient/UpdateStatusDialog.tsx
  • src/components/Patient/SampleFilters.tsx
  • cypress/pageobject/Sample/SampleTestCreate.ts
  • src/Routers/AppRouter.tsx
  • src/common/constants.tsx
  • src/components/Patient/models.tsx
  • src/components/Patient/SampleViewAdmin.tsx
  • src/components/Patient/SampleDetails.tsx
  • src/components/Patient/SampleTest.tsx
  • src/components/Patient/SamplePreview.tsx
  • cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts
  • public/locale/hi.json
🔇 Additional comments (4)
src/Utils/request/api.tsx (2)

73-73: LGTM: Import cleanup aligns with PR objective

The removal of sample-related model imports (SampleReportModel and SampleTestModel) is consistent with the PR's goal of removing the sample management system.


Line range hint 91-1183: Verify complete removal of sample-related endpoints

Let's verify that all sample-related endpoints have been completely removed from the codebase.

✅ Verification successful

Sample-related endpoints have been successfully removed from the API routes

The verification confirms that all sample test endpoints have been properly removed from the routes object in src/Utils/request/api.tsx. The only remaining sample-related references are in UI components (PatientRegister.tsx, DeathReport.tsx, and FileUpload.tsx) which are unrelated to the API routes and are used for displaying COVID test sample collection dates and file upload categories.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Search for any remaining sample-related endpoints or references

# Search for any remaining sample-related routes or endpoints
echo "Searching for sample-related routes..."
rg -i "sample.*test|test.*sample" --type ts --type tsx

# Search for any remaining sample-related API calls
echo "Searching for sample-related API calls..."
rg -i "sample.*api|api.*sample" --type ts --type tsx

# Search for any remaining sample-related types or interfaces
echo "Searching for sample-related types..."
ast-grep --pattern 'interface $SAMPLE {$$$}' 
ast-grep --pattern 'type $SAMPLE = $$$'

Length of output: 66062


Script:

#!/bin/bash
# Search for any remaining sample-related routes, endpoints, or references
# using ripgrep with more specific patterns and context

# Search for sample-related routes and endpoints
echo "Searching for sample-related routes and endpoints..."
rg -i "sample.*test|test.*sample|sample.*report" --type ts --type tsx -g "!*.test.*" -g "!*.spec.*" -g "!*.d.ts" -A 5 -B 5

# Search for sample-related API calls or functions
echo "Searching for sample-related API calls or functions..."
rg -i "sample.*api|api.*sample" --type ts --type tsx -g "!*.test.*" -g "!*.spec.*" -g "!*.d.ts" -A 5 -B 5

# Search for sample-related types or interfaces
echo "Searching for sample-related types or interfaces..."
rg -i "interface.*sample|type.*sample" --type ts --type tsx -g "!*.test.*" -g "!*.spec.*" -g "!*.d.ts" -A 5 -B 5

Length of output: 778


Script:

#!/bin/bash
# Search for any remaining sample-related routes, endpoints, or references
# using ripgrep with correct file type flags

# Search for sample-related routes and endpoints
echo "Searching for sample-related routes and endpoints..."
rg -i "sample.*test|test.*sample|sample.*report" -t typescript -t javascriptreact -g "!*.test.*" -g "!*.spec.*" -g "!*.d.ts" -A 5 -B 5

# Search for sample-related API calls or functions
echo "Searching for sample-related API calls or functions..."
rg -i "sample.*api|api.*sample" -t typescript -t javascriptreact -g "!*.test.*" -g "!*.spec.*" -g "!*.d.ts" -A 5 -B 5

# Search for sample-related types or interfaces
echo "Searching for sample-related types or interfaces..."
rg -i "interface.*sample|type.*sample" -t typescript -t javascriptreact -g "!*.test.*" -g "!*.spec.*" -g "!*.d.ts" -A 5 -B 5

Length of output: 835


Script:

#!/bin/bash
# Search for any remaining sample-related routes, endpoints, or references
# using ripgrep without file type flags but with file pattern matching

echo "Searching for sample-related routes and endpoints..."
rg -i "sample.*test|test.*sample|sample.*report" --glob "*.{ts,tsx}" --glob "!*.{test,spec}.*" --glob "!*.d.ts" -A 5 -B 5

echo "Searching for sample-related API calls or functions..."
rg -i "sample.*api|api.*sample" --glob "*.{ts,tsx}" --glob "!*.{test,spec}.*" --glob "!*.d.ts" -A 5 -B 5

echo "Searching for sample-related types or interfaces..."
rg -i "interface.*sample|type.*sample" --glob "*.{ts,tsx}" --glob "!*.{test,spec}.*" --glob "!*.d.ts" -A 5 -B 5

Length of output: 3660

src/components/Patient/PatientHome.tsx (1)

42-42: Verify complete removal of sample test imports

The removal of sample test related imports looks good. Let's verify no other sample test dependencies remain.

✅ Verification successful

Sample test imports successfully removed

The removal of sample test related imports is correct. The remaining references to "sample test" in DeathReport.tsx and PatientRegister.tsx are unrelated form labels for COVID testing dates, not part of the sample test management system being removed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining sample test related imports or usages
# that might have been missed

# Check for any remaining sample test related imports
rg -i "import.*sample" 

# Check for any remaining sample test related constants or types
rg -i "SAMPLE_TEST|SampleTest"

# Check for any remaining sample test related components or functions
ast-grep --pattern 'class $_ {
  $$$
  sample$_($$$) {
    $$$
  }
  $$$
}'

Length of output: 399


Script:

#!/bin/bash
# Let's check for any remaining sample test related UI components or logic

# Check for any remaining sample test related JSX/TSX elements
rg -i 'sample.*test' --type ts --type tsx -A 2

# Check for any remaining sample test related state or props
rg -i 'sampleTest|sample_test' --type ts --type tsx -g '!*.test.*' -g '!*.spec.*'

# Check for any remaining sample test related API calls or endpoints
rg -i 'sample.*test' --type ts -g '**/api/*' -g '**/services/*'

Length of output: 403


Script:

#!/bin/bash
# Let's try with more generic file patterns and without type specifications

# Check for any remaining sample test related code in TypeScript/JavaScript files
rg -i 'sample.*test' -g '*.ts' -g '*.tsx' -g '*.js' -g '*.jsx' --no-ignore -A 2

# Check for any remaining sample test related state or props
rg -i 'sampleTest|sample_test' -g '*.ts' -g '*.tsx' -g '*.js' -g '*.jsx' --no-ignore

# Check for any remaining sample test related API calls or endpoints
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) -exec grep -l -i "sample.*test" {} \;

Length of output: 65988


Script:

#!/bin/bash
# Let's try a simpler approach to find any remaining sample test references

# Search for sample test related strings in source files, excluding node_modules
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) -not -path "./node_modules/*" -exec grep -l -i "sample.*test" {} \;

# Search for sample test related strings in source files with context
find . -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) -not -path "./node_modules/*" -exec grep -H -i "sample.*test" {} \;

# Search specifically in the components directory
find ./src/components -type f \( -name "*.ts" -o -name "*.tsx" -o -name "*.js" -o -name "*.jsx" \) -exec grep -H -i "sample.*test" {} \;

Length of output: 1003

public/locale/en.json (1)

1438-1438: LGTM: New volunteer management localization strings

The addition of "unassign" and "volunteer_update" strings aligns with the volunteer management functionality in PatientHome.tsx.

Also applies to: 1554-1554

Copy link

cypress bot commented Dec 14, 2024

CARE    Run #4024

Run Properties:  status check passed Passed #4024  •  git commit a0eb32f2a1: Remove Sample management system
Project CARE
Branch Review cleanup-samples
Run status status check passed Passed #4024
Run duration 05m 22s
Commit git commit a0eb32f2a1: Remove Sample management system
Committer Bodhish Thomas
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 146
View all changes introduced in this branch ↗︎

@bodhish bodhish merged commit f82dfa8 into develop Dec 14, 2024
51 checks passed
@bodhish bodhish deleted the cleanup-samples branch December 14, 2024 18:12
Copy link

@bodhish 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants