-
Notifications
You must be signed in to change notification settings - Fork 167
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
Bal 1641 #2331
base: dev
Are you sure you want to change the base?
Bal 1641 #2331
Conversation
|
WalkthroughThe recent changes introduce new dependencies for PDF handling and lodash utilities, update workflow schemas, and add PDF generation functionalities to the back office application. Specifically, new components and hooks are implemented to support the creation and downloading of PDF certificates. Additionally, there are updates to the workflow fetching logic and the inclusion of new error messages. Changes
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
PR Description updated to latest commit (da3d438) |
1 similar comment
PR Description updated to latest commit (da3d438) |
PR Review(Review updated until commit 8f21348)
Code feedback:
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
Persistent review updated to latest commit 8f21348 |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
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 (6)
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts (1)
4-4
: Consider adding a comment explaining the purpose of extendingBaseCaseInformationPdfSchema
with an empty object, especially if future properties are expected to be added.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts (1)
4-4
: Consider adding a comment explaining the purpose of extendingBaseCaseInformationPdfSchema
with an empty object, especially if future properties are expected to be added.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts (1)
4-4
: Consider adding a comment explaining the purpose of extendingBaseCaseInformationPdfSchema
with an empty object, especially if future properties are expected to be added.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts (1)
4-4
: Consider adding a comment explaining the purpose of extendingBaseCaseInformationPdfSchema
with an empty object, especially if future properties are expected to be added.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx (1)
27-27
: Ensure type safety by explicitly handling the type conversion ofvalueOrNone(value)
.Consider using TypeScript's type assertion or a type guard to ensure the type of
valueOrNone(value)
matchesAnyChildren
.apps/backoffice-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx (1)
5-5
: Consider adding JSDoc comments to theuseUbosRegistryProvidedBlock
hook to improve code documentation and developer understanding.Add JSDoc comments explaining the parameters and the return type of the
useUbosRegistryProvidedBlock
hook.
...information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx
Show resolved
Hide resolved
...information/pages/IndividualSanctionsPage/components/IndividualSanctionsItem/ValueOrNone.tsx
Show resolved
Hide resolved
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx
Outdated
Show resolved
Hide resolved
...se/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx
Outdated
Show resolved
Hide resolved
...se/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx
Outdated
Show resolved
Hide resolved
...s/Entity/pdfs/case-information/pages/IdentityVerificationsPage/IdentityVerificationsPage.tsx
Show resolved
Hide resolved
...mponents/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
Outdated
Show resolved
Hide resolved
...office-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.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: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- apps/backoffice-v2/src/domains/workflows/fetchers.ts (6 hunks)
Additional comments not posted (4)
apps/backoffice-v2/src/domains/workflows/fetchers.ts (4)
121-121
: Ensure the TypeScript version upgrade plan is in place to simplify this transformation logic as noted in the TODO comment.
238-238
: The selective use ofBaseWorkflowByIdSchema
for thecontext
field is appropriate here.
1-1
: The file maintains a consistent structure and error handling approach, which is good for maintainability.Also applies to: 6-6, 12-12, 109-109
95-95
: Please verify if the existing schema forchildWorkflows
can be used here as suggested in the previous review.Verification successful
The search results indicate that there are no existing schemas specifically for
childWorkflows
other than the one defined asz.any().optional()
infetchers.ts
. The only other related schema found ischildWorkflowsRuntimeData
defined asz.boolean().optional()
intemp-zod-schemas.ts
, which does not seem to be directly applicable here.
services/workflows-service/src/filter/dtos/temp-zod-schemas.ts
:childWorkflowsRuntimeData: z.boolean().optional()
apps/backoffice-v2/src/domains/workflows/fetchers.ts
:childWorkflows: z.any().optional()
Given this context, it appears that there is no existing schema for
childWorkflows
that can be reused.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for existing `childWorkflows` schema in the project. rg --type typescript "childWorkflows" --files-with-matchesLength of output: 93
Script:
#!/bin/bash # Description: Search for existing `childWorkflows` schema in the project. rg "childWorkflows" --glob "*.ts"Length of output: 3877
Script:
#!/bin/bash # Description: Search for schema definitions related to `childWorkflows` in the project. rg "childWorkflows.*z\." --glob "*.ts"Length of output: 249
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: 9
Outside diff range and nitpick comments (1)
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1)
33-64
: Consider using React Query for state management in asynchronous operations.Given the complexity of state management in asynchronous operations, consider using React Query. It provides built-in mechanisms for loading states, caching, and error handling, which could simplify the implementation of
useCaseOptionsLogic
.
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- apps/backoffice-v2/src/main.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx (1 hunks)
Additional comments not posted (2)
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx (1)
5-9
: The implementation ofCaseInformationPageContainer
looks clean and well-integrated with the PDF toolkit.apps/backoffice-v2/src/main.tsx (1)
10-11
: The integration ofregisterFont
for PDF rendering looks correct. Ensure that the font registration is tested across different environments.Also applies to: 17-17
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: 5
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/assets/title-page-ballerine-logo.png
is excluded by!**/*.png
Files selected for processing (21)
- apps/backoffice-v2/src/main.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts (1 hunks)
Files skipped from review due to trivial changes (6)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/empty-company-ownership-page.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/empty-company-sanctions.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IdentityVerificationsPage/empty-identity-verfications.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/empty-individual-sanctions.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/empty-registry-information-page.schema.ts
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/title-page.schema.ts
Additional comments not posted (11)
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageSection/CaseInformationPageSection.tsx (1)
5-6
: LGTM! The component is well-structured and follows best practices for React components.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/components/CaseInformationPageContainer/CaseInformationPageContainer.tsx (1)
5-8
: LGTM! The component is well-structured and follows best practices for React components.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts (1)
16-16
: The type export is correctly implemented and follows TypeScript best practices.apps/backoffice-v2/src/main.tsx (1)
17-17
: The font registration for PDF rendering is correctly implemented.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1)
11-45
: The implementation of the PDF rendering class is robust and follows best practices for asynchronous data handling and rendering in React.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1)
11-50
: The implementation of the PDF rendering class is robust and follows best practices for asynchronous data handling and rendering in React.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/utils/create-registry-items.ts (1)
4-71
: The implementation ofregistryItemsAdapter
effectively handles potential undefined values and maps the data correctly.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/EmptyIndividualSanctionsPage.tsx (1)
16-43
: TheEmptyIndividualSanctionsPage
component is well-structured and follows React best practices for component composition and styling.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1)
12-67
: TheIdentityVerificationsPagePDF
class is well-implemented with proper data handling and transformation logic.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1)
24-59
: TheuseCaseOptionsLogic
hook is correctly implemented with proper use of React hooks and handles asynchronous operations effectively.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1)
10-76
: TheRegistryPagePDF
class is well-implemented with robust data handling and conditional rendering logic.
.../pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx
Outdated
Show resolved
Hide resolved
...pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx
Outdated
Show resolved
Hide resolved
...components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx
Outdated
Show resolved
Hide resolved
...es/Entity/pdfs/case-information/pages/RegistryInformationPage/registry-information.schema.ts
Show resolved
Hide resolved
...pages/Entity/pdfs/case-information/pages/IndividualSanctionsPage/IndividualSanctionsPage.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: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!pnpm-lock.yaml
Files selected for processing (12)
- apps/backoffice-v2/package.json (2 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- apps/backoffice-v2/package.json
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/EmptyCompanySanctionsPage.tsx
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/RegistryInformationPage.tsx
Additional comments not posted (9)
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx (3)
11-15
: Therender
method implementation is clean and follows good async practices.
18-25
: ThegetData
method is well-implemented, handling potential null values effectively.
28-30
: Good use of schema validation to ensure data integrity inisValid
.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanyOwnershipPage/EmptyCompanyOwnershipPage.tsx (1)
16-46
: The implementation ofEmptyCompanyOwnershipPage
is clear and uses consistent styling and structure.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/RegistryInformationPage/EmptyRegistryInformationPage.tsx (1)
16-46
: TheEmptyRegistryInformationPage
component is well-structured and follows the established pattern of other similar components.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/CompanySanctionsPage/CompanySanctionsPage.tsx (1)
18-76
: TheCompanySanctionsPage
component is implemented effectively, with clear separation of concerns and dynamic data handling.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx (3)
15-21
: Therender
method inIndividualSanctionsPagePDF
is well-structured, handling different rendering scenarios based on the data state.
106-108
: Proper use of schema validation inisValid
ensures the integrity of the data being rendered.
110-112
: TheisEmpty
method is effectively implemented to determine the rendering path based on the presence of data.
...components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx
Show resolved
Hide resolved
...onents/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx
Outdated
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: 0
Outside diff range and nitpick comments (1)
apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx (1)
Line range hint
44-54
: The integration ofCaseOptions
within theActions
component is well done. However, consider simplifying the use of template literals where dynamic expressions are not used.- <div className={`mb-8 flex flex-row justify-between space-x-3.5`}> + <div className="mb-8 flex flex-row justify-between space-x-3.5">
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!pnpm-lock.yaml
Files selected for processing (4)
- apps/backoffice-v2/package.json (2 hunks)
- apps/backoffice-v2/src/domains/workflows/fetchers.ts (5 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx (3 hunks)
- services/workflows-service/prisma/data-migrations (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- apps/backoffice-v2/package.json
- services/workflows-service/prisma/data-migrations
Additional Context Used
Biome (11)
apps/backoffice-v2/src/domains/workflows/fetchers.ts (1)
12-13: All these imports are only used as types.
apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx (10)
43-43: Do not use template literals if interpolation and special-character handling are not needed.
44-44: Do not use template literals if interpolation and special-character handling are not needed.
56-56: Do not use template literals if interpolation and special-character handling are not needed.
57-57: Do not use template literals if interpolation and special-character handling are not needed.
59-59: Do not use template literals if interpolation and special-character handling are not needed.
67-67: Do not use template literals if interpolation and special-character handling are not needed.
68-68: Do not use template literals if interpolation and special-character handling are not needed.
71-71: Do not use template literals if interpolation and special-character handling are not needed.
2-3: All these imports are only used as types.
10-11: All these imports are only used as types.
Additional comments not posted (3)
apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx (1)
6-6
: The import ofCaseOptions
is correctly placed and follows the project's aliasing conventions.apps/backoffice-v2/src/domains/workflows/fetchers.ts (2)
95-95
: The addition ofchildWorkflows
toBaseWorkflowByIdSchema
is noted. Ensure that the schema forchildWorkflows
aligns with existing schemas if applicable, as suggested by a previous comment.Verification successful
The search results indicate multiple references to
childWorkflows
across various files, but none of them define a specific schema forchildWorkflows
. Instead, they seem to use it in different contexts, often as part of other objects or arrays.Given this, it appears that there is no existing schema specifically for
childWorkflows
that could be used in place ofz.any().optional()
. Therefore, the current implementation usingz.any().optional()
is consistent with the rest of the codebase.
- : The addition of
childWorkflows: z.any().optional()
to theBaseWorkflowByIdSchema
is consistent with the current usage and definitions in the codebase. No specific schema forchildWorkflows
exists that should be used instead.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify if `childWorkflows` uses an existing schema. ast-grep --lang typescript --pattern $'z.object({ $$$ childWorkflows: $_, $$$ })'Length of output: 2824
Script:
#!/bin/bash # Description: Search for any existing schema definitions related to `childWorkflows`. rg 'childWorkflows' --type tsLength of output: 7438
Line range hint
109-121
: The definition ofTWorkflowById
and the update tofetchWorkflowById
are consistent with the schema changes. Ensure that the transformation logic infetchWorkflowById
is thoroughly tested, especially the handling ofpluginsOutput
.Verification successful
The definition of
TWorkflowById
and the update tofetchWorkflowById
are consistent with the schema changes. The transformation logic infetchWorkflowById
appears to handlepluginsOutput
correctly by usingdeepCamelKeys
onwebsite_monitoring.data
.
fetchWorkflowById
is defined inapps/backoffice-v2/src/domains/workflows/fetchers.ts
.- The function is used in
apps/backoffice-v2/src/domains/workflows/query-keys.ts
.Ensure that the transformation logic, especially the handling of
pluginsOutput
, is thoroughly tested.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the transformation logic in `fetchWorkflowById`. rg --type typescript $'fetchWorkflowById'Length of output: 75
Script:
#!/bin/bash # Description: Verify the transformation logic in `fetchWorkflowById`. rg --type ts 'fetchWorkflowById'Length of output: 365
Script:
#!/bin/bash # Description: Extract the implementation of `fetchWorkflowById` from `fetchers.ts`. rg --type ts --context 20 'fetchWorkflowById' apps/backoffice-v2/src/domains/workflows/fetchers.tsLength of output: 1472
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: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- apps/backoffice-v2/public/locales/en/toast.json (1 hunks)
- apps/backoffice-v2/src/domains/workflows/fetchers.ts (2 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1 hunks)
- apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx (1 hunks)
- services/workflows-service/prisma/data-migrations (1 hunks)
Files skipped from review due to trivial changes (1)
- apps/backoffice-v2/public/locales/en/toast.json
Files skipped from review as they are similar to previous changes (1)
- services/workflows-service/prisma/data-migrations
Additional Context Used
Biome (6)
apps/backoffice-v2/src/domains/workflows/fetchers.ts (1)
12-13: All these imports are only used as types.
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1)
5-6: All these imports are only used as types.
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (2)
1-1: All these imports are only used as types.
2-3: All these imports are only used as types.
apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx (2)
1-1: All these imports are only used as types.
3-4: All these imports are only used as types.
Additional comments not posted (5)
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx (1)
8-27
: The implementation of theCaseOptions
component looks solid and well-integrated with the dropdown functionality for PDF generation.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx (1)
9-69
: TheRegistryPagePDF
class is well-implemented with clear separation of concerns and robust data handling.apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx (1)
25-60
: TheuseCaseOptionsLogic
hook is efficiently implemented with proper error handling and state management for PDF generation.apps/backoffice-v2/src/pages/Entity/pdfs/case-information/pages/TitlePage/TitlePage.tsx (1)
11-89
: TheTitlePage
component is well-designed with a clear layout and appropriate use of styling and data handling.apps/backoffice-v2/src/domains/workflows/fetchers.ts (1)
Line range hint
1-122
: The updates tofetchers.ts
are well-implemented with robust data fetching and error handling mechanisms.
User description
Description
Sample PDF
certificate).pdf
empty states .pdf
Type
enhancement
Description
CaseOptions
with functionality to download PDF certificates.IPDFRenderer
to standardize PDF rendering operations.Changes walkthrough
14 files
svg-to-png.ts
Add SVG to PNG Conversion Utility
apps/backoffice-v2/src/common/utils/svg-to-png/svg-to-png.ts
svgToPng
to convert SVG images to PNGformat.
fetchers.ts
Refactor Customer Data Schema Definition
apps/backoffice-v2/src/domains/customer/fetchers.ts
constant
CustomerSchema
.fetchCustomer
function to use the newCustomerSchema
.fetchers.ts
Enhance Workflow Fetchers with New Schemas and Fields
apps/backoffice-v2/src/domains/workflows/fetchers.ts
WorkflowDefinitionByIdSchema
andAmlSchema
.childWorkflows
toBaseWorkflowByIdSchema
.useUbosRegistryProvidedBlock.tsx
Export Ubo Type from useUbosRegistryProvidedBlock Hook
apps/backoffice-v2/src/lib/blocks/hooks/useUbosRegistryProvidedBlock/useUbosRegistryProvidedBlock.tsx
Ubo
from local to exported.Case.Actions.tsx
Integrate CaseOptions Component into Case Actions
apps/backoffice-v2/src/pages/Entity/components/Case/Case.Actions.tsx
CaseOptions
.CaseOptions
component into the UI.CaseOptions.tsx
Implement CaseOptions Component with PDF Download
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/CaseOptions.tsx
CaseOptions
component with dropdown menu for downloadingPDF certificates.
company-ownership-page.pdf.tsx
Add Company Ownership PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-ownership-page.pdf.tsx
company-sanctions-page.pdf.tsx
Add Company Sanctions PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/company-sanctions-page.pdf.tsx
identity-verifications-page.pdf.tsx
Add Identity Verifications PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/identity-verifications-page.pdf.tsx
individual-sanctions-page.pdf.tsx
Add Individual Sanctions PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/individual-sanctions-page.pdf.tsx
pdf-renderer.abstract.ts
Introduce Abstract PDF Renderer Class
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/pdf-renderer.abstract.ts
IPDFRenderer
for PDF renderingoperations.
registry-page.pdf.tsx
Add Registry Page PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/registry-page.pdf.tsx
title-page.pdf.tsx
Add Title Page PDF Rendering Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/renderers/title-page.pdf.tsx
useCaseOptionsLogic.tsx
Implement PDF Certificate Generation and Download Logic
apps/backoffice-v2/src/pages/Entity/components/Case/components/CaseOptions/hooks/useCaseOptionsLogic/useCaseOptionsLogic.tsx
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Dependencies
@ballerine/react-pdf-toolkit
,@react-pdf/renderer
,lodash
, and@types/lodash
.Documentation