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

fix(j-s): Only display cases with certain ruling decisions as up for review #15218

Merged
merged 5 commits into from
Jun 14, 2024

Conversation

unakb
Copy link
Member

@unakb unakb commented Jun 13, 2024

Skrifstofa Ríkissaksóknara á bara að fá mál til yfirlestrar ef þeim líkur með dómi eða viðurlagaákvörðun

What

Only display cases that have a ruling or fine as up for review by the public prosecutors office

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

    • Enhanced case filtering for public prosecutors based on indictmentRulingDecision.
  • Improvements

    • Expanded appeal expiration info visibility to include both defenders and indictment reviewers in the indictment overview.

@unakb unakb requested a review from a team as a code owner June 13, 2024 09:53
Copy link
Contributor

coderabbitai bot commented Jun 13, 2024

Walkthrough

The changes primarily focus on enhancing case filtering and display logic in the judicial system web application. Specifically, conditions for filtering cases based on indictment ruling decisions were updated, and the appeal expiration information visibility condition was modified to consider both the defender's role and if the user is the indictment reviewer.

Changes

File Path Summary of Changes
.../PublicProsecutorCases.tsx Added imports for CaseIndictmentRulingDecision and IndictmentDecision. Updated case filtering conditions to incorporate indictmentRulingDecision.
.../IndictmentOverview.tsx Modified the condition for displaying appeal expiration information in the InfoCardClosedIndictment component, adding a check for the user being the indictment reviewer by their ID.

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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.

@datadog-island-is
Copy link

datadog-island-is bot commented Jun 13, 2024

Datadog Report

All test runs c495624 🔗

101 Total Test Services: 0 Failed, 99 Passed
🔻 Test Sessions change in coverage: 4 decreased, 196 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 32.33s N/A Link
air-discount-scheme-web 0 0 0 2 0 8.77s N/A Link
api 0 0 0 4 0 4.47s N/A Link
api-catalogue-services 0 0 0 23 0 17.2s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 40.65s 1 no change Link
api-domains-assets 0 0 0 3 0 26.63s N/A Link
api-domains-auth-admin 0 0 0 18 0 13.51s 1 no change Link
api-domains-communications 0 0 0 5 0 44.95s 1 no change Link
api-domains-criminal-record 0 0 0 5 0 17.81s N/A Link
api-domains-driving-license 0 0 0 23 0 57.9s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (4)

  • application-core - jest 78.6% (-0.22%) - Details
  • services-university-gateway - jest 44.57% (-0.05%) - Details
  • services-auth-personal-representative-public - jest 46.91% (-0.02%) - Details
  • auth-api-lib - jest 15.88% (-0.02%) - Details

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

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

Project coverage is 37.10%. Comparing base (7b0c0f8) to head (43bd1a3).

Current head 43bd1a3 differs from pull request most recent head f164232

Please upload reports for the commit f164232 to get more accurate results.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15218      +/-   ##
==========================================
- Coverage   37.10%   37.10%   -0.01%     
==========================================
  Files        6448     6448              
  Lines      131446   131457      +11     
  Branches    37566    37570       +4     
==========================================
+ Hits        48775    48776       +1     
- Misses      82671    82681      +10     
Flag Coverage Δ
air-discount-scheme-backend 53.66% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.51% <ø> (ø)
api-catalogue-services 77.85% <ø> (ø)
api-domains-air-discount-scheme 35.96% <ø> (+0.06%) ⬆️
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 54.29% <ø> (ø)
api-domains-communications 40.66% <ø> (+0.01%) ⬆️
api-domains-criminal-record 47.09% <ø> (ø)
api-domains-driving-license 44.25% <ø> (ø)
api-domains-education 33.59% <ø> (+0.07%) ⬆️
api-domains-health-insurance 33.89% <ø> (ø)
api-domains-mortgage-certificate 34.87% <ø> (+0.06%) ⬆️
api-domains-payment-schedule 40.32% <ø> (ø)
application-api-files 56.25% <ø> (+0.05%) ⬆️
application-core 71.52% <ø> (-0.35%) ⬇️
application-system-api 41.96% <ø> (+<0.01%) ⬆️
application-template-api-modules 24.38% <ø> (-0.01%) ⬇️
application-templates-accident-notification 19.92% <ø> (ø)
application-templates-car-recycling 4.23% <ø> (ø)
application-templates-criminal-record 22.35% <ø> (ø)
application-templates-driving-license 15.88% <ø> (ø)
application-templates-estate 11.91% <ø> (ø)
application-templates-example-payment 21.01% <ø> (ø)
application-templates-financial-aid 12.18% <ø> (ø)
application-templates-general-petition 18.95% <ø> (ø)
application-templates-health-insurance 23.38% <ø> (ø)
application-templates-inheritance-report 4.74% <ø> (ø)
application-templates-parental-leave 28.46% <ø> (ø)
application-types 7.37% <ø> (ø)
application-ui-components 1.43% <ø> (ø)
application-ui-shell 21.61% <ø> (ø)
auth-admin-web 2.43% <ø> (ø)
auth-api-lib 14.29% <ø> (ø)
auth-nest-tools 30.44% <ø> (ø)
auth-react 23.05% <ø> (ø)
auth-shared 75.00% <ø> (ø)
clients-charge-fjs-v2 22.58% <ø> (ø)
clients-driving-license 40.23% <ø> (+0.08%) ⬆️
clients-driving-license-book 43.45% <ø> (+0.06%) ⬆️
clients-financial-statements-inao 48.48% <ø> (+0.07%) ⬆️
clients-license-client 1.84% <ø> (ø)
clients-middlewares 72.75% <ø> (-0.27%) ⬇️
clients-regulations 41.94% <ø> (ø)
clients-rsk-company-registry 29.24% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 49.44% <ø> (ø)
clients-zendesk 55.26% <ø> (ø)
cms 0.44% <ø> (ø)
cms-translations 39.76% <ø> (ø)
content-search-index-manager 95.65% <ø> (ø)
content-search-toolkit 8.57% <ø> (ø)
contentful-apps 6.05% <ø> (ø)
dokobit-signing 61.95% <ø> (ø)
download-service 44.34% <ø> (+0.03%) ⬆️
email-service 61.42% <ø> (ø)
feature-flags 89.91% <ø> (ø)
file-storage 51.80% <ø> (+0.24%) ⬆️
financial-aid-backend 56.37% <ø> (ø)
financial-aid-shared 18.70% <ø> (ø)
icelandic-names-registry-backend 53.95% <ø> (ø)
infra-nest-server 48.33% <ø> (ø)
infra-tracing 43.24% <ø> (ø)
island-ui-core 28.90% <ø> (ø)
judicial-system-api 18.20% <ø> (ø)
judicial-system-audit-trail 67.49% <ø> (+0.18%) ⬆️
judicial-system-backend 55.78% <ø> (ø)
judicial-system-formatters 81.40% <ø> (ø)
judicial-system-message 65.92% <ø> (ø)
judicial-system-message-handler 66.39% <ø> (ø)
judicial-system-scheduler 57.71% <ø> (ø)
judicial-system-types 49.06% <ø> (ø)
license-api 43.05% <ø> (ø)
localization 10.15% <ø> (ø)
logging 48.43% <ø> (ø)
message-queue 68.39% <ø> (ø)
nest-audit 68.20% <ø> (ø)
nest-config 77.40% <ø> (ø)
nest-feature-flags 50.60% <ø> (-0.67%) ⬇️
nest-problem 46.08% <ø> (ø)
nest-sequelize 94.44% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
nova-sms 63.41% <ø> (ø)
portals-admin-regulations-admin 2.06% <ø> (-0.01%) ⬇️
portals-core 16.29% <ø> (ø)
reference-backend 50.31% <ø> (ø)
regulations 16.78% <ø> (ø)
residence-history 85.00% <ø> (ø)
services-auth-admin-api 51.39% <ø> (ø)
services-auth-delegation-api 61.66% <ø> (ø)
services-auth-ids-api 54.84% <ø> (ø)
services-auth-personal-representative 48.49% <ø> (-0.04%) ⬇️
services-auth-personal-representative-public 44.37% <ø> (-0.04%) ⬇️
services-auth-public-api 50.52% <ø> (+0.05%) ⬆️
services-documents 60.81% <ø> (ø)
services-endorsements-api 55.11% <ø> (+0.02%) ⬆️
services-sessions 65.27% <ø> (+0.04%) ⬆️
services-university-gateway 48.21% <ø> (ø)
services-user-notification 47.61% <ø> (+0.02%) ⬆️
services-user-profile 62.19% <ø> (ø)
shared-components 27.92% <ø> (ø)
shared-form-fields 31.92% <ø> (ø)
shared-mocking 64.62% <ø> (ø)
shared-pii 92.85% <ø> (ø)
shared-problem 87.50% <ø> (ø)
shared-utils 30.90% <ø> (ø)
skilavottord-ws 23.78% <ø> (ø)
web 1.93% <ø> (-0.01%) ⬇️

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

Files Coverage Δ
...s/Shared/IndictmentOverview/IndictmentOverview.tsx 0.00% <ø> (ø)
...s/PublicProsecutor/Cases/PublicProsecutorCases.tsx 0.00% <0.00%> (ø)

... and 8 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 7b0c0f8...f164232. Read the comment docs.

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 f26bd9d and 065f5d2.

Files selected for processing (1)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (2 hunks)
Files not reviewed due to errors (1)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (Error: Server error. Please try again later.)
Additional context used
Path-based instructions (1)
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."
Learnings (1)
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.

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.

One quick question

@unakb unakb requested a review from oddsson June 13, 2024 13:30
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 065f5d2 and 7cac27e.

Files selected for processing (1)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (2 hunks)
Files not reviewed due to errors (1)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (no review received)
Additional context used
Path-based instructions (1)
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."
Learnings (1)
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.
GitHub Check: linting (judicial-system-web)
apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx

[warning] 15-15:
'IndictmentDecision' is defined but never used. Allowed unused vars must match /^_[a-zA-Z0-9]*$/u

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 7cac27e and 26c11c0.

Files selected for processing (1)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (2 hunks)
Files not summarized due to errors (1)
  • apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx: Error: Server error. Please try again later.
Additional context used
Path-based instructions (1)
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."
Additional comments not posted (2)
apps/judicial-system/web/src/routes/PublicProsecutor/Cases/PublicProsecutorCases.tsx (2)

12-15: Imports are correctly added for CaseIndictmentRulingDecision and CaseListEntry.


38-43: The updated filtering logic correctly implements the feature to only display cases with certain rulings as up for review. The conditions are well-structured and follow the intended logic described in the PR.

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 26c11c0 and 43bd1a3.

Files selected for processing (1)
  • apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx (1 hunks)
Additional context used
Path-based instructions (1)
apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.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/routes/Shared/IndictmentOverview/IndictmentOverview.tsx (1)
User: unakb
PR: island-is/island.is#14922
File: apps/judicial-system/web/src/components/InfoCard/DefendantInfo/DefendantInfo.tsx:43-49
Timestamp: 2024-05-27T10:53:40.687Z
Learning: The `getAppealExpirationInfo` function in `DefendantInfo.tsx` correctly uses `today < expiryDate` to determine if the current date is before the appeal expiration date.
Additional comments not posted (2)
apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx (2)

96-99: The logic for displaying appeal expiration information is correctly updated to include checks for both the DEFENDER role and whether the user is the indictment reviewer. This ensures that the right users see the appeal expiration information, aligning with the PR's objectives.


Line range hint 1-1: The file structure and use of TypeScript in this component are in line with NextJS best practices. The explicit typing and efficient use of React hooks contribute to both readability and performance.

@gudjong gudjong added the automerge Merge this PR as soon as all checks pass label Jun 14, 2024
@gudjong gudjong removed the request for review from oddsson June 14, 2024 16:37
@kodiakhq kodiakhq bot merged commit de91e4d into main Jun 14, 2024
41 checks passed
@kodiakhq kodiakhq bot deleted the j-s/filter-reviewable-cases branch June 14, 2024 16:45
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