Skip to content
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): Table for reviewed cases #14778

Merged
merged 9 commits into from
May 14, 2024
Merged

Conversation

unakb
Copy link
Member

@unakb unakb commented May 13, 2024

Ríksak - Skrifstofa - Tafla um yfirlesin mál

What

Display table of reviewed cases for public prosecutor staff

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features

    • Added a new field indictmentReviewDecision to the case list entries.
    • Introduced a new React component CasesReviewed for public prosecutors to view reviewed cases.
  • Enhancements

    • Added new internationalized messages for better localization support in the CasesReviewed component.

Copy link
Contributor

coderabbitai bot commented May 13, 2024

Walkthrough

The recent updates introduce a new field, indictmentReviewDecision, to the CaseListEntry class within the judicial system API. Additionally, new message definitions have been added to support internationalization for reviewed cases in the public prosecutor's route of the web application. These changes include updates to both the model and UI components, ensuring that reviewed cases are displayed with detailed information, including review decisions and other relevant case details.

Changes

Files Change Summary
.../case-list/models/caseList.model.ts Added a new field indictmentReviewDecision of type IndictmentCaseReviewDecision to CaseListEntry.
.../web/messages/Core/tables.ts Added a new message definition for reviewDecision in the tables object.
.../PublicProsecutor/Tables/CasesReviewed.strings.ts Added new message definitions for title, reviewTagAppealed, reviewTagAccepted, infoContainerMessage, and infoContainerTitle.
.../PublicProsecutor/Tables/CasesReviewed.tsx Introduced a new React component CasesReviewed for rendering a table of reviewed cases with detailed information.

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@unakb unakb marked this pull request as ready for review May 13, 2024 16:19
@unakb unakb requested a review from a team as a code owner May 13, 2024 16:19
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5b78050 and dea4ff2.
Files selected for processing (7)
  • apps/judicial-system/api/src/app/modules/case-list/models/caseList.model.ts (2 hunks)
  • apps/judicial-system/backend/src/app/modules/case/interceptors/caseList.interceptor.ts (1 hunks)
  • apps/judicial-system/web/messages/Core/tables.ts (1 hunks)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (3 hunks)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.strings.ts (1 hunks)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.tsx (1 hunks)
  • apps/judicial-system/web/src/routes/Shared/Cases/cases.graphql (1 hunks)
Files skipped from review due to trivial changes (1)
  • apps/judicial-system/web/messages/Core/tables.ts
