-
Notifications
You must be signed in to change notification settings - Fork 430
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
Fixed delete button size in asset details & consent record pages #8996
Conversation
✅ 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
|
CARE Run #3803
Run Properties:
|
Project |
CARE
|
Branch Review |
delete-button
|
Run status |
Passed #3803
|
Run duration | 04m 48s |
Commit |
7a80044f68: Fixed delete button size in asset details & consent record pages
|
Committer | Mohammed Nihal |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
125
|
View all changes introduced in this branch ↗︎ |
WalkthroughThe changes involve updates to two components: Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
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 (
|
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 (3)
src/components/Patient/PatientConsentRecords.tsx (3)
222-222
: Use consistent icon sizing class.For consistency with other icons in the codebase (like the one on line 234), consider using
text-lg
instead ofh-5
.- <CareIcon icon="l-trash-alt" className="h-5" /> + <CareIcon icon="l-trash-alt" className="text-lg" />
Line range hint
89-103
: Add error handling for consent creation failure.The function continues with
undefined
consentId
if the API request fails. Consider adding proper error handling to prevent silent failures.if (!consentExists || diffPCS) { consentId = undefined; - const res = await request(routes.createConsent, { - pathParams: { consultationId: consultationId }, - body: { - ...newConsent, - patient_code_status: - newConsent.type === 2 ? newConsent.patient_code_status : undefined, - }, - }); - if (res.data) { - consentId = res.data.id; - } + try { + const res = await request(routes.createConsent, { + pathParams: { consultationId: consultationId }, + body: { + ...newConsent, + patient_code_status: + newConsent.type === 2 ? newConsent.patient_code_status : undefined, + }, + }); + if (res.data) { + consentId = res.data.id; + } else { + throw new Error('Failed to create consent record'); + } + } catch (error) { + console.error('Failed to create consent record:', error); + return; + } } consentId && (await fileUpload.handleFileUpload(consentId));
Line range hint
303-313
: Improve loading state handling.The skeleton loader is only shown after checking for filtered records, which could lead to a flash of "No consent records found" message during loading. Consider restructuring the condition to show the skeleton first.
- {consentRecords?.filter( - (r) => - r.files?.filter( - (f) => - f.associating_id === r.id && f.is_archived === showArchived, - ).length, - ).length === 0 ? ( + {!consentRecords ? ( + <div className="skeleton-animate-alpha h-32 rounded-lg" /> + ) : consentRecords.filter( + (r) => + r.files?.filter( + (f) => + f.associating_id === r.id && f.is_archived === showArchived, + ).length, + ).length === 0 ? ( <div className="flex h-32 items-center justify-center text-secondary-500"> No consent records found </div> - ) : ( - !consentRecords && ( - <div className="skeleton-animate-alpha h-32 rounded-lg" /> - ) + ) : null )}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
src/components/Assets/AssetManage.tsx
(1 hunks)src/components/Patient/PatientConsentRecords.tsx
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/components/Assets/AssetManage.tsx
Proposed Changes
@ohcnetwork/care-fe-code-reviewers
Merge Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Style