-
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): Police case numbers input #18086
Conversation
WalkthroughThis update introduces additional validation logic for police case numbers. In the backend, the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
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
|
View your CI Pipeline Execution ↗ for commit 19edb98.
☁️ Nx Cloud last updated this comment at |
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
🧹 Nitpick comments (1)
apps/judicial-system/web/src/routes/Prosecutor/components/PoliceCaseNumbers/PoliceCaseNumbers.tsx (1)
143-177
: Consider enhancing accessibility with semantic HTML.While the implementation is good, consider these accessibility improvements:
- Use
<ul>
or<ol>
for the list container instead ofBox
.- Add appropriate ARIA roles and labels for the list container.
- <Box display="flex" flexWrap="wrap" data-testid="policeCaseNumbers-list"> + <ul + role="list" + aria-label="Police case numbers" + style={{ display: 'flex', flexWrap: 'wrap', listStyle: 'none', padding: 0 }} + data-testid="policeCaseNumbers-list" + > {clientPoliceNumbers.map((policeCaseNumber, index) => ( - <Box + <li key={`${policeCaseNumber}-${index}`} - paddingRight={1} - paddingBottom={1} + style={{ paddingRight: '8px', paddingBottom: '8px' }} > <Tag variant="darkerBlue" onClick={onRemove(policeCaseNumber)} aria-label={`Eyða númeri ${policeCaseNumber}`} disabled={isLOKECase && index === 0} > <Box display="flex" alignItems="center"> <Box paddingRight={'smallGutter'}>{policeCaseNumber}</Box> {isLOKECase && index === 0 ? null : ( <Icon icon="close" size="small" /> )} </Box> </Tag> - </Box> + </li> ))} - </Box> + </ul>
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/judicial-system/backend/src/app/modules/case/case.controller.ts
(2 hunks)apps/judicial-system/web/src/routes/Prosecutor/components/PoliceCaseNumbers/PoliceCaseNumbers.tsx
(5 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`apps/**/*`: "Confirm that the code adheres to the following...
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."
apps/judicial-system/backend/src/app/modules/case/case.controller.ts
apps/judicial-system/web/src/routes/Prosecutor/components/PoliceCaseNumbers/PoliceCaseNumbers.tsx
🔇 Additional comments (4)
apps/judicial-system/web/src/routes/Prosecutor/components/PoliceCaseNumbers/PoliceCaseNumbers.tsx (3)
46-70
: LGTM! Well-structured validation function.The validation function is well-implemented with proper type safety, clear error messages, and follows a good separation of concerns by handling format and uniqueness validation separately.
84-104
: LGTM! Robust error handling and state management.The function properly handles error states and synchronizes with the server, ensuring data consistency.
119-141
: LGTM! Correctly implements LOKE case number retention.The function successfully implements the requirement to retain the first police case number for LOKE cases while removing duplicates, aligning with the PR objectives.
apps/judicial-system/backend/src/app/modules/case/case.controller.ts (1)
275-282
: LGTM! Proper validation for LOKE case numbers.The validation logic correctly ensures that the main police case number cannot be removed in LOKE cases, providing appropriate error handling and aligning with the PR objectives.
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.
One change request in the backend logic.
apps/judicial-system/backend/src/app/modules/case/case.controller.ts
Outdated
Show resolved
Hide resolved
…nd-is/island.is into j-s/fix-police-case-numbers
Asana
What
Why
There shouldn't ever be any need to have the same police case number twice in the same case. It also leads to buggy behaviour.
Checklist:
Summary by CodeRabbit