-
Notifications
You must be signed in to change notification settings - Fork 61
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(Consultation-portal): KAM-2800 user cannot deregister from "all" cases #17113
fix(Consultation-portal): KAM-2800 user cannot deregister from "all" cases #17113
Conversation
WalkthroughThe pull request introduces modifications to the Changes
Possibly related PRs
Suggested reviewers
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
Documentation and Community
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17113 +/- ##
=======================================
Coverage 35.69% 35.69%
=======================================
Files 6917 6917
Lines 147412 147412
Branches 41952 41952
=======================================
Hits 52617 52617
Misses 94795 94795 Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
|
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: 1
🧹 Outside diff range and nitpick comments (2)
apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx (2)
Line range hint
82-116
: Optimize conditional rendering of subscription items.The current implementation uses empty fragments for conditional rendering. This can be simplified.
Consider this improvement:
<Body> - {dontShowNew ? ( - <></> - ) : ( + {!dontShowNew && ( <SubscriptionTableItem key={subscribedToAllNewObj.key} item={subscribedToAllNewObj} idx={0} currentTab={currentTab} isGeneralSubscription subscriptionArray={subscriptionArray} setSubscriptionArray={setSubscriptionArray} /> - )} + )} - {dontShowChanges ? ( - <></> - ) : ( + {!dontShowChanges && ( <SubscriptionTableItem key={subscribedToAllChangesObj.key} item={subscribedToAllChangesObj} idx={1} currentTab={currentTab} isGeneralSubscription subscriptionArray={subscriptionArray} setSubscriptionArray={setSubscriptionArray} /> - )} + )}
Localization strings need to be updated for clarity
The current localization strings appear incomplete as they end with "fyrir" (meaning "for" in Icelandic) without completing the context. The message construction in the code appends the
currentTab.toLocaleLowerCase()
to these strings, but this creates a grammatically awkward sentence structure in Icelandic.
mySubscriptionNotFoundText
: "Engar áskriftir fundust fyrir" (No subscriptions found for)subscriptionNotFoundText
: "Engin gögn fundust fyrir" (No data found for)The strings should be revised to either:
- Include proper placeholders for the tab name
- Or be complete sentences that don't require concatenation
🔗 Analysis chain
Line range hint
56-76
: Verify localization strings for subscription messages.The conditional rendering logic is sound, but let's verify that the localization strings properly convey the "all cases" scenario mentioned in the PR objectives.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check localization strings in Subscriptions.json cat apps/consultation-portal/screens/Subscriptions/Subscriptions.json | jq '.subscriptionTable.mySubscriptionNotFoundText, .subscriptionTable.subscriptionNotFoundText'Length of output: 228
Script:
#!/bin/bash # Let's check the entire localization context to understand the full message structure cat apps/consultation-portal/screens/Subscriptions/Subscriptions.json | jq '.subscriptionTable'Length of output: 297
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx (1)
Pattern apps/**/*
: "Confirm that the code adheres to the following:
- NextJS best practices, including file structure, API routes, and static generation methods.
- Efficient state management and server-side rendering techniques.
- Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (2)
apps/consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx (2)
Line range hint 1-17
: LGTM! Clean imports and well-typed Props interface.
The TypeScript types are well-defined and the imports are properly organized.
Line range hint 19-25
: LGTM! Well-structured helper function.
The processData
function is pure and follows single responsibility principle.
...consultation-portal/screens/Subscriptions/components/SubscriptionTable/SubscriptionTable.tsx
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 26 Total Test Services: 0 Failed, 24 Passed Test ServicesThis report shows up to 10 services
|
...
Attach a link to issue if relevant
https://veflausnir.atlassian.net/browse/KAM-2800
What
Why
The user cannot deregister from "all" cases
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit