-
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(j-s): Double service not required #16938
Conversation
…e-announcement-defenders
…e-announcement-defenders
…e-announcement-defenders
…d-is/island.is into j-s/service-announcement-defenders
…e-announcement-defenders
…e-announcement-defenders
WalkthroughThe pull request introduces changes to the Changes
Possibly related PRs
Suggested labels
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 ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16938 +/- ##
==========================================
- Coverage 36.41% 36.40% -0.01%
==========================================
Files 6898 6898
Lines 144883 144883
Branches 41410 41411 +1
==========================================
- Hits 52753 52751 -2
- Misses 92130 92132 +2 Flags with carried forward coverage won't be shown. Click here to find out more.
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 99 Total Test Services: 0 Failed, 97 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (2) |
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)
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx (1)
135-141
: Consider simplifying the conditional rendering.While the current implementation is correct, we could improve readability by extracting the conditions into a separate variable or helper function.
Here's a suggested refactor:
- {displayVerdictViewDate && - defendant.serviceRequirement && - defendant.serviceRequirement !== ServiceRequirement.NOT_REQUIRED && ( - <Text marginTop={1} fontWeight="semiBold"> - {getVerdictViewDateText(formatMessage, defendant.verdictViewDate)} - </Text> - )} + {(() => { + const shouldDisplayVerdict = + displayVerdictViewDate && + defendant.serviceRequirement && + defendant.serviceRequirement !== ServiceRequirement.NOT_REQUIRED; + + return shouldDisplayVerdict ? ( + <Text marginTop={1} fontWeight="semiBold"> + {getVerdictViewDateText(formatMessage, defendant.verdictViewDate)} + </Text> + ) : null; + })()}This approach:
- Improves readability by giving the condition a descriptive name
- Makes the rendering logic more explicit
- Maintains the same functionality
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.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."
📓 Learnings (1)
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx (1)
Learnt from: oddsson
PR: island-is/island.is#15461
File: apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx:36-62
Timestamp: 2024-11-12T15:15:11.835Z
Learning: The user prefers readability over optimization in the `getAppealExpirationInfo` function within `DefendantInfo.tsx`.
🔇 Additional comments (1)
apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx (1)
129-132
: LGTM! Clean and readable implementation.
The appeal expiration info display follows best practices with proper i18n handling and component structure.
* Checkpoint * Refactor AlertMessage * Format date * Cleanup * Cleanup * Merge * Add key * Refactor * Remove console.log * Merge * Merge * Remove duplicate service not required * Revert --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Guðjón Guðjónsson <[email protected]> Co-authored-by: unakb <[email protected]>
Double service not required
Asana
What
When a service is not required, we'd show "Birting dóms ekki þörf" twice in some info cards. This has now been fixed.
Why
It's a bug
Screenshots / Gifs
Before
After
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes