-
Notifications
You must be signed in to change notification settings - Fork 473
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
Conversation
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThis 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
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Deploying care-fe with Cloudflare Pages
|
There was a problem hiding this 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 safetyThe 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
⛔ 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
CARE Run #4024
Run Properties:
|
Project |
CARE
|
Branch Review |
cleanup-samples
|
Run status |
Passed #4024
|
Run duration | 05m 22s |
Commit |
a0eb32f2a1: Remove Sample management system
|
Committer | Bodhish Thomas |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
146
|
View all changes introduced in this branch ↗︎ |
@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! 🙌 |
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
Summary by CodeRabbit
Bug Fixes
New Features
Chores