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): Service requirement #14644

Merged
merged 13 commits into from
May 7, 2024
Merged

feat(j-s): Service requirement #14644

merged 13 commits into from
May 7, 2024

Conversation

oddsson
Copy link
Member

@oddsson oddsson commented Apr 30, 2024

Service requirement

Asana

What

Implement a way for district judges and registrars to determine the service requirements, i.e. whether or not a ruling needs to be served to convicts in indictment cases, for each convicted person.

Why

This is the first step in creating a tool for Ríkissaksóknari. They need this info to be able to determine whether or not to appeal cases to the court of appeals or not.

Screenshots / Gifs

Screen.Recording.2024-04-30.at.14.03.44.mov

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 service requirement options for defendants in closed cases, enhancing case management features.
    • Introduced new UI components such as BlueBox, SectionHeading, and Text to improve visual presentation and user interaction.
    • Implemented new strings and labels to support internationalization and better user communication in the judicial system web application.
  • Bug Fixes

    • Removed unused imports and components, streamlining the functionality and improving the application's performance.
  • Refactor

    • Renamed and restructured the import path for the IndictmentOverview component to Overview, ensuring better organization and clarity in the codebase.

@oddsson oddsson requested review from a team as code owners April 30, 2024 11:10
@oddsson oddsson requested a review from johannaagma April 30, 2024 11:10
Copy link
Contributor

coderabbitai bot commented Apr 30, 2024

Walkthrough

The recent updates revolve around implementing a new serviceRequirement functionality throughout the judicial system application. These changes span GraphQL queries, UI components for managing defendant service requirements, backend model adjustments, and string additions for displaying service requirement messages. The enhancements aim to streamline user interactions and data management related to service requirements in legal processes.

Changes

File Path Change Summary
.../FormProvider/case.graphql Added serviceRequirement field to the Case query.
.../IndictmentOverview/IndictmentOverview.tsx Introduced components for service requirements, removed unused imports and components.
.../types/src/index.ts, .../types/src/lib/case.ts Added ServiceRequirement enum and exported it.
.../IndictmentOverview/IndictmentOverview.strings.ts Added strings for service requirements display.
.../yfirlit/[id].ts, .../Court/Indictments/Overview/... Renamed and restructured IndictmentOverview to Overview.
.../Court/Indictments/Overview/Overview.tsx New component for managing indictment overviews with service requirement features.
.../backend/src/.../defendant.model.ts Added serviceRequirement property to Defendant model.
.../SectionHeading/SectionHeading.tsx Enhanced SectionHeading to accept a dynamic heading prop for customizable heading levels.

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.

Copy link

codecov bot commented Apr 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.00%. Comparing base (b6ae114) to head (beb8194).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #14644   +/-   ##
=======================================
  Coverage   37.00%   37.00%           
=======================================
  Files        6263     6263           
  Lines      127104   127095    -9     
  Branches    36370    36365    -5     
=======================================
  Hits        47033    47033           
+ Misses      80071    80062    -9     
Flag Coverage Δ
air-discount-scheme-backend 54.02% <ø> (ø)
api 3.47% <ø> (ø)
api-catalogue-services 77.85% <ø> (ø)
application-system-api 42.12% <ø> (ø)
auth-api-lib 9.88% <ø> (-0.07%) ⬇️
clients-license-client 1.84% <ø> (ø)
clients-middlewares 73.96% <ø> (+0.36%) ⬆️
judicial-system-audit-trail 66.85% <ø> (ø)
services-auth-admin-api 50.62% <ø> (ø)
services-auth-delegation-api 62.48% <ø> (ø)
services-auth-ids-api 54.77% <ø> (+0.02%) ⬆️
services-sessions 65.55% <ø> (+0.04%) ⬆️
services-university-gateway 48.34% <ø> (+0.34%) ⬆️
services-user-notification 47.26% <ø> (+<0.01%) ⬆️

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

Files Coverage Δ
...app/modules/defendant/dto/updateDefendant.input.ts 0.00% <ø> (ø)
...rc/app/modules/defendant/models/defendant.model.ts 0.00% <ø> (ø)
...c/app/modules/defendant/dto/updateDefendant.dto.ts 100.00% <ø> (ø)
...rc/app/modules/defendant/models/defendant.model.ts 87.50% <ø> (-0.50%) ⬇️
...b/src/components/SectionHeading/SectionHeading.tsx 100.00% <ø> (ø)
...d/IndictmentOverview/IndictmentOverview.strings.ts 0.00% <ø> (ø)
...s/Shared/IndictmentOverview/IndictmentOverview.tsx 0.00% <ø> (ø)
libs/judicial-system/types/src/index.ts 100.00% <ø> (ø)
libs/judicial-system/types/src/lib/case.ts 95.05% <ø> (ø)

... and 3 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 b6ae114...beb8194. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Apr 30, 2024

Datadog Report

All test runs 6983abc 🔗

41 Total Test Services: 0 Failed, 40 Passed
🔻 Test Sessions change in coverage: 2 decreased, 6 increased, 136 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Wall Time Code Coverage Change Test Service View
air-discount-scheme-web 0 0 0 2 0 12.66ms 1 no change Link
api 0 0 0 4 0 22.08ms 1 no change Link
application-api-files 0 0 0 12 0 185.68ms 1 no change Link
application-core 0 0 0 90 0 4.81s 1 no change Link
application-system-api 0 0 0 111 2 1m 16.11s 1 no change Link
application-template-api-modules 0 0 0 107 0 51.21s 1 decreased (-0.02%) Link
application-templates-accident-notification 0 0 0 95 0 5.66s 1 no change Link
application-templates-criminal-record 0 0 0 2 0 30.4ms 1 no change Link
application-templates-driving-license 0 0 0 12 0 2.32s 1 no change Link
application-templates-example-payment 0 0 0 2 0 22.03ms 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (2)

  • judicial-system-web - jest 33.04% (-0.09%) - Details
  • application-template-api-modules - jest 26.37% (-0.02%) - Details

@oddsson oddsson removed request for a team and johannaagma April 30, 2024 15:30
Copy link
Member

@gudjong gudjong left a comment

Choose a reason for hiding this comment

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

Nice, minor issue with service requirement type in backend case model.

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 a92d19b and 8a8ed50.
Files selected for processing (3)
  • apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts (1 hunks)
  • apps/judicial-system/web/src/components/SectionHeading/SectionHeading.tsx (2 hunks)
  • apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx (3 hunks)
Files skipped from review as they are similar to previous changes (3)
  • apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts
  • apps/judicial-system/web/src/components/SectionHeading/SectionHeading.tsx
  • apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx

@oddsson oddsson added the automerge Merge this PR as soon as all checks pass label May 6, 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 8a8ed50 and beb8194.
Files selected for processing (1)
  • apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • apps/judicial-system/backend/src/app/modules/defendant/models/defendant.model.ts

@kodiakhq kodiakhq bot merged commit 2705e83 into main May 7, 2024
237 checks passed
@kodiakhq kodiakhq bot deleted the j-s/service-requirement branch May 7, 2024 00:14
brynjarorng added a commit that referenced this pull request May 7, 2024
* fix(university-gateway): adding back specilization (#14709)

* feat(system-e2e): Move system-e2e to NX, v3 (#14505)

* Revert "Revert "feat(system-e2e): Move system-e2e to NX (#14283)" (#14500)"

This reverts commit 2128dba.

* squash-cherry-pick #14094

* squash-cherry-pick #14498

* Don't use _podman.sh

* Revert tsconfig in system-e2e back to main

* Quoting and default in _docker.sh

* Use yarn, not npx when running playwright

* ci: levy debug

* Reset services to main

* entrypoint.sh cleanup

* Re-add custom addons

* Revert Dockerfile to main

* Copy only playwright parts from #14094

* Add bash to build image

* Pin patch versions

* reviewfix

* Removed unused targets

* Use common logger (from infra)

* Revert scripts/ back (mostly) to main

* Explain bash install in dockerfile

* Handle missing playwright to prevent obscure errors

* Don't force --output parameter usage

* use _podman.sh for local

* Also build *.d.ts

* Set entrypoint to call notify.* to allow ts and js

* Remove custom expect matchers

* Only use a single browser, not all

* Fix entrypoint playwright.config reference

* Remove toBeApplication usage

* Remove toHaveCountGreaterThan usage

* Remove unused typing file

* Some linting

* lintfix

* Remove unused code

* Only use logger

* Fixed log usage

* Use suggested esbuild executor

* Revert "Use suggested esbuild executor"

This reverts commit 0f8dfe8.

---------

Co-authored-by: Jón Levy <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* fix(service-portal): Documents logging and ui fixes. (#14707)

* Update doc service v2

* log doc id

* Update documentsClientV2.service.ts

* Update documentsClientV2.service.ts

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* fix(j-s): Robot Appeal Ruling Date (#14706)

* Fixes date columns

* Removes logging

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* chore(j-s): Use Table component for prison cases (#14673)

* Use Table component for prison cases

* Remove unused import

* Remove unused code

* Add appeal state tags

* Memoize renderTabl

* Fix types

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* feat(j-s): Service requirement (#14644)

* Add field to defendant table

* Add radiobuttons to indictmentoverview page

* UI tweeks

* Sending to public prosecutor is now an action

* District court users now have a dedicated indictment overview page

* Remove unused export

* Fix types

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

* Revert "feat(system-e2e): Move system-e2e to NX, v3 (#14505)" (#14713)

This reverts commit c29664f.

* fix(service-portal): Add couple of housing benefit ui fixes (#14711)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>

---------

Co-authored-by: berglindoma13 <[email protected]>
Co-authored-by: Kristofer <[email protected]>
Co-authored-by: Jón Levy <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Þórður H <[email protected]>
Co-authored-by: Guðjón Guðjónsson <[email protected]>
Co-authored-by: Ívar Oddsson <[email protected]>
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.

2 participants