Additional Context Used
Path-based Instructions (6)
apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.strings.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/cases.graphql (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/PublicProsecutor/Cases/PublicProsecutorCases.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/backend/src/app/modules/case/interceptors/caseList.interceptor.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/api/src/app/modules/case-list/models/caseList.model.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/PublicProsecutor/Tables/CasesReviewed.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 (2)
apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (1)
User: oddsson
PR: island-is/island.is#14673
File: apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesForReview.tsx:79-79
Timestamp: 2024-05-06T23:16:04.892Z
Learning: The implementation of `mapIndictmentCaseStateToTagVariant` in `TagCaseState.tsx`, which maps only `CaseState.ACCEPTED` to a specific tag and defaults others to an "unknown" status, is intentional as per the application's requirements.
apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.tsx (1)
User: oddsson
PR: island-is/island.is#14673
File: apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesForReview.tsx:79-79
Timestamp: 2024-05-06T23:16:04.892Z
Learning: The implementation of `mapIndictmentCaseStateToTagVariant` in `TagCaseState.tsx`, which maps only `CaseState.ACCEPTED` to a specific tag and defaults others to an "unknown" status, is intentional as per the application's requirements.
Additional comments not posted (7)
apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.strings.ts (1)

3-32: All message definitions are correctly structured and contain appropriate content for internationalization.

apps/judicial-system/web/src/routes/Shared/Cases/cases.graphql (1)

90-90: The addition of indictmentReviewDecision to the GraphQL query is appropriate and aligns with the PR's objectives to enhance case management features.

apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (2)

29-47: The logic to categorize cases based on indictmentReviewDecision is implemented efficiently using reduce. This approach is both concise and effective for the intended functionality.


67-69: The rendering of CasesForReview and CasesReviewComplete components based on the categorized cases is correctly implemented. This ensures that cases are displayed appropriately based on their review status.

apps/judicial-system/backend/src/app/modules/case/interceptors/caseList.interceptor.ts (1)

60-60: The inclusion of indictmentReviewDecision in the response object of the interceptor is correctly implemented. It ensures that the frontend receives necessary data without exposing sensitive information.

apps/judicial-system/api/src/app/modules/case-list/models/caseList.model.ts (1)

112-113: The addition of indictmentReviewDecision to the CaseListEntry model is correctly annotated with GraphQL decorators, ensuring it integrates well with the API's schema.

apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.tsx (1)

30-104: The CasesReviewed component is well-implemented with clear separation of concerns and efficient use of React patterns like useMemo for decision mapping. The use of Table and TableInfoContainer components enhances the modularity and maintainability of the code.

Copy link

codecov bot commented May 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 36.94%. Comparing base (e84c270) to head (9addb22).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #14778      +/-   ##
==========================================
- Coverage   36.94%   36.94%   -0.01%     
==========================================
  Files        6312     6312              
  Lines      128511   128505       -6     
  Branches    36657    36656       -1     
==========================================
- Hits        47475    47471       -4     
+ Misses      81036    81034       -2     
Flag Coverage Δ
api 3.44% <ø> (ø)
api-domains-mortgage-certificate 35.06% <ø> (+0.03%) ⬆️
auth-shared 75.00% <ø> (ø)
dokobit-signing 60.92% <ø> (+0.09%) ⬆️
judicial-system-message 65.92% <ø> (ø)
judicial-system-message-handler 66.03% <ø> (ø)
message-queue 68.39% <ø> (ø)
nest-feature-flags 51.46% <ø> (+0.06%) ⬆️
services-auth-admin-api 50.69% <ø> (ø)
services-auth-delegation-api 62.51% <ø> (ø)
services-auth-ids-api 54.77% <ø> (+0.01%) ⬆️
services-auth-personal-representative 49.96% <ø> (+<0.01%) ⬆️
services-auth-personal-representative-public 45.53% <ø> (+0.05%) ⬆️
services-auth-public-api 50.35% <ø> (+<0.01%) ⬆️
services-user-profile 62.76% <ø> (-0.10%) ⬇️
skilavottord-ws 23.79% <ø> (ø)
web 1.91% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
.../modules/case/interceptors/caseList.interceptor.ts 38.46% <ø> (ø)
apps/judicial-system/web/messages/Core/tables.ts 100.00% <ø> (ø)
...s/PublicProsecutor/Cases/PublicProsecutorCases.tsx 0.00% <ø> (ø)
...src/app/modules/case-list/models/caseList.model.ts 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e84c270...9addb22. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented May 13, 2024

Datadog Report

All test runs eb265e1 🔗

97 Total Test Services: 0 Failed, 95 Passed
🔻 Test Sessions change in coverage: 3 decreased, 4 increased, 193 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-backend 0 0 0 81 0 37.96s 1 no change Link
air-discount-scheme-web 0 0 0 2 0 11.85s N/A Link
api 0 0 0 4 0 5.15s N/A Link
api-catalogue-services 0 0 0 23 0 17.54s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 0s N/A Link
api-domains-assets 0 0 0 3 0 26.62s 1 no change Link
api-domains-auth-admin 0 0 0 18 0 13.35s 1 no change Link
api-domains-communications 0 0 0 5 0 46.96s 1 no change Link
api-domains-criminal-record 0 0 0 5 0 16.96s N/A Link
api-domains-driving-license 0 0 0 23 0 1m 2.57s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (3)

  • clients-middlewares - jest 75.77% (-0.11%) - Details
  • judicial-system-web - jest 32.54% (-0.07%) - Details
  • judicial-system-api - jest 18.98% (-0.02%) - Details

Copy link
Member

@oddsson oddsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nitpicks

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between dea4ff2 and 873ffe8.
Files selected for processing (1)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 873ffe8 and 5954313.
Files selected for processing (4)
  • apps/judicial-system/api/src/app/modules/case-list/models/caseList.model.ts (2 hunks)
  • apps/judicial-system/web/messages/Core/tables.ts (1 hunks)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.strings.ts (1 hunks)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (4)
  • apps/judicial-system/api/src/app/modules/case-list/models/caseList.model.ts
  • apps/judicial-system/web/messages/Core/tables.ts
  • apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.strings.ts
  • apps/judicial-system/web/src/routes/PublicProsecutor/Tables/CasesReviewed.tsx

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Review Details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5954313 and d9c4b76.
Files selected for processing (1)
  • apps/judicial-system/api/src/app/modules/case-list/models/caseList.model.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/judicial-system/api/src/app/modules/case-list/models/caseList.model.ts

@oddsson oddsson added the automerge Merge this PR as soon as all checks pass label May 14, 2024
@kodiakhq kodiakhq bot merged commit a0a26e1 into main May 14, 2024
239 checks passed
@kodiakhq kodiakhq bot deleted the j-s/reviewed-indictment-cases branch May 14, 2024 14:23
Ballioli pushed a commit that referenced this pull request May 17, 2024
* feat(j-s): Table for reviewed cases

* Update CasesReviewed.tsx

* cleanup

* chore: nx format:write update dirty files

---------

Co-authored-by: andes-it <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants