-
Notifications
You must be signed in to change notification settings - Fork 57
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(service-portal): law and order module #14819
Conversation
WalkthroughThe changes involve updating ownership entries in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
@coderabbitai review |
Actions PerformedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 10
Out of diff range and nitpick comments (9)
apps/service-portal/src/components/ContentBreadcrumbs/ContentBreadcrumbs.tsx (4)
Line range hint
1-1
: Ensure consistent import order.Consider organizing imports by grouping external and internal imports separately for better readability.
Line range hint
14-14
: Consider adding a return type for theparseNavItemName
function.const parseNavItemName = ( navItem: ServicePortalNavigationItem, activePath: PathMatch<string> | null, ): string | MessageDescriptor => { ... }
Line range hint
28-28
: Consider adding a return type for thefindBreadcrumbsPath
function.const findBreadcrumbsPath = ( navItem: ServicePortalNavigationItem | undefined, currentBreadcrumbs: ContentBreadcrumb[], ): void => { ... }
Line range hint
50-50
: Avoid using deprecated components.Replace
BreadcrumbsDeprecated
with the updatedBreadcrumbs
component from@island.is/island-ui/core
.- BreadcrumbsDeprecated as Breadcrumbs, + Breadcrumbs,libs/service-portal/law-and-order/src/screens/Subpeana.tsx (1)
1-1
: Ensure consistent import order.Consider organizing imports by grouping external and internal imports separately for better readability.
libs/service-portal/core/src/components/UserInfoLine/UserInfoLine.tsx (3)
12-12
: Ensure consistent import order.Consider organizing imports by grouping external and internal imports separately for better readability.
30-33
: Consider adding a return type for theLineButton
type.type LineButton = { title: MessageDescriptor | string onClick: () => void }
78-78
: Consider adding a return type for theUserInfoLine
component.export const UserInfoLine: FC<React.PropsWithChildren<Props>> = ({ ... }): JSX.Element => { ... }libs/service-portal/law-and-order/src/components/DefenderChoices/DefenderChoices.tsx (1)
1-1
: Ensure consistent import order.Consider organizing imports by grouping external and internal imports separately for better readability.
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (40)
- apps/service-portal/src/components/ContentBreadcrumbs/ContentBreadcrumbs.tsx (1 hunks)
- apps/service-portal/src/lib/masterNavigation.ts (2 hunks)
- apps/service-portal/src/lib/modules.ts (2 hunks)
- libs/auth/scopes/src/lib/api.scope.ts (1 hunks)
- libs/service-portal/assets/src/screens/VehicleDetail/VehicleDetail.tsx (2 hunks)
- libs/service-portal/assets/src/screens/VehicleHistory/HistoryTableData.tsx (1 hunks)
- libs/service-portal/assets/src/utils/constants.ts (1 hunks)
- libs/service-portal/core/src/components/LinkButton/LinkButton.tsx (1 hunks)
- libs/service-portal/core/src/components/UserInfoLine/UserInfoLine.tsx (6 hunks)
- libs/service-portal/core/src/lib/messages.ts (2 hunks)
- libs/service-portal/core/src/utils/constants.ts (1 hunks)
- libs/service-portal/core/src/utils/dateUtils.ts (1 hunks)
- libs/service-portal/law-and-order/.babelrc (1 hunks)
- libs/service-portal/law-and-order/.eslintrc.json (1 hunks)
- libs/service-portal/law-and-order/README.md (1 hunks)
- libs/service-portal/law-and-order/codegen.yml (1 hunks)
- libs/service-portal/law-and-order/jest.config.ts (1 hunks)
- libs/service-portal/law-and-order/project.json (1 hunks)
- libs/service-portal/law-and-order/src/components/ConfirmationModal/ConfirmationModal.css.ts (1 hunks)
- libs/service-portal/law-and-order/src/components/ConfirmationModal/ConfirmationModal.tsx (1 hunks)
- libs/service-portal/law-and-order/src/components/DefenderChoices/DefenderChoices.tsx (1 hunks)
- libs/service-portal/law-and-order/src/components/InfoLines/InfoLines.css.ts (1 hunks)
- libs/service-portal/law-and-order/src/components/InfoLines/InfoLines.tsx (1 hunks)
- libs/service-portal/law-and-order/src/helpers/LawAndOrderContext.tsx (1 hunks)
- libs/service-portal/law-and-order/src/helpers/mockData.ts (1 hunks)
- libs/service-portal/law-and-order/src/index.ts (1 hunks)
- libs/service-portal/law-and-order/src/lib/const.ts (1 hunks)
- libs/service-portal/law-and-order/src/lib/messages.ts (1 hunks)
- libs/service-portal/law-and-order/src/lib/navigation.ts (1 hunks)
- libs/service-portal/law-and-order/src/lib/paths.ts (1 hunks)
- libs/service-portal/law-and-order/src/module.tsx (1 hunks)
- libs/service-portal/law-and-order/src/screens/CourtCaseDetail.tsx (1 hunks)
- libs/service-portal/law-and-order/src/screens/CourtCases.tsx (1 hunks)
- libs/service-portal/law-and-order/src/screens/LawAndOrderOverview.tsx (1 hunks)
- libs/service-portal/law-and-order/src/screens/Subpeana.tsx (1 hunks)
- libs/service-portal/law-and-order/src/screens/index.tsx (1 hunks)
- libs/service-portal/law-and-order/tsconfig.json (1 hunks)
- libs/service-portal/law-and-order/tsconfig.lib.json (1 hunks)
- libs/service-portal/law-and-order/tsconfig.spec.json (1 hunks)
- tsconfig.base.json (1 hunks)
Files skipped from review due to trivial changes (21)
- apps/service-portal/src/lib/modules.ts
- libs/auth/scopes/src/lib/api.scope.ts
- libs/service-portal/assets/src/screens/VehicleDetail/VehicleDetail.tsx
- libs/service-portal/assets/src/screens/VehicleHistory/HistoryTableData.tsx
- libs/service-portal/assets/src/utils/constants.ts
- libs/service-portal/core/src/utils/constants.ts
- libs/service-portal/law-and-order/.babelrc
- libs/service-portal/law-and-order/.eslintrc.json
- libs/service-portal/law-and-order/README.md
- libs/service-portal/law-and-order/codegen.yml
- libs/service-portal/law-and-order/jest.config.ts
- libs/service-portal/law-and-order/project.json
- libs/service-portal/law-and-order/src/components/ConfirmationModal/ConfirmationModal.css.ts
- libs/service-portal/law-and-order/src/components/InfoLines/InfoLines.css.ts
- libs/service-portal/law-and-order/src/index.ts
- libs/service-portal/law-and-order/src/lib/const.ts
- libs/service-portal/law-and-order/src/lib/paths.ts
- libs/service-portal/law-and-order/tsconfig.json
- libs/service-portal/law-and-order/tsconfig.lib.json
- libs/service-portal/law-and-order/tsconfig.spec.json
- tsconfig.base.json
Additional Context Used
Path-based Instructions (19)
libs/service-portal/law-and-order/src/lib/navigation.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/screens/LawAndOrderOverview.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/screens/index.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/core/src/components/LinkButton/LinkButton.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/screens/CourtCases.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/module.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/core/src/utils/dateUtils.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/helpers/LawAndOrderContext.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
apps/service-portal/src/lib/masterNavigation.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."
libs/service-portal/law-and-order/src/components/InfoLines/InfoLines.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/components/ConfirmationModal/ConfirmationModal.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/screens/CourtCaseDetail.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
apps/service-portal/src/components/ContentBreadcrumbs/ContentBreadcrumbs.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."
libs/service-portal/law-and-order/src/screens/Subpeana.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/core/src/components/UserInfoLine/UserInfoLine.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/components/DefenderChoices/DefenderChoices.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/lib/messages.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/law-and-order/src/helpers/mockData.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/core/src/lib/messages.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
Additional comments not posted (79)
libs/service-portal/law-and-order/src/lib/navigation.ts (1)
1-33
: The navigation structure is clear and logical. The use of constants for paths and messages ensures maintainability.libs/service-portal/law-and-order/src/screens/LawAndOrderOverview.tsx (1)
1-38
: The component is well-structured and uses localization effectively. The use ofIntroHeader
andUserInfoLine
components ensures consistency in the UI.libs/service-portal/law-and-order/src/screens/index.tsx (1)
1-36
: The component is well-structured and uses a provider to manage state. The dynamic rendering of components based on thecomponent
prop is a good approach.libs/service-portal/core/src/components/LinkButton/LinkButton.tsx (1)
Line range hint
1-48
: The component is well-structured and handles external links appropriately. The use of different variants for the button ensures flexibility.libs/service-portal/law-and-order/src/screens/CourtCases.tsx (5)
1-11
: Imports look good and necessary for the component functionality.
13-16
: Usage of hooks for localization is appropriate and follows best practices.
17-24
: Rendering ofIntroHeader
with appropriate props looks good.
25-45
: Mapping and rendering ofActionCard
for each court case are correctly implemented.
48-49
: Export statement is correct.libs/service-portal/law-and-order/src/module.tsx (3)
1-9
: Imports look good and necessary for the module functionality.
14-14
: Module name definition is correct.
15-46
: Routes definition is correct and follows best practices.libs/service-portal/core/src/utils/dateUtils.ts (6)
Line range hint
5-9
:dateParse
function is correctly implemented.
Line range hint
11-19
:formatDate
function is correctly implemented.
Line range hint
21-25
:formatDateWithTime
function is correctly implemented.
Line range hint
27-37
:icelandLocalTime
function is correctly implemented.
Line range hint
39-55
:displayMonthOrYear
function is correctly implemented.
65-66
:getDateLocale
function is correctly implemented.libs/service-portal/law-and-order/src/helpers/LawAndOrderContext.tsx (5)
1-9
: Imports look good and necessary for the context and provider functionality.
11-19
:LawAndOrderStateProps
type definition is correctly implemented.
21-29
:LawAndOrderContext
creation is correctly implemented.
31-59
:LawAndOrderProvider
component is correctly implemented and follows best practices.
61-61
:useLawAndOrderContext
hook is correctly implemented.apps/service-portal/src/lib/masterNavigation.ts (1)
24-24
: LGTM! EnsurelawAndOrderNavigation
is correctly defined and used.Verification successful
The definition and usage of
lawAndOrderNavigation
have been verified and are correct.
lawAndOrderNavigation
is defined inlibs/service-portal/law-and-order/src/lib/navigation.ts
.- It is correctly imported and used in
apps/service-portal/src/lib/masterNavigation.ts
.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition and usage of `lawAndOrderNavigation`. # Test: Search for the definition of `lawAndOrderNavigation`. Expect: Correct definition and usage. rg --type typescript $'lawAndOrderNavigation'Length of output: 79
Script:
#!/bin/bash # Description: Verify the definition and usage of `lawAndOrderNavigation`. # Test: Search for the definition of `lawAndOrderNavigation`. Expect: Correct definition and usage. rg --type ts 'lawAndOrderNavigation'Length of output: 356
libs/service-portal/law-and-order/src/components/InfoLines/InfoLines.tsx (1)
1-73
: LGTM! EnsureuseNamespaces
is correctly used andprops.groups
structure is well-defined.Verification successful
The
useNamespaces
hook is correctly used in theInfoLines
component, and theprops.groups
structure is well-defined. TheItems
type includes the expected properties (label
,value
,link
,action
), ensuring proper alignment with the component's usage.
useNamespaces
is correctly imported and used.- The
Items
type is defined with the necessary properties inlibs/service-portal/law-and-order/src/helpers/mockData.ts
.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `useNamespaces` and the structure of `props.groups`. # Test: Search for the usage of `useNamespaces` and the definition of `props.groups`. Expect: Correct usage and definition. rg --type typescript $'useNamespaces' rg --type typescript $'props.groups'Length of output: 142
Script:
#!/bin/bash # Description: Verify the usage of `useNamespaces` and the structure of `props.groups`. # Test: Search for the usage of `useNamespaces` in the codebase. rg 'useNamespaces' # Test: Search for the structure of `props.groups` in the codebase. rg 'props.groups'Length of output: 38648
Script:
#!/bin/bash # Description: Verify the definition of the `Items` type to ensure the `props.groups` structure is well-defined. # Test: Search for the definition of the `Items` type in the codebase. rg 'type Items' --type-add 'typescript:*.{ts,tsx}'Length of output: 132
Script:
#!/bin/bash # Description: Display the definition of the `Items` type to ensure it aligns with the usage in the `InfoLines` component. # Test: Display the definition of the `Items` type. rg 'export type Items' -A 10 --type-add 'typescript:*.{ts,tsx}'Length of output: 846
libs/service-portal/law-and-order/src/components/ConfirmationModal/ConfirmationModal.tsx (1)
1-117
: LGTM! EnsureuseNamespaces
anduseLawAndOrderContext
are correctly used.Verification successful
The
useNamespaces
anduseLawAndOrderContext
hooks are correctly used in theConfirmationModal.tsx
file. TheuseNamespaces
hook sets the namespace for localization, anduseLawAndOrderContext
manages the state related to law and order context.
useNamespaces('sp.law-and-order')
is used to set the namespace for localization.useLawAndOrderContext()
is used to access and manage the state related to subpoenas.Both hooks are correctly imported and utilized in the
SubpoenaConfirmationModal
component.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `useNamespaces` and `useLawAndOrderContext`. # Test: Search for the usage of `useNamespaces` and `useLawAndOrderContext`. Expect: Correct usage. rg --type typescript $'useNamespaces' rg --type typescript $'useLawAndOrderContext'Length of output: 151
Script:
#!/bin/bash # Description: Verify the usage of `useNamespaces` and `useLawAndOrderContext`. # Test: Search for the usage of `useNamespaces` and `useLawAndOrderContext`. Expect: Correct usage. rg 'useNamespaces' rg 'useLawAndOrderContext'Length of output: 39780
libs/service-portal/law-and-order/src/screens/CourtCaseDetail.tsx (1)
1-125
: LGTM! EnsureuseNamespaces
,useLocale
,useParams
, anduseLawAndOrderContext
are correctly used.Verification successful
The hooks
useNamespaces
,useLocale
,useParams
, anduseLawAndOrderContext
are correctly used in theCourtCaseDetail
component.
useNamespaces
is used to set the namespace for localization.useLocale
is used to get theformatMessage
function for localization.useParams
is used to retrieve theid
parameter from the route.useLawAndOrderContext
is used to get and set context values related to the law and order module.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `useNamespaces`, `useLocale`, `useParams`, and `useLawAndOrderContext`. # Test: Search for the usage of `useNamespaces`, `useLocale`, `useParams`, and `useLawAndOrderContext`. Expect: Correct usage. rg --type typescript $'useNamespaces' rg --type typescript $'useLocale' rg --type typescript $'useParams' rg --type typescript $'useLawAndOrderContext'Length of output: 287
Script:
#!/bin/bash # Description: Verify the usage of `useNamespaces`, `useLocale`, `useParams`, and `useLawAndOrderContext`. # Test: Search for the usage of `useNamespaces`, `useLocale`, `useParams`, and `useLawAndOrderContext` in TypeScript files. rg --glob '*.ts' --glob '*.tsx' 'useNamespaces' rg --glob '*.ts' --glob '*.tsx' 'useLocale' rg --glob '*.ts' --glob '*.tsx' 'useParams' rg --glob '*.ts' --glob '*.tsx' 'useLawAndOrderContext'Length of output: 293666
libs/service-portal/law-and-order/src/lib/messages.ts (44)
4-7
: LGTM! The messagemyData
is correctly defined.
8-11
: LGTM! The messagecourtCases
is correctly defined.
12-15
: LGTM! The messagecourtCasesDescription
is correctly defined.
16-19
: LGTM! The messageseeInfo
is correctly defined.
20-23
: LGTM! The messagecourtCaseNotFound
is correctly defined.
24-27
: LGTM! The messagecourtCaseNumberNotRegistered
is correctly defined.
28-31
: LGTM! The messagedefendant
is correctly defined.
32-35
: LGTM! The messagesubpoena
is correctly defined.
36-39
: LGTM! The messagesubpoenaSent
is correctly defined.
40-43
: LGTM! The messageseeSubpoena
is correctly defined.
44-47
: LGTM! The messagesubpoenaNotFound
is correctly defined.
48-51
: LGTM! The messageprocess
is correctly defined.
52-55
: LGTM! The messagedefenseAttorney
is correctly defined.
56-59
: LGTM! The messagecaseInformation
is correctly defined.
60-63
: LGTM! The messageLOKECaseNumber
is correctly defined.
64-67
: LGTM! The messagecaseNumberCourt
is correctly defined.
68-71
: LGTM! The messagecourt
is correctly defined.
72-75
: LGTM! The messageprosecution
is correctly defined.
76-79
: LGTM! The messagejudge
is correctly defined.
80-83
: LGTM! The messagerequestedDateTime
is correctly defined.
84-87
: LGTM! The messageprosecutor
is correctly defined.
88-91
: LGTM! The messagetimeOfArrest
is correctly defined.
92-95
: LGTM! The messageconfirmedHearingDateTime
is correctly defined.
96-99
: LGTM! The messagestate
is correctly defined.
100-103
: LGTM! The messagetype
is correctly defined.
104-107
: LGTM! The messageinformation
is correctly defined.
108-111
: LGTM! The messagecaseNumberShort
is correctly defined.
112-115
: LGTM! The messageaccuser
is correctly defined.
116-119
: LGTM! The messageaccused
is correctly defined.
120-123
: LGTM! The messagedateOfHearing
is correctly defined.
124-127
: LGTM! The messageplace
is correctly defined.
128-131
: LGTM! The messagecourtType
is correctly defined.
132-135
: LGTM! The messagechooseDefenderTitle
is correctly defined.
136-139
: LGTM! The messagedefenderList
is correctly defined.
140-143
: LGTM! The messagechooseDefender
is correctly defined.
144-147
: LGTM! The messageoffice
is correctly defined.
148-151
: LGTM! The messagedate
is correctly defined.
152-155
: LGTM! The messageopenSubpeona
is correctly defined.
156-159
: LGTM! The messageconfirm
is correctly defined.
160-163
: LGTM! The messagecancel
is correctly defined.
164-167
: LGTM! The messageregistrationCompleted
is correctly defined.
168-171
: LGTM! The messagefirstChoiceNoDefender
is correctly defined.
172-176
: LGTM! The messagesecondChoiceChoosingLawyer
is correctly defined.
177-181
: LGTM! The messagethirdChoiceDelayChoice
is correctly defined.libs/service-portal/law-and-order/src/helpers/mockData.ts (6)
4-13
: Type definitions look good.
15-36
: Type definitions look good.
38-55
: Type definitions look good.
57-75
: Type definitions look good.
360-369
: Function looks good.
397-581
: Function looks good.libs/service-portal/core/src/lib/messages.ts (2)
1287-1291
: New tooltip message fordomsmalaraduneytidTooltip
looks good.
1514-1530
: New messages for the "Law and Order" module look good.
libs/service-portal/core/src/components/UserInfoLine/UserInfoLine.tsx
Outdated
Show resolved
Hide resolved
libs/service-portal/law-and-order/src/components/DefenderChoices/DefenderChoices.tsx
Outdated
Show resolved
Hide resolved
libs/service-portal/law-and-order/src/components/DefenderChoices/DefenderChoices.tsx
Outdated
Show resolved
Hide resolved
libs/service-portal/law-and-order/src/components/DefenderChoices/DefenderChoices.tsx
Outdated
Show resolved
Hide resolved
Datadog ReportAll test runs ✅ 101 Total Test Services: 0 Failed, 99 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (2) |
…s/island.is into service-portal/law-and-order-ui
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14819 +/- ##
==========================================
+ Coverage 36.76% 36.78% +0.01%
==========================================
Files 6785 6783 -2
Lines 139900 139847 -53
Branches 39772 39754 -18
==========================================
+ Hits 51435 51439 +4
+ Misses 88465 88408 -57
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 9 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
🧹 Outside diff range and nitpick comments (3)
libs/service-portal/documents/src/screens/Overview/OverviewV3.tsx (2)
32-301
: Ensure reusability and adherence to coding guidelinesAs per the coding guidelines for
libs/**/*
, please confirm that theServicePortalDocumentsV3
component and its associated hooks and components are designed for reusability across different NextJS apps. Ensure that shared logic is abstracted appropriately and that TypeScript types are defined and exported where necessary.
32-301
: Explicitly define TypeScript types for improved clarityWhile TypeScript can infer types, explicitly defining types for component props, state, and other variables enhances code readability and maintainability. Consider adding explicit type annotations where appropriate.
libs/service-portal/documents/src/components/DocumentLine/DocumentLineV3.tsx (1)
21-21
: Improve readability by correcting the hook's name formattingThe hook
useIsChildFocusedorHovered
would be more readable if 'Or' is capitalized:useIsChildFocusedOrHovered
. This enhances clarity and follows standard naming conventions.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (5)
- libs/api/domains/law-and-order/src/lib/law-and-order.resolver.ts (1 hunks)
- libs/api/domains/law-and-order/src/lib/law-and-order.service.ts (1 hunks)
- libs/service-portal/documents/src/components/DocumentLine/DocumentLineV3.tsx (1 hunks)
- libs/service-portal/documents/src/components/FavAndStash/FavAndStashV3.tsx (1 hunks)
- libs/service-portal/documents/src/screens/Overview/OverviewV3.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- libs/api/domains/law-and-order/src/lib/law-and-order.resolver.ts
- libs/api/domains/law-and-order/src/lib/law-and-order.service.ts
🧰 Additional context used
📓 Path-based instructions (3)
libs/service-portal/documents/src/components/DocumentLine/DocumentLineV3.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/documents/src/components/FavAndStash/FavAndStashV3.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/documents/src/screens/Overview/OverviewV3.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (5)
libs/service-portal/documents/src/components/FavAndStash/FavAndStashV3.tsx (5)
1-14
: LGTM: Imports and type definition are well-structuredThe imports and type definition for
FavAndStashProps
are well-organized and follow TypeScript best practices. The use of specific imports from '@island.is' packages promotes reusability across different NextJS apps.
16-25
: LGTM: Component declaration and props destructuring are well-implementedThe
FavAndStashV3
component is correctly declared as a React functional component with TypeScript props. The props destructuring in the function parameters enhances code readability and follows modern JavaScript conventions.
26-32
: LGTM: Loading state is handled effectivelyThe component correctly handles the loading state by rendering a
LoadingDots
component when theloading
prop is true. This approach provides a good user experience and maintains consistency with the UI library.
85-85
: LGTM: Component export is correctThe component is correctly exported as the default export, following common React component export patterns. This allows for easy import and potential renaming in other files.
1-85
: Overall assessment: Well-implemented and reusable componentThe
FavAndStashV3
component is well-implemented and adheres to the coding guidelines for thelibs
directory. Key points:
- Reusability: The component is designed to be used across different NextJS apps.
- TypeScript usage: Props are well-defined using TypeScript, enhancing type safety.
- Best practices: The component follows React and TypeScript best practices.
- Flexibility: Conditional rendering based on props makes the component adaptable to various use cases.
The suggested minor improvement for accessibility (adding
aria-label
to buttons) would further enhance the component's quality.
libs/service-portal/documents/src/components/FavAndStash/FavAndStashV3.tsx
Show resolved
Hide resolved
libs/service-portal/documents/src/components/DocumentLine/DocumentLineV3.tsx
Show resolved
Hide resolved
libs/service-portal/documents/src/components/DocumentLine/DocumentLineV3.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool 🕶️
libs/service-portal/documents/src/components/DocumentLine/DocumentLineV3.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (3)
libs/service-portal/core/src/components/LinkButton/LinkButton.tsx (1)
53-54
: Approved changes with a suggestion for improvementThe modifications to the icon and iconType handling improve the flexibility and consistency of the LinkButton component. This aligns well with the coding guidelines for reusability across NextJS apps.
To further enhance clarity, consider adding a comment explaining the logic behind using the 'open' icon for external links and the custom icon for internal links. This would make the code more self-documenting and easier to maintain.
Consider adding a comment like this:
// Use 'open' icon for external links, custom icon (if provided) for internal links icon={isExternal ? 'open' : icon}libs/api/domains/documents/src/lib/documentV2.service.ts (2)
355-392
: Consider defining 'actionMapper' as a regular methodThe
actionMapper
is currently defined as an arrow function property. For consistency and potential performance benefits, consider converting it to a regular method within the class.Apply this diff to convert
actionMapper
to a regular method:-private actionMapper = (id: string, actions?: Array<MessageAction>) => { +private actionMapper(id: string, actions?: Array<MessageAction>) {
374-375
: Simplify 'actions.map' by removing unnecessary optional chainingSince you've already checked that
actions
is notundefined
earlier in theactionMapper
method, the optional chaining operator inactions?.map
is unnecessary. You can simplify the code by removing the?
.Apply this diff to simplify the mapping:
- const mapped: Array<Action> = actions?.map((x) => { + const mapped: Array<Action> = actions.map((x) => {
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (5)
- libs/api/domains/documents/src/lib/documentV2.service.ts (7 hunks)
- libs/feature-flags/src/lib/features.ts (1 hunks)
- libs/service-portal/core/src/components/LinkButton/LinkButton.tsx (1 hunks)
- libs/service-portal/core/src/index.ts (1 hunks)
- libs/service-portal/core/src/lib/messages.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
libs/api/domains/documents/src/lib/documentV2.service.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/feature-flags/src/lib/features.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/core/src/components/LinkButton/LinkButton.tsx (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/core/src/index.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/service-portal/core/src/lib/messages.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🔇 Additional comments (10)
libs/service-portal/core/src/index.ts (1)
13-13
: LGTM: New export statement adheres to guidelinesThe new export statement for
ConfirmationModal
component follows the existing pattern in the file and adheres to the coding guidelines forlibs
directory:
- Reusability: By exporting the
ConfirmationModal
component from this centralindex.ts
file, it becomes easily accessible for use across different NextJS apps within the project.- TypeScript usage: While we can't see the actual component file here, the export statement suggests that TypeScript is being used, as it follows the same pattern as other component exports in this file.
- Tree-shaking and bundling: The use of a wildcard export (
export *
) allows for effective tree-shaking, as unused exports can be easily eliminated during the build process.To ensure that the
ConfirmationModal
component is properly implemented with TypeScript, let's verify its file content:libs/feature-flags/src/lib/features.ts (1)
58-59
: LGTM! New feature flags align with PR objectives.The newly added feature flags
servicePortalLawAndOrderModuleEnabled
andservicePortalDocumentsActionsEnabled
are correctly implemented and follow consistent naming conventions. They align well with the PR objectives, specifically:
servicePortalLawAndOrderModuleEnabled
corresponds to the new "Law and Order" module.servicePortalDocumentsActionsEnabled
likely relates to the document handling enhancements mentioned in the PR description.These additions adhere to the coding guidelines for the
libs/**/*
pattern, supporting TypeScript usage and effective tree-shaking.libs/service-portal/core/src/lib/messages.ts (5)
1637-1640
: LGTM: New message correctly implemented.The
lawAndOrder
message is properly defined and follows the existing pattern for message definitions in this file.
1641-1644
: LGTM: New message correctly implemented.The
lawAndOrderDashboard
message is properly defined and follows the existing pattern for message definitions in this file.
1645-1649
: LGTM: New message correctly implemented with multi-line description.The
lawAndOrderDescription
message is properly defined and follows the existing pattern for message definitions in this file. The multi-line description is correctly formatted.
1650-1653
: LGTM: New message correctly implemented.The
courtCases
message is properly defined and follows the existing pattern for message definitions in this file.
1654-1657
: LGTM: New message correctly implemented.The
subpoena
message is properly defined and follows the existing pattern for message definitions in this file.libs/api/domains/documents/src/lib/documentV2.service.ts (3)
39-40
: Ensure 'getCustomersDocument' supports new optional parametersYou've added optional parameters
locale
andincludeDocument
to thefindDocumentById
method and are passing them togetCustomersDocument
. Please verify that thegetCustomersDocument
method in theDocumentsClientV2Service
correctly handles these parameters when they are undefined.Also applies to: 45-46
145-145
: Include 'isUrgent' in document data mappingGood job adding
isUrgent
to the document data mapping inlistDocuments
. This ensures that the urgency status is correctly reflected in the documents list.
67-73
: Properly handle 'confirmation' and 'alert' actionsThe extraction of
confirmation
,alert
, and other actions fromdocument.actions
is handled correctly with optional chaining and filtering. This ensures that special actions are appropriately identified and processed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving core files 👍
Irrelavant - Approved from other team member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
libs/api/domains/documents/src/lib/documentV2.service.ts (1)
Line range hint
37-93
: LGTM: Enhanced findDocumentById methodThe changes to
findDocumentById
method improve its functionality and flexibility. The addition oflocale
andincludeDocument
parameters, along with the new handling ofconfirmation
andalert
actions, enhances the method's capabilities.Consider adding JSDoc comments to describe the new parameters and their purpose for better code documentation.
Would you like me to generate the JSDoc comments for the
findDocumentById
method?
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (2)
- libs/api/domains/documents/src/lib/documentV2.service.ts (7 hunks)
- libs/service-portal/core/src/lib/messages.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- libs/service-portal/core/src/lib/messages.ts
🧰 Additional context used
📓 Path-based instructions (1)
libs/api/domains/documents/src/lib/documentV2.service.ts (1)
Pattern
libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
🪛 GitHub Check: prepare
libs/api/domains/documents/src/lib/documentV2.service.ts
[failure] 374-374:
Type '({ icon: string; type?: string | undefined; title?: string | undefined; data?: string | undefined; } | undefined)[]' is not assignable to type 'Action[]'.
[failure] 374-374:
Type '({ icon: string; type?: string | undefined; title?: string | undefined; data?: string | undefined; } | undefined)[]' is not assignable to type 'Action[]'.
[failure] 374-374:
Type '({ icon: string; type?: string | undefined; title?: string | undefined; data?: string | undefined; } | undefined)[]' is not assignable to type 'Action[]'.
[failure] 374-374:
Type '({ icon: string; type?: string | undefined; title?: string | undefined; data?: string | undefined; } | undefined)[]' is not assignable to type 'Action[]'.
[failure] 374-374:
Type '({ icon: string; type?: string | undefined; title?: string | undefined; data?: string | undefined; } | undefined)[]' is not assignable to type 'Action[]'.
[failure] 374-374:
Type '({ icon: string; type?: string | undefined; title?: string | undefined; data?: string | undefined; } | undefined)[]' is not assignable to type 'Action[]'.
🔇 Additional comments (2)
libs/api/domains/documents/src/lib/documentV2.service.ts (2)
2-5
: LGTM: Import statements updated correctlyThe new imports for
MessageAction
andAction
are correctly added and align with the changes made in the file.Also applies to: 14-14
145-145
: LGTM: Added isUrgent field to listDocuments outputThe addition of
isUrgent: d.urgent
to the document data in thelistDocuments
method ensures consistency with thefindDocumentById
method and provides valuable information about the urgency of documents.
* feat: add law and order library * feat: overview and detail screen * feat: subpeona and modals, refactor data and structure * fix: revert changes on progress meter * fix: render modules * chore: nx format:write update dirty files * fix: naming * fix: minor probs * feat: graphql and client temp mocked * fix: cleanup generated test file * fix: path error * fix: responsive fixes and spacing * fix: path & mock data * feat: locale changes + fixes * fix: env missing * chore: charts update dirty files * feat: connect to service * fix: ui changes * feat: new client for judical system * Update .github/CODEOWNERS Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: add missing provider file * fix: logger type * update: use judicial client * chore: charts update dirty files * feat: get subpoena data from service * fix: subpoena logic * Update README.md * chore: nx format:write update dirty files * feat: update client * Update libs/clients/judicial-system-sp/README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update libs/clients/judicial-system-sp/README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: loading state for button * update: client * update client config * update: move modal to core * update: client * chore: charts update dirty files * fix: cleanup type declrations * update: client * fix: merge conflict * fix: models * fix: service * feat: connect subpoena to service * fix: errors * update client * fix: remove timout * fix: import * fix: remove type - causing errors * chore: remove "as" from locale type & better error handling * fix: locale typing * fix: query after deleting input * fix: dumdum * fix: remove unused fields * feat: add feature flag for module * feat: add document actions * feat: add callback for confirmation * chore: nx format:write update dirty files * display confirmation text * missing text * locale * fix: locale * fix: hide actions * fix: defender null check * testing new flow * chore: charts update dirty files * add scopes to resolver * refactor data models * feat: remove check if urgent * refactor: remove async from resolver * feat: redirect to mailbox * fix: include doc in service * cleanup * fix * feat: add feature flag for document actions * refactor: strings and rollback fflag * fix: PR comments * fix: remove unused xroad * chore: charts update dirty files * feat: add versioning for digital mailbox * refactor: add message to document actions from service * refactor: updates from service + other refactor * refactor: document actions * fix: documents * cleanup * feat: add feature flag to resolver * sort imports * pr fixes and sorting * fix: PR review * fix build --------- Co-authored-by: andes-it <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Tryggvi Geir Magnússon <[email protected]> Co-authored-by: Kristofer <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Service Portal - Law and order 👮🏼
What
✨ NEW ✨
"Lög og reglur" module for displaying charges and subpoenas. Will also be displayed in "Pósthólf"
FYI => This was originally in three separate pull requests but with time I found it hard to manage the code on three different branches so unfortunately I have created a monster sized PR! Sorry 🫶 👹
Mailbox
Law and order
Judicial System Service Portal client
Screenshots / Gifs
User has to confirm before opening document in the digital mailbox (subpoena)
Overview for court cases information in the new module Law and order
Subpoena detail
Checklist:
Summary by CodeRabbit
Summary by CodeRabbit
New Features
LawAndOrderOverview
component for displaying an overview of legal information.JudicialSystemServicePortal
,LawAndOrderModule
, and new mapping functions for defense choices into the service architecture.DocumentLineV3
,FavAndStashV3
, andServicePortalDocumentsV3
.Bug Fixes
Refactor
getDateLocale
from a central location for consistency.