-
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
feat(j-s): Complete Cancellation #15154
Conversation
…-s/postponed_until_verdict
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: 4
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (1)
- apps/judicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx (1 hunks)
Additional context used
Path-based instructions (1)
apps/judicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.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."
...udicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx
Outdated
Show resolved
Hide resolved
...udicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx
Outdated
Show resolved
Hide resolved
...udicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx
Show resolved
Hide resolved
...udicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx
Show resolved
Hide resolved
apps/judicial-system/web/src/routes/Court/components/CourtCaseNumber/CourtCaseNumberInput.tsx
Outdated
Show resolved
Hide resolved
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: 4
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (3)
- apps/judicial-system/web/src/components/Table/CourtDate/CourtDate.tsx (1 hunks)
- apps/judicial-system/web/src/components/Table/Table.tsx (5 hunks)
- apps/judicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/judicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx
Additional context used
Path-based instructions (2)
apps/judicial-system/web/src/components/Table/CourtDate/CourtDate.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."
apps/judicial-system/web/src/components/Table/Table.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."
Biome
apps/judicial-system/web/src/components/Table/Table.tsx
[error] 186-197: Enforce to have the onClick mouse event with the onKeyUp, the onKeyDown, or the onKeyPress keyboard event. (lint/a11y/useKeyWithClickEvents)
Actions triggered using mouse events should have corresponding keyboard events to account for keyboard-only navigation.
apps/judicial-system/web/src/routes/Court/components/CourtCaseNumber/CourtCaseNumberInput.tsx
Outdated
Show resolved
Hide resolved
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.
Two more import considerations
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: 2
Outside diff range and nitpick comments (3)
apps/judicial-system/web/src/utils/hooks/useCase/index.ts (2)
Line range hint
370-370
: Avoid using the delete operator for performance reasons.+ updatesToCase.force = undefined
Line range hint
123-123
: Optimize the use of spread syntax in accumulators.+ Object.assign(currentUpdates, nextUpdates) + return currentUpdatesapps/judicial-system/web/src/routes/Shared/Cases/ActiveCases.tsx (1)
Line range hint
219-219
: Mark JSX elements without children as self-closing for cleaner code.+ <motion.tr />
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (4)
- apps/judicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx (1 hunks)
- apps/judicial-system/web/src/routes/Court/components/CourtCaseNumber/CourtCaseNumberInput.tsx (1 hunks)
- apps/judicial-system/web/src/routes/Shared/Cases/ActiveCases.tsx (9 hunks)
- apps/judicial-system/web/src/utils/hooks/useCase/index.ts (5 hunks)
Files skipped from review as they are similar to previous changes (1)
- apps/judicial-system/web/src/routes/Court/components/CasesInProgressTable/CasesInProgressTable.tsx
Additional context used
Path-based instructions (3)
apps/judicial-system/web/src/routes/Court/components/CourtCaseNumber/CourtCaseNumberInput.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."
apps/judicial-system/web/src/utils/hooks/useCase/index.ts (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."
apps/judicial-system/web/src/routes/Shared/Cases/ActiveCases.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."
Biome
apps/judicial-system/web/src/utils/hooks/useCase/index.ts
[error] 370-370: Avoid the delete operator which can impact performance. (lint/performance/noDelete)
Unsafe fix: Use an undefined assignment instead.
[error] 123-123: Avoid the use of spread (
...
) syntax on accumulators. (lint/performance/noAccumulatingSpread)Spread syntax should be avoided on accumulators (like those in
.reduce
) because it causes a time complexity ofO(n^2)
.
Consider methods such as .splice or .push instead.apps/judicial-system/web/src/routes/Shared/Cases/ActiveCases.tsx
[error] 219-219: JSX elements without children should be marked as self-closing. In JSX, it is valid for any element to be self-closing. (lint/style/useSelfClosingElements)
Unsafe fix: Use a SelfClosingElement instead
Additional comments not posted (1)
apps/judicial-system/web/src/utils/hooks/useCase/index.ts (1)
254-254
: Use optional chaining to safely access properties on potentially undefined objects.Likely invalid or redundant comment.
apps/judicial-system/web/src/routes/Court/components/CourtCaseNumber/CourtCaseNumberInput.tsx
Show resolved
Hide resolved
* Add POSTPONED_TO_VERDICT radio button * Change Radio to Checkbox * Add column to Case table -- IndictmentDecision * Update IndictmentDecision * Postponed until verdict tag in cases * Disable subpoena screen if a case is postponed until verdict * Add a postpone until verdict tag for defenders * Checkpoint * Checkpoint * Merge * Determining when step is valid when postponing until verdict * Checkpoint * Change all instances of Array<something> to something[] * Only show InfoCard on summary page if indictment decison is POSTPONING_UNTIL_VERDICT * Wipe courtDate out when postponing until verdict * Move scheduled info card to overview page * Save court date when postponing until verdict * Checkpoint * Fixing update functionality * Fix case state on cases page * Fix migration * Add location to verdict date * Cleanup * Allow judges to remove set court date * Added test * Allows prosecutors to cancel submitted indictments * Hides buttons when prosecutor has asked for cancellation * Adds unit tests * Updates unit tests * Fixes unit tests * Rewrite open case * Adds modal for cancelling case * Fixes back navigation * Update apps/judicial-system/web/src/routes/Prosecutor/Indictments/Overview/Overview.tsx Co-authored-by: Ívar Oddsson <[email protected]> * Refactors code * Rewrites condition * Completes cancellation * Removes obsolete unit tests * Fixes test helpers * Simplifies code * Simplifies code * Improves imports * Improves imports * Improves imports * Simplifies type * Simplifies expressions * Correct function declaration --------- Co-authored-by: Ívar Oddsson <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* Add POSTPONED_TO_VERDICT radio button * Change Radio to Checkbox * Add column to Case table -- IndictmentDecision * Update IndictmentDecision * Postponed until verdict tag in cases * Disable subpoena screen if a case is postponed until verdict * Add a postpone until verdict tag for defenders * Checkpoint * Checkpoint * Merge * Determining when step is valid when postponing until verdict * Checkpoint * Change all instances of Array<something> to something[] * Only show InfoCard on summary page if indictment decison is POSTPONING_UNTIL_VERDICT * Wipe courtDate out when postponing until verdict * Move scheduled info card to overview page * Save court date when postponing until verdict * Checkpoint * Fixing update functionality * Fix case state on cases page * Fix migration * Add location to verdict date * Cleanup * Allow judges to remove set court date * Added test * Allows prosecutors to cancel submitted indictments * Hides buttons when prosecutor has asked for cancellation * Adds unit tests * Updates unit tests * Fixes unit tests * Rewrite open case * Adds modal for cancelling case * Fixes back navigation * Update apps/judicial-system/web/src/routes/Prosecutor/Indictments/Overview/Overview.tsx Co-authored-by: Ívar Oddsson <[email protected]> * Refactors code * Rewrites condition * Completes cancellation * Removes obsolete unit tests * Fixes test helpers * Simplifies code * Simplifies code * Improves imports * Improves imports * Improves imports * Simplifies type * Simplifies expressions * Correct function declaration --------- Co-authored-by: Ívar Oddsson <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Complete Cancellation
Afturköllun ákæru - dómstóll
What
Why
Screenshots / Gifs
Screen.Recording.2024-06-09.at.17.52.42.mov
Checklist:
Summary by CodeRabbit
New Features
CourtDate
component for rendering court date information.CasesInProgressTable
for displaying ongoing court cases.CourtCaseNumberInput
for handling court case number input and validation.Bug Fixes
COMPLETE
action from "Lokað" to "Lokið".Refactor
WAITING_FOR_CANCELLATION
.FormProvider
component for improved case handling.CourtCaseNumber
component to useFormContext
.ActiveCases
component for better state and event management.useCase
hook.Style
Table
component to handle click events conditionally.