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): Show courtRecord files in indictments to everyone once uploaded #15817

Merged
merged 6 commits into from
Sep 2, 2024

Conversation

oddsson
Copy link
Member

@oddsson oddsson commented Aug 29, 2024

Show courtRecord files in indictments to everyone once uploaded

Asana

What

Show courtRecord files in indictments to everyone once uploaded

Why

We used to only show the court record after the case had been completed. Users have a need to see court records uploaded, f.x. after a postponement.

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

    • Introduced unit tests for the IndictmentCaseFilesList component to verify rendering behavior with court record case files.
  • Improvements

    • Enhanced rendering logic in the IndictmentCaseFilesList component for better performance and readability.
    • Improved visibility of uploaded case files in the UI based on their presence.
  • Bug Fixes

    • Removed unnecessary import in the AppealCaseFilesOverview test, streamlining the test suite.

@oddsson oddsson requested a review from a team as a code owner August 29, 2024 14:14
Copy link
Contributor

coderabbitai bot commented Aug 29, 2024

Walkthrough

The changes involve the removal of an unused import in the AppealCaseFilesOverview.spec.tsx file, the introduction of a new test file for the IndictmentCaseFilesList component, and modifications to the rendering logic in the IndictmentCaseFilesList.tsx component. These updates streamline the test suite and enhance the component's rendering efficiency while maintaining existing functionalities.

Changes

Files Change Summary
.../AppealCaseFilesOverview/AppealCaseFilesOverview.spec.tsx Removed the import of within from the test file, indicating a simplification of the test suite.
.../IndictmentCaseFilesList/IndictmentCaseFilesList.spec.tsx Introduced a new test file containing unit tests for the IndictmentCaseFilesList component, verifying its rendering logic with mock data.
.../IndictmentCaseFilesList/IndictmentCaseFilesList.tsx Adjusted rendering logic for improved clarity, simplified string literals for props, and reorganized conditional rendering for uploaded case files.

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 using 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Tip

Early access features: enabled

We are currently testing the following features in early access:

  • Anthropic claude-3-5-sonnet for code reviews: Anthropic claims that the new Claude model has stronger code understanding and code generation capabilities than their previous models. Note: Our default code review model was also updated late last week. Please compare the quality of the reviews between the two models by toggling the early access feature.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues on the discussion post.

@datadog-island-is
Copy link

Datadog Report

Branch report: j-s/court-records-for-everyone
Commit report: 50499c2
Test service: judicial-system-web

✅ 0 Failed, 332 Passed, 0 Skipped, 1m 12.86s Total Time
⬆️ Test Sessions change in coverage: 1 increased (+0.3%)

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 4 lines in your changes missing coverage. Please review.

Project coverage is 36.93%. Comparing base (ed805ae) to head (f59aba5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ndictmentCaseFilesList/IndictmentCaseFilesList.tsx 42.85% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15817      +/-   ##
==========================================
+ Coverage   36.90%   36.93%   +0.03%     
==========================================
  Files        6680     6680              
  Lines      136449   136587     +138     
  Branches    38741    38857     +116     
==========================================
+ Hits        50353    50452      +99     
- Misses      86096    86135      +39     
Flag Coverage Δ
air-discount-scheme-backend 54.20% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.39% <ø> (ø)
api-domains-air-discount-scheme 37.13% <ø> (ø)
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 53.90% <ø> (ø)
api-domains-communications 40.62% <ø> (ø)
api-domains-criminal-record 48.24% <ø> (ø)
api-domains-driving-license 44.56% <ø> (ø)
api-domains-education 31.72% <ø> (ø)
api-domains-health-insurance 35.17% <ø> (ø)
api-domains-mortgage-certificate 36.07% <ø> (ø)
api-domains-payment-schedule 41.40% <ø> (ø)
application-api-files 58.00% <ø> (ø)
application-core 72.28% <ø> (+0.33%) ⬆️
application-system-api 41.75% <ø> (ø)
application-template-api-modules 23.67% <ø> (ø)
application-templates-accident-notification 19.83% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 22.12% <ø> (ø)
application-templates-driving-license 15.98% <ø> (ø)
application-templates-estate 11.89% <ø> (ø)
application-templates-example-payment 20.79% <ø> (ø)
application-templates-financial-aid 12.09% <ø> (ø)
application-templates-general-petition 18.86% <ø> (ø)
application-templates-health-insurance 23.27% <ø> (ø)
application-templates-inheritance-report 4.63% <ø> (ø)
application-templates-marriage-conditions 10.47% <ø> (ø)
application-templates-mortgage-certificate 44.39% <ø> (ø)
application-templates-parental-leave 28.40% <ø> (+0.11%) ⬆️
application-types 6.74% <ø> (ø)
application-ui-components 1.52% <ø> (ø)
application-ui-shell 21.17% <ø> (ø)
clients-charge-fjs-v2 27.54% <ø> (ø)
clients-driving-license 41.10% <ø> (ø)
clients-driving-license-book 44.20% <ø> (ø)
clients-financial-statements-inao 49.55% <ø> (ø)
clients-license-client 1.83% <ø> (ø)
clients-regulations 43.06% <ø> (ø)
clients-rsk-company-registry 30.64% <ø> (ø)
clients-rsk-personal-tax-return 38.00% <ø> (ø)
clients-smartsolutions 12.77% <ø> (ø)
clients-syslumenn 50.02% <ø> (ø)
cms 0.43% <ø> (ø)
cms-translations 39.78% <ø> (ø)
dokobit-signing 62.85% <ø> (ø)
download-service 44.67% <ø> (ø)
email-service 60.65% <ø> (ø)
feature-flags 90.69% <ø> (ø)
file-storage 53.01% <ø> (ø)
financial-aid-backend 56.48% <ø> (ø)
judicial-system-api 18.26% <ø> (ø)
judicial-system-audit-trail 68.53% <ø> (ø)
judicial-system-backend 56.20% <ø> (ø)
judicial-system-message 66.79% <ø> (ø)
judicial-system-message-handler 47.61% <ø> (ø)
judicial-system-scheduler 69.55% <ø> (ø)
judicial-system-web 28.75% <42.85%> (+0.32%) ⬆️
license-api 42.93% <ø> (ø)
nest-config 78.07% <ø> (ø)
nest-feature-flags 51.91% <ø> (ø)
nova-sms 62.18% <ø> (ø)
portals-admin-regulations-admin 2.01% <ø> (ø)
portals-core 16.22% <ø> (ø)
services-auth-admin-api 51.06% <ø> (-0.01%) ⬇️
services-auth-delegation-api 61.57% <ø> (ø)
services-auth-ids-api 53.84% <ø> (-0.02%) ⬇️
services-auth-personal-representative 48.09% <ø> (ø)
services-auth-personal-representative-public 44.00% <ø> (+0.04%) ⬆️
services-auth-public-api 51.96% <ø> (+0.01%) ⬆️
services-endorsements-api 55.11% <ø> (ø)
services-sessions 65.61% <ø> (ø)
services-university-gateway 48.52% <ø> (ø)
services-user-notification 48.00% <ø> (+0.03%) ⬆️
services-user-profile 62.27% <ø> (-0.03%) ⬇️
web 1.88% <ø> (ø)

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

Files with missing lines Coverage Δ
...ndictmentCaseFilesList/IndictmentCaseFilesList.tsx 75.80% <42.85%> (+72.52%) ⬆️

... and 9 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 ed805ae...f59aba5. 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 c4eba52 and 97256a0.

Files selected for processing (3)
  • apps/judicial-system/web/src/components/AppealCaseFilesOverview/AppealCaseFilesOverview.spec.tsx (1 hunks)
  • apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.spec.tsx (1 hunks)
  • apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx (4 hunks)
Files skipped from review due to trivial changes (1)
  • apps/judicial-system/web/src/components/AppealCaseFilesOverview/AppealCaseFilesOverview.spec.tsx
Additional context used
Path-based instructions (2)
apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.spec.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/IndictmentCaseFilesList/IndictmentCaseFilesList.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/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx (1)
Learnt from: unakb
PR: island-is/island.is#15378
File: apps/judicial-system/web/src/routes/Court/Indictments/Summary/Summary.tsx:86-100
Timestamp: 2024-06-27T14:37:07.823Z
Learning: User unakb prefers explicit case handling in switch statements for key functionalities like `getRulingDecisionTagColor` to ensure clarity and avoid assumptions that a case was overlooked.
Additional comments not posted (5)
apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.spec.tsx (2)

1-17: LGTM!

The import statements are appropriate and necessary for the test file.


19-35: LGTM!

The test case is well-written and correctly checks the rendering of court records.

apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx (3)

Line range hint 1-20: LGTM!

The import statements are appropriate and necessary for the component.


Line range hint 21-40: LGTM!

The RenderFiles component is well-written and correctly renders PdfButton components.


Line range hint 42-238: LGTM!

The IndictmentCaseFilesList component is well-written and the changes improve the clarity and efficiency of the rendering logic.

@oddsson oddsson added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Sep 2, 2024
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 97256a0 and f59aba5.

Files selected for processing (2)
  • apps/judicial-system/web/src/components/AppealCaseFilesOverview/AppealCaseFilesOverview.spec.tsx (1 hunks)
  • apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx (4 hunks)
Files skipped from review as they are similar to previous changes (2)
  • apps/judicial-system/web/src/components/AppealCaseFilesOverview/AppealCaseFilesOverview.spec.tsx
  • apps/judicial-system/web/src/components/IndictmentCaseFilesList/IndictmentCaseFilesList.tsx

@kodiakhq kodiakhq bot merged commit b74a253 into main Sep 2, 2024
196 of 205 checks passed
@kodiakhq kodiakhq bot deleted the j-s/court-records-for-everyone branch September 2, 2024 14:06
jonnigs pushed a commit that referenced this pull request Sep 12, 2024
…oaded (#15817)

* Show court records to everyone once uploaded

* Show court records when uploaded

* Add test
@coderabbitai coderabbitai bot mentioned this pull request Oct 29, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants