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): Court Arrangements #15406

Merged
merged 4 commits into from
Jul 2, 2024
Merged

fix(j-s): Court Arrangements #15406

merged 4 commits into from
Jul 2, 2024

Conversation

gudjong
Copy link
Member

@gudjong gudjong commented Jul 1, 2024

Court Arrangements

Böggur í date input á þingfestingar skjá/fyrirkalls skjá

What

  • Fixes time update in court arrangements. When editing the time part of the court date all data was cleared.

Why

  • Verified bug.

Screenshots / Gifs

Screen.Recording.2024-07-01.at.18.51.42.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

    • Enhanced handling of court arrangements with refined date and location management.
  • Bug Fixes

    • Improved conditional logic for setting courtEndTime in CourtRecord component.
  • Refactor

    • Updated various components to use arraignmentDate instead of courtDate for better consistency.
    • Simplified the logic within multiple functions to handle the new DateLog type appropriately.

@gudjong gudjong requested a review from a team as a code owner July 1, 2024 18:52
Copy link
Contributor

coderabbitai bot commented Jul 1, 2024

Walkthrough

The changes focus on improving the handling and validation of court dates within various components and functions. Key adjustments include initializing courtDate with the DateLog type, updating state management and validation logic, and refining the components to use arraignmentDate in place of courtDate where appropriate. This enhances the clarity and reliability of court date handling across the application.

Changes

Files & Paths Change Summary
apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.tsx Updated state initialization, modified courtDate and courtRoom state management, and refined handleCourtDateChange.
apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx Changed courtDate prop source in CourtArrangements component to workingCase.courtDate.
apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx Updated function parameter from courtDate?.date to courtDate, changed courtDate prop to workingCase.arraignmentDate.
apps/judicial-system/web/src/routes/Court/RestrictionCase/CourtRecord/CourtRecord.tsx Simplified logic for handling courtEndTime, now directly setting it if conditions are true.
apps/judicial-system/web/src/routes/Court/RestrictionCase/HearingArrangements/HearingArrangements.tsx Updated function parameter from courtDate?.date to courtDate, changed courtDate prop to workingCase.arraignmentDate.
apps/judicial-system/web/src/utils/validate.ts Changed function parameters and internal logic to handle DateLog type for arraignmentDate instead of courtDate.

Tip

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

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.
  • OSS projects are currently opted into early access features by default.

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 Jul 1, 2024

Datadog Report

All test runs db42382 🔗

73 Total Test Services: 0 Failed, 72 Passed
🔻 Test Sessions change in coverage: 2 decreased, 198 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 35.23s N/A Link
air-discount-scheme-web 0 0 0 2 0 10.25s N/A Link
api 0 0 0 4 0 4.7s N/A Link
api-catalogue-services 0 0 0 23 0 17.31s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 39.85s 1 no change Link
api-domains-assets 0 0 0 3 0 25.64s 1 no change Link
api-domains-auth-admin 0 0 0 18 0 13.19s 1 no change Link
api-domains-communications 0 0 0 5 0 47.22s 1 no change Link
api-domains-criminal-record 0 0 0 5 0 17.89s 1 no change Link
api-domains-driving-license 0 0 0 23 0 1m 0.4s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (2)

  • application-core - jest 78.72% (-0.21%) - Details
  • application-templates-parental-leave - jest 33.21% (-0.1%) - Details

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.06%. Comparing base (b8a64b9) to head (0638208).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #15406      +/-   ##
==========================================
+ Coverage   37.05%   37.06%   +0.01%     
==========================================
  Files        6541     6541              
  Lines      133265   133226      -39     
  Branches    38197    38172      -25     
==========================================
  Hits        49376    49376              
+ Misses      83889    83850      -39     
Flag Coverage Δ
air-discount-scheme-backend 53.99% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.44% <ø> (ø)
api-catalogue-services 77.85% <ø> (ø)
api-domains-health-insurance 34.88% <ø> (ø)
api-domains-mortgage-certificate 35.32% <ø> (ø)
application-templates-driving-license 15.89% <ø> (ø)
application-templates-estate 11.94% <ø> (ø)
feature-flags 90.16% <ø> (ø)
judicial-system-message-handler 66.10% <ø> (ø)
message-queue 68.39% <ø> (ø)
regulations 16.78% <ø> (ø)
services-auth-admin-api 51.29% <ø> (ø)
services-auth-delegation-api 61.62% <ø> (ø)
services-auth-ids-api 54.92% <ø> (-0.02%) ⬇️
services-auth-personal-representative 48.63% <ø> (ø)
services-auth-personal-representative-public 44.41% <ø> (ø)
services-auth-public-api 51.40% <ø> (ø)
services-documents 60.96% <ø> (ø)
services-endorsements-api 55.45% <ø> (ø)
services-sessions 65.42% <ø> (ø)
services-university-gateway 48.50% <ø> (ø)
services-user-notification 48.21% <ø> (-0.01%) ⬇️
services-user-profile 62.40% <ø> (ø)

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

Files Coverage Δ
...components/CourtArrangements/CourtArrangements.tsx 6.66% <ø> (+3.21%) ⬆️
...routes/Court/Indictments/Conclusion/Conclusion.tsx 0.00% <ø> (ø)
...src/routes/Court/Indictments/Subpoena/Subpoena.tsx 0.00% <ø> (ø)
...onCase/HearingArrangements/HearingArrangements.tsx 0.00% <ø> (ø)
.../Court/RestrictionCase/CourtRecord/CourtRecord.tsx 0.00% <ø> (ø)
...onCase/HearingArrangements/HearingArrangements.tsx 0.00% <ø> (ø)
apps/judicial-system/web/src/utils/validate.ts 41.94% <ø> (+0.69%) ⬆️

... 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 b8a64b9...0638208. 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: 5

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ac05f77 and b954790.

Files selected for processing (7)
  • apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.tsx (3 hunks)
  • apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx (1 hunks)
  • apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx (2 hunks)
  • apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx (2 hunks)
  • apps/judicial-system/web/src/routes/Court/RestrictionCase/CourtRecord/CourtRecord.tsx (1 hunks)
  • apps/judicial-system/web/src/routes/Court/RestrictionCase/HearingArrangements/HearingArrangements.tsx (2 hunks)
  • apps/judicial-system/web/src/utils/validate.ts (3 hunks)
Additional context used
Path-based instructions (7)
apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.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/routes/Court/RestrictionCase/HearingArrangements/HearingArrangements.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/routes/Court/Indictments/Subpoena/Subpoena.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/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.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/utils/validate.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/Court/RestrictionCase/CourtRecord/CourtRecord.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/routes/Court/Indictments/Conclusion/Conclusion.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 (3)
apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.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.
apps/judicial-system/web/src/utils/validate.ts (1)
Learnt from: gudjong
PR: island-is/island.is#15241
File: apps/judicial-system/backend/src/app/modules/defendant/dto/updateDefendant.dto.ts:87-90
Timestamp: 2024-06-14T15:09:02.068Z
Learning: In some parts of the codebase, `verdictViewDate` is treated as a string, not a Date object, specifically in `updateDefendant.input.ts`, `defendant.model.ts`, and `case.transformer.ts`.
apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.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.
Biome
apps/judicial-system/web/src/routes/Court/RestrictionCase/HearingArrangements/HearingArrangements.tsx

[error] 80-85: Unnecessary use of boolean literals in conditional expression.

Simplify your code by directly assigning the result without using a ternary operator.
If your goal is negation, you may use the logical NOT (!) or double NOT (!!) operator for clearer and concise code.
Check for more details about NOT operator.
Unsafe fix: Remove the conditional expression with

(lint/complexity/noUselessTernary)


[error] 80-83: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

apps/judicial-system/web/src/utils/validate.ts

[error] 44-44: Use a regular expression literal instead of the RegExp constructor.

Regular expression literals avoid some escaping required in a string literal, and are easier to analyze statically.
Safe fix: Use a literal notation instead.

(lint/complexity/useRegexLiterals)

Additional comments not posted (9)
apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.tsx (3)

49-62: Ensure correct handling of court date changes.

The useEffect hook correctly updates the court date state based on the working case. Verify if the dependencies are correctly set to avoid unnecessary re-renders.


159-162: Ensure correct handling of court room changes.

The onChange handler correctly updates the court room state and calls handleCourtRoomChange. Verify if the function handleCourtRoomChange is correctly implemented.


135-139: Verify the state initialization for courtRoom.

The courtRoom state is initialized based on courtDate.location. Ensure that this change is consistent with the expected structure of DateLog.

Verification successful

The state initialization for courtRoom is consistent with the structure of DateLog.

  • The DateLog interface defines an optional location property, which aligns with the use of courtDate?.location in the CourtArrangements component.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the structure of DateLog and its initialization.

# Test: Check if DateLog is defined and consistent with the courtRoom initialization.
rg --type ts 'interface DateLog'

Length of output: 158



Script:

#!/bin/bash
# Description: Extract the structure of the DateLog interface to verify the presence of the location property.

# Extract the definition of the DateLog interface.
rg --type ts --multiline 'interface DateLog \{[^}]*\}' apps/judicial-system/digital-mailbox-api/src/app/modules/cases/models/internal/internalCase.response.ts

Length of output: 265

apps/judicial-system/web/src/routes/Court/RestrictionCase/HearingArrangements/HearingArrangements.tsx (1)

132-132: Verify the parameter update.

The courtDate parameter is updated to workingCase.arraignmentDate. Ensure that this change is consistent with the expected structure of DateLog.

Verification successful

Verify the parameter update.

The courtDate parameter is updated to workingCase.arraignmentDate, which is consistent with the DateLog structure. This change aligns with the expected properties used in HearingArrangements.

  • workingCase.arraignmentDate is defined as DateLog, which includes properties such as date and location.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the structure of DateLog and its usage in validation functions.

# Test: Check if DateLog is defined and consistent with the parameter update.
rg --type ts 'interface DateLog'

Length of output: 158



Script:

#!/bin/bash
# Description: Fetch the definition of DateLog interface and its properties.

# Extract the definition of DateLog interface.
rg --type ts 'interface DateLog' -A 10

# Check the usage of courtDate in HearingArrangements component.
rg --type ts 'courtDate' apps/judicial-system/web/src/routes/Court/RestrictionCase/HearingArrangements/HearingArrangements.tsx

Length of output: 1238



Script:

#!/bin/bash
# Description: Verify the structure of workingCase to ensure arraignmentDate aligns with DateLog.date.

# Check the definition of workingCase and its properties.
rg --type ts 'interface WorkingCase' -A 20

Length of output: 44



Script:

#!/bin/bash
# Description: Locate the file containing the definition of WorkingCase and examine its properties.

# Locate the file containing the definition of WorkingCase.
fd 'WorkingCase.ts'

# Extract the definition of WorkingCase and its properties.
rg --type ts 'interface WorkingCase' -A 20 $(fd 'WorkingCase.ts')

Length of output: 85



Script:

#!/bin/bash
# Description: Broaden the search for the definition of WorkingCase and examine its properties.

# Search for the definition of WorkingCase across all TypeScript files.
rg --type ts 'interface WorkingCase' -A 20

Length of output: 44



Script:

#!/bin/bash
# Description: Search for the definition and context of arraignmentDate within TypeScript files.

# Search for arraignmentDate across all TypeScript files.
rg --type ts 'arraignmentDate'

Length of output: 14487

apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx (1)

103-103: Verify the parameter update.

The courtDate parameter is updated to workingCase.arraignmentDate. Ensure that this change is consistent with the expected structure of DateLog.

Verification successful

Verification of parameter update in isSubpoenaStepValid function

The isSubpoenaStepValid function correctly uses the arraignmentDate parameter, which matches the expected structure of DateLog. The function validates the date and location fields from arraignmentDate or workingCase.arraignmentDate and ensures all defendants have a subpoenaType.

  • Function Implementation:

    export const isSubpoenaStepValid = (
      workingCase: Case,
      arraignmentDate?: DateLog,
    ): boolean => {
      return (
        validate([
          [
            arraignmentDate
              ? arraignmentDate.date
              : workingCase.arraignmentDate?.date,
            ['empty', 'date-format'],
          ],
          [
            arraignmentDate
              ? arraignmentDate.location
              : workingCase.arraignmentDate?.location,
            ['empty'],
          ],
        ]).isValid &&
        Boolean(
          workingCase.defendants?.every((defendant) => defendant.subpoenaType),
        )
      )
    }
  • Validation Logic:

    • The function checks if arraignmentDate is provided; if not, it falls back to workingCase.arraignmentDate.
    • It validates the date and location fields to ensure they are not empty and the date is in the correct format.
    • It checks that all defendants have a subpoenaType.

The parameter update to workingCase.arraignmentDate is consistent with the expected structure of DateLog.

  • Files Reviewed:
    • apps/judicial-system/web/src/routes/Court/Indictments/Subpoena/Subpoena.tsx
    • apps/judicial-system/web/src/utils/validate.ts
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the structure of DateLog and its usage in validation functions.

# Test: Check if DateLog is defined and consistent with the parameter update.
rg --type ts 'interface DateLog'

Length of output: 158



Script:

#!/bin/bash
# Description: Inspect the `DateLog` interface definition and check the implementation of `isSubpoenaStepValid`.

# Display the `DateLog` interface definition.
rg --type ts --context 5 'interface DateLog' apps/judicial-system/digital-mailbox-api/src/app/modules/cases/models/internal/internalCase.response.ts

# Search for the `isSubpoenaStepValid` function implementation.
ast-grep --lang ts --pattern 'function isSubpoenaStepValid($_, $_) { $$$ }'

Length of output: 435



Script:

#!/bin/bash
# Description: Search for the `isSubpoenaStepValid` function implementation using `rg`.

# Search for the `isSubpoenaStepValid` function definition.
rg --type ts 'function isSubpoenaStepValid'

Length of output: 45



Script:

#!/bin/bash
# Description: Use `ast-grep` to search for all function definitions and locate `isSubpoenaStepValid`.

# Search for all function definitions and locate `isSubpoenaStepValid`.
ast-grep --lang ts --pattern 'function $_($$$) { $$$ }'

Length of output: 437946



Script:

#!/bin/bash
# Description: Use `rg` to search for the `isSubpoenaStepValid` function usage across the codebase.

# Search for the `isSubpoenaStepValid` function usage.
rg 'isSubpoenaStepValid'

Length of output: 511



Script:

#!/bin/bash
# Description: Display the `isSubpoenaStepValid` function implementation in `apps/judicial-system/web/src/utils/validate.ts`.

# Display the `isSubpoenaStepValid` function implementation.
ast-grep --lang ts --pattern 'export const isSubpoenaStepValid = ($_) => { $$$ }' apps/judicial-system/web/src/utils/validate.ts

Length of output: 130



Script:

#!/bin/bash
# Description: Use `rg` to search for the `isSubpoenaStepValid` function definition in `apps/judicial-system/web/src/utils/validate.ts`.

# Search for the `isSubpoenaStepValid` function definition.
rg 'isSubpoenaStepValid' apps/judicial-system/web/src/utils/validate.ts

Length of output: 108



Script:

#!/bin/bash
# Description: Display the full implementation of the `isSubpoenaStepValid` function from `apps/judicial-system/web/src/utils/validate.ts`.

# Display the full implementation of the `isSubpoenaStepValid` function.
sed -n '/export const isSubpoenaStepValid = (/,/^}/p' apps/judicial-system/web/src/utils/validate.ts

Length of output: 653

apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx (1)

113-113: Verify the parameter update.

The courtDate parameter is updated to workingCase.arraignmentDate. Ensure that this change is consistent with the expected structure of DateLog.

Verification successful

Verify the parameter update.

The courtDate parameter is consistently assigned the value of workingCase.arraignmentDate, which aligns with the expected structure and usage within the HearingArrangements component. The workingCase object, including its arraignmentDate property, is correctly utilized throughout the component.

  • The workingCase object is defined and used extensively in the codebase, particularly in the HearingArrangements component.
  • The arraignmentDate property of the workingCase object is correctly assigned to courtDate.

There are no inconsistencies found with the parameter update.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the structure of DateLog and its usage in validation functions.

# Test: Check if DateLog is defined and consistent with the parameter update.
rg --type ts 'interface DateLog'

Length of output: 158



Script:

#!/bin/bash
# Retrieve the definition of the DateLog interface
rg --type ts --context 10 'interface DateLog' apps/judicial-system/digital-mailbox-api/src/app/modules/cases/models/internal/internalCase.response.ts

# Search for the usage of DateLog within the HearingArrangements component
rg --type ts 'DateLog' apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx

Length of output: 608



Script:

#!/bin/bash
# Search for the usage of courtDate within the HearingArrangements component
rg --type ts 'courtDate' apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx

Length of output: 372



Script:

#!/bin/bash
# Search for the definition of workingCase and its arraignmentDate property
rg --type ts 'workingCase' apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx

Length of output: 2114



Script:

#!/bin/bash
# Search for the definition of workingCase and its properties, specifically focusing on arraignmentDate
rg --type ts 'interface.*Case' apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx

Length of output: 136



Script:

#!/bin/bash
# Search for the definition of Case interface or type in the entire project
rg --type ts 'interface.*Case|type.*Case'

Length of output: 85570



Script:

#!/bin/bash
# Search for the definition of Case interface or type in the apps/judicial-system/web/src directory
rg --type ts 'interface.*Case|type.*Case' apps/judicial-system/web/src

Length of output: 22668



Script:

#!/bin/bash
# Search for the definition of workingCase and its arraignmentDate property in the apps/judicial-system/web/src directory
rg --type ts 'workingCase' apps/judicial-system/web/src

Length of output: 355408

apps/judicial-system/web/src/utils/validate.ts (1)

337-347: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to isCourtHearingArrangementsStepValidRC match the new signature.

apps/judicial-system/web/src/routes/Court/RestrictionCase/CourtRecord/CourtRecord.tsx (1)

493-504: LGTM!

The code changes are approved.

apps/judicial-system/web/src/routes/Court/Indictments/Conclusion/Conclusion.tsx (1)

382-382: Verify the prop type of courtDate in CourtArrangements.

Ensure that the courtDate prop in the CourtArrangements component is of the expected type.

Verification successful

Verify the prop type of courtDate in CourtArrangements.

The courtDate prop in the CourtArrangements component is of type DateLog | null. This confirms that the prop type is correctly defined.

  • apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.tsx, lines 3-8
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the prop type of `courtDate` in `CourtArrangements`.

# Test: Search for the `CourtArrangements` component definition. Expect: `courtDate` prop of type `DateLog`.
rg --type js --type ts --type tsx $'CourtArrangements'

Length of output: 81



Script:

#!/bin/bash
# Description: Verify the prop type of `courtDate` in `CourtArrangements`.

# Test: Search for the `CourtArrangements` component definition and check the `courtDate` prop type.
rg --type js --type ts --type typescript 'CourtArrangements'

Length of output: 95



Script:

#!/bin/bash
# Description: Verify the prop type of `courtDate` in `CourtArrangements`.

# Test: Search for the `CourtArrangements` component definition and check the `courtDate` prop type.
rg --type js --type ts --type tsx 'CourtArrangements'

Length of output: 81



Script:

#!/bin/bash
# Description: Verify the prop type of `courtDate` in `CourtArrangements`.

# Test: Search for the `CourtArrangements` component definition and check the `courtDate` prop type.
rg --type-add 'tsx:*.tsx' --type tsx 'CourtArrangements'

Length of output: 2853



Script:

#!/bin/bash
# Description: Verify the prop type of `courtDate` in `CourtArrangements`.

# Extract the `CourtArrangements` component definition and its props from the `CourtArrangements.tsx` file.
rg --multiline --multiline-dotall --type tsx 'export const CourtArrangements: FC<Props>' apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.tsx

Length of output: 198



Script:

#!/bin/bash
# Description: Verify the prop type of `courtDate` in `CourtArrangements`.

# Extract the `CourtArrangements` component definition and its props from the `CourtArrangements.tsx` file.
rg --type-add 'tsx:*.tsx' --type tsx 'CourtArrangements' -A 20 apps/judicial-system/web/src/components/CourtArrangements/CourtArrangements.tsx

Length of output: 2399

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 b954790 and 1a09eda.

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

Copy link
Member

@unakb unakb left a comment

Choose a reason for hiding this comment

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

There's a change that accidentally removes the feature of displaying the requested court date when the user first lands on this hearing arrangements page.

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 1a09eda and cec84c2.

Files selected for processing (2)
  • apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx (4 hunks)
  • apps/judicial-system/web/src/routes/Court/RestrictionCase/HearingArrangements/HearingArrangements.tsx (4 hunks)
Files skipped from review due to trivial changes (1)
  • apps/judicial-system/web/src/routes/Court/InvestigationCase/HearingArrangements/HearingArrangements.tsx
Files skipped from review as they are similar to previous changes (1)
  • apps/judicial-system/web/src/routes/Court/RestrictionCase/HearingArrangements/HearingArrangements.tsx

Copy link
Member

@unakb unakb left a comment

Choose a reason for hiding this comment

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

Nice 😊

@gudjong gudjong added the automerge Merge this PR as soon as all checks pass label Jul 2, 2024
@kodiakhq kodiakhq bot merged commit 4f44e1a into main Jul 2, 2024
245 checks passed
@kodiakhq kodiakhq bot deleted the j-s/fix-court-arrangement branch July 2, 2024 15:04
oskarjs pushed a commit that referenced this pull request Aug 20, 2024
* Fixes court arrangement

* Removes redundant null check

* Fixes initialization when requested court date should be used to autofill arraignment date

---------

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.

2 participants