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): Show correct tag in prison cases #17640

Merged
merged 3 commits into from
Jan 28, 2025
Merged

Conversation

oddsson
Copy link
Member

@oddsson oddsson commented Jan 24, 2025

Show correct tag in prison cases

Asana

What

We always show "ACCEPTED" tag in prison cases table regardless of whether or not the validToDate is in the past.

Screenshots / Gifs

Screenshot 2025-01-24 at 10 57 46

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

  • Bug Fixes
    • Improved case state rendering in the Prison Cases view to accurately display the current state of each case.
    • Enhanced the TagCaseState component to dynamically reflect case states based on actual case data.

These changes ensure a more precise and context-aware representation of case statuses, providing users with accurate information about the current state of prison cases.

@oddsson oddsson requested a review from a team as a code owner January 24, 2025 10:57
Copy link
Contributor

coderabbitai bot commented Jan 24, 2025

Walkthrough

The pull request modifies the PrisonCases.tsx file in the judicial system web application. The primary change involves updating the renderTable function to dynamically render the TagCaseState component. Instead of using a static CaseState.ACCEPTED, the implementation now uses row.state and row.isValidToDateInThePast to accurately represent the state of each case. This change ensures that the displayed case states reflect the actual data from the cases array.

Changes

File Change Summary
apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx Modified renderTable function to use dynamic case state rendering with row.state and row.isValidToDateInThePast

Possibly related PRs

Suggested labels

automerge

Suggested reviewers

  • thorhildurt

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e35024 and c5b5127.

📒 Files selected for processing (1)
  • apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx

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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 35.53%. Comparing base (e596957) to head (a5e80f5).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #17640      +/-   ##
==========================================
- Coverage   35.56%   35.53%   -0.04%     
==========================================
  Files        7037     7037              
  Lines      150706   150804      +98     
  Branches    43036    43073      +37     
==========================================
- Hits        53596    53581      -15     
- Misses      97110    97223     +113     
Flag Coverage Δ
air-discount-scheme-backend 48.13% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.33% <ø> (ø)
api-domains-air-discount-scheme 37.84% <ø> (ø)
api-domains-auth-admin 48.49% <ø> (ø)
application-system-api 38.63% <ø> (+<0.01%) ⬆️
application-ui-shell 21.99% <ø> (ø)
auth-admin-web 2.43% <ø> (ø)
auth-shared 75.00% <ø> (ø)
contentful-apps 4.56% <ø> (ø)
financial-aid-backend 51.35% <ø> (ø)
judicial-system-api 20.07% <ø> (ø)
judicial-system-backend 55.79% <ø> (ø)
judicial-system-scheduler 71.20% <ø> (ø)
judicial-system-web 27.97% <ø> (ø)
license-api 42.77% <ø> (-0.10%) ⬇️
services-auth-delegation-api 58.52% <ø> (+0.08%) ⬆️
services-auth-ids-api 52.49% <ø> (+<0.01%) ⬆️
services-sessions 65.31% <ø> (ø)
services-university-gateway 49.48% <ø> (+0.14%) ⬆️
services-user-notification 46.51% <ø> (+0.02%) ⬆️
services-user-profile 56.91% <ø> (+0.06%) ⬆️
skilavottord-ws 23.97% <ø> (ø)
web 2.39% <ø> (ø)

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

Files with missing lines Coverage Δ
...system/web/src/routes/Shared/Cases/PrisonCases.tsx 0.00% <ø> (ø)

... and 11 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 e596957...a5e80f5. Read the comment docs.

@datadog-island-is
Copy link

Datadog Report

All test runs 29f9b6b 🔗

10 Total Test Services: 0 Failed, 10 Passed
🔻 Test Sessions change in coverage: 4 decreased, 1 increased (+0.46%), 195 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 63 0 38.25s 1 no change Link
air-discount-scheme-web 0 0 0 2 0 8.8s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 26.15s 1 no change Link
api-domains-assets 0 0 0 3 0 13.49s N/A Link
api-domains-auth-admin 0 0 0 18 0 9.6s 1 no change Link
api-domains-communications 0 0 0 5 0 29.1s 1 no change Link
api-domains-criminal-record 0 0 0 5 0 9.43s N/A Link
api-domains-driving-license 0 0 0 23 0 33.76s 1 decreased (-0.02%) Link
api-domains-education 0 0 0 8 0 40.7s 1 decreased (-0.05%) Link
api-domains-health-insurance 0 0 0 4 0 16.03s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (4)

  • clients-financial-statements-inao - jest 51.62% (-0.08%) - Details
  • api-domains-education - jest 30.91% (-0.05%) - Details
  • services-auth-delegation-api - jest 50.44% (-0.04%) - Details
  • api-domains-driving-license - jest 34.16% (-0.02%) - Details

@thorhildurt thorhildurt enabled auto-merge January 27, 2025 11:40
@oddsson oddsson disabled auto-merge January 28, 2025 10:35
@oddsson oddsson enabled auto-merge January 28, 2025 14:52
@oddsson oddsson added this pull request to the merge queue Jan 28, 2025
Merged via the queue into main with commit 2f78a0a Jan 28, 2025
28 checks passed
@oddsson oddsson deleted the j-s/prison-cases-tags branch January 28, 2025 17:47
robertaandersen pushed a commit that referenced this pull request Jan 29, 2025
Show correct tag in prison cases

Co-authored-by: Jón Levy <[email protected]>
RunarVestmann pushed a commit that referenced this pull request Jan 29, 2025
Show correct tag in prison cases

Co-authored-by: Jón Levy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants