-
Notifications
You must be signed in to change notification settings - Fork 61
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(AOSH): Fixing a few minor bugs on AOSH applications #14898
Conversation
Removing date field, Fixing Contentful script, Adding error logs for emails and sms for AOSH, Few message fixes, Fixing location component and adding moreInfo text in locationSection
WalkthroughThe recent updates focus on enhancing the 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 (
|
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.yaml
Review profile: CHILL
Files selected for processing (29)
- libs/application/template-api-modules/src/lib/modules/templates/aosh/transfer-of-machine-ownership/emailGenerators/applicationRejectedEmail.ts (1 hunks)
- libs/application/template-api-modules/src/lib/modules/templates/aosh/transfer-of-machine-ownership/transfer-of-machine-ownership.service.ts (6 hunks)
- libs/application/templates/aosh/change-machine-supervisor/src/forms/ChangeMachineSupervisorForm/InformationSection/machineSubSection.ts (1 hunks)
- libs/application/templates/aosh/change-machine-supervisor/src/forms/ChangeMachineSupervisorForm/InformationSection/pickMachineSubSection.ts (1 hunks)
- libs/application/templates/aosh/change-machine-supervisor/src/utils/getSelectedMachine.ts (1 hunks)
- libs/application/templates/aosh/deregister-machine/src/forms/DeregisterMachineForm/InformationSection/pickMachineSubSection.ts (1 hunks)
- libs/application/templates/aosh/deregister-machine/src/utils/getSelectedMachine.ts (1 hunks)
- libs/application/templates/aosh/request-for-inspection/project.json (1 hunks)
- libs/application/templates/aosh/request-for-inspection/src/forms/RequestMachineForInspectionForm/InformationSection/pickMachineSubSection.ts (1 hunks)
- libs/application/templates/aosh/request-for-inspection/src/lib/messages/conclusion.ts (1 hunks)
- libs/application/templates/aosh/request-for-inspection/src/utils/getSelectedMachine.ts (1 hunks)
- libs/application/templates/aosh/street-registration/src/forms/StreetRegistrationForm/InformationSection/pickMachineSubSection.ts (1 hunks)
- libs/application/templates/aosh/street-registration/src/utils/getSelectedMachine.ts (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/fields/Location/index.tsx (6 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/fields/Overview/index.tsx (2 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/fields/Overview/sections/LocationSection.tsx (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/forms/Rejected.ts (2 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/forms/TransferOfMachineOwnershipForm/InformationSection/buyerSubSection.ts (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/forms/TransferOfMachineOwnershipForm/InformationSection/pickMachineSubSection.ts (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/graphql/queries.ts (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/lib/TransferOfMachineOwnershipTemplate.ts (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/lib/messages/conclusion.ts (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/lib/messages/information.ts (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/utils/getSelectedMachine.ts (1 hunks)
- libs/application/templates/aosh/transfer-of-machine-ownership/src/utils/isPaymentRequired.ts (1 hunks)
- libs/application/ui-fields/src/lib/FindVehicleFormField/FindVehicleFormField.tsx (4 hunks)
- libs/application/ui-forms/src/lib/formConclusionSection/formConclusionSection.ts (1 hunks)
- libs/clients/work-machines/src/lib/workMachines.service.ts (2 hunks)
- libs/clients/work-machines/src/lib/workMachines.types.ts (1 hunks)
Files skipped from review due to trivial changes (12)
- libs/application/template-api-modules/src/lib/modules/templates/aosh/transfer-of-machine-ownership/emailGenerators/applicationRejectedEmail.ts
- libs/application/templates/aosh/change-machine-supervisor/src/forms/ChangeMachineSupervisorForm/InformationSection/pickMachineSubSection.ts
- libs/application/templates/aosh/request-for-inspection/project.json
- libs/application/templates/aosh/request-for-inspection/src/forms/RequestMachineForInspectionForm/InformationSection/pickMachineSubSection.ts
- libs/application/templates/aosh/request-for-inspection/src/lib/messages/conclusion.ts
- libs/application/templates/aosh/transfer-of-machine-ownership/src/fields/Location/index.tsx
- libs/application/templates/aosh/transfer-of-machine-ownership/src/fields/Overview/sections/LocationSection.tsx
- libs/application/templates/aosh/transfer-of-machine-ownership/src/forms/TransferOfMachineOwnershipForm/InformationSection/buyerSubSection.ts
- libs/application/templates/aosh/transfer-of-machine-ownership/src/graphql/queries.ts
- libs/application/templates/aosh/transfer-of-machine-ownership/src/lib/messages/information.ts
- libs/application/templates/aosh/transfer-of-machine-ownership/src/utils/isPaymentRequired.ts
- libs/clients/work-machines/src/lib/workMachines.types.ts
Additional Context Used
Path-based Instructions (17)
libs/application/templates/aosh/transfer-of-machine-ownership/src/utils/getSelectedMachine.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/application/templates/aosh/change-machine-supervisor/src/utils/getSelectedMachine.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/application/templates/aosh/request-for-inspection/src/utils/getSelectedMachine.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/application/templates/aosh/deregister-machine/src/utils/getSelectedMachine.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/application/templates/aosh/street-registration/src/utils/getSelectedMachine.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/application/templates/aosh/transfer-of-machine-ownership/src/forms/Rejected.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/application/templates/aosh/deregister-machine/src/forms/DeregisterMachineForm/InformationSection/pickMachineSubSection.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/application/templates/aosh/transfer-of-machine-ownership/src/forms/TransferOfMachineOwnershipForm/InformationSection/pickMachineSubSection.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/application/templates/aosh/street-registration/src/forms/StreetRegistrationForm/InformationSection/pickMachineSubSection.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/application/templates/aosh/change-machine-supervisor/src/forms/ChangeMachineSupervisorForm/InformationSection/machineSubSection.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/application/ui-forms/src/lib/formConclusionSection/formConclusionSection.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/application/templates/aosh/transfer-of-machine-ownership/src/fields/Overview/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/application/templates/aosh/transfer-of-machine-ownership/src/lib/messages/conclusion.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/clients/work-machines/src/lib/workMachines.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/application/template-api-modules/src/lib/modules/templates/aosh/transfer-of-machine-ownership/transfer-of-machine-ownership.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/application/templates/aosh/transfer-of-machine-ownership/src/lib/TransferOfMachineOwnershipTemplate.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/application/ui-fields/src/lib/FindVehicleFormField/FindVehicleFormField.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 not posted (17)
libs/application/templates/aosh/transfer-of-machine-ownership/src/utils/getSelectedMachine.ts (1)
10-13
: The new condition to directly retrieve the machine iffindVehicle
is present simplifies the machine selection process.libs/application/templates/aosh/change-machine-supervisor/src/utils/getSelectedMachine.ts (1)
10-13
: The new condition to directly retrieve the machine iffindVehicle
is present simplifies the machine selection process.libs/application/templates/aosh/request-for-inspection/src/utils/getSelectedMachine.ts (1)
10-13
: The new condition to directly retrieve the machine iffindVehicle
is present simplifies the machine selection process.libs/application/templates/aosh/deregister-machine/src/utils/getSelectedMachine.ts (1)
10-13
: The new condition to directly retrieve the machine iffindVehicle
is present simplifies the machine selection process.libs/application/templates/aosh/street-registration/src/utils/getSelectedMachine.ts (1)
16-19
: The new condition to directly retrieve the machine iffindVehicle
is present simplifies the machine selection process.libs/application/templates/aosh/transfer-of-machine-ownership/src/forms/Rejected.ts (1)
12-13
: The integration ofgetSelectedMachine
to dynamically display machine-specific information in the form's expandable header is a thoughtful addition.Also applies to: 47-54
Verification successful
The
Machine
type definition includes theregNumber
property in multiple files across the codebase. This confirms that theregNumber
property is indeed part of theMachine
type.
libs/application/templates/aosh/street-registration/src/shared/types.ts
libs/application/templates/aosh/transfer-of-machine-ownership/src/shared/types.ts
libs/application/templates/aosh/request-for-inspection/src/shared/types.ts
libs/application/templates/aosh/deregister-machine/src/shared/types.ts
libs/application/templates/aosh/change-machine-supervisor/src/shared/types.ts
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `Machine` type includes the `regNumber` property. # Test: Search for the `Machine` type definition. Expect: `regNumber` property should be present. ast-grep --lang typescript --pattern $'interface Machine { $$$ regNumber: $_ $$$ }'Length of output: 84
Script:
#!/bin/bash # Description: Locate the `Machine` type definition and list its properties. # Search for the `Machine` type definition in the codebase. ast-grep --lang typescript --pattern $'interface Machine { $$$ }'Length of output: 66
Script:
#!/bin/bash # Description: Locate the `Machine` type definition, including type aliases and classes. # Search for type aliases or classes named `Machine` in the codebase. ast-grep --lang typescript --pattern $'type Machine = { $$$ }' ast-grep --lang typescript --pattern $'class Machine { $$$ }'Length of output: 5109
libs/application/templates/aosh/deregister-machine/src/forms/DeregisterMachineForm/InformationSection/pickMachineSubSection.ts (1)
21-21
: Updated field ID from 'pickMachine.id' to 'machine.id' aligns with the PR objectives to standardize field IDs across forms.libs/application/templates/aosh/transfer-of-machine-ownership/src/forms/TransferOfMachineOwnershipForm/InformationSection/pickMachineSubSection.ts (1)
21-21
: Updated field ID from 'pickMachine.id' to 'machine.id' is consistent with similar updates in other forms, enhancing field ID standardization.libs/application/templates/aosh/street-registration/src/forms/StreetRegistrationForm/InformationSection/pickMachineSubSection.ts (1)
23-23
: Updated field ID from 'pickMachine.id' to 'machine.id' is consistent with similar updates in other forms, enhancing field ID standardization.libs/application/templates/aosh/change-machine-supervisor/src/forms/ChangeMachineSupervisorForm/InformationSection/machineSubSection.ts (1)
Line range hint
1-48
: Removal of thebuildDateField
aligns with the PR objectives to simplify the machine forms by removing date-related fields. The remaining fields correctly display essential machine details.libs/application/ui-forms/src/lib/formConclusionSection/formConclusionSection.ts (1)
21-21
: Changing the type ofexpandableHeader
fromStaticText
toFormText
enhances the flexibility of form conclusions by allowing dynamic content.libs/application/templates/aosh/transfer-of-machine-ownership/src/fields/Overview/index.tsx (1)
110-110
: Addition of thelocation
prop to theOverview
component enhances the detail and functionality of the location handling in the form.libs/application/templates/aosh/transfer-of-machine-ownership/src/lib/messages/conclusion.ts (1)
77-78
: The addition of{regNumber}
to the alert message enhances specificity and user feedback. Ensure that the frontend correctly interpolates this dynamic field.libs/clients/work-machines/src/lib/workMachines.service.ts (1)
120-120
: Changing the default value forpaymentRequiredForOwnerChange
fromfalse
totrue
enhances the stringency of payment checks. Verify that this change does not adversely affect existing functionalities that depend on these methods.Also applies to: 159-159
libs/application/template-api-modules/src/lib/modules/templates/aosh/transfer-of-machine-ownership/transfer-of-machine-ownership.service.ts (1)
80-80
: The addition ofcurrentUserLocale
to method signatures and the introduction of thehandlePayment
method enhance localization and payment handling. Ensure these changes are well-integrated and function as expected within the application.Also applies to: 82-82, 154-154, 156-156, 226-263
Verification successful
The integration of
currentUserLocale
andhandlePayment
appears to be correctly implemented in thetransfer-of-machine-ownership.service.ts
file. ThecurrentUserLocale
is passed to methods, andhandlePayment
is utilized appropriately.
currentUserLocale
is used in multiple places, ensuring localization.handlePayment
is called with the necessary parameters, includingcurrentUserLocale
.These changes align with the objectives of enhancing localization and payment handling.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration and functionality of `currentUserLocale` and `handlePayment` in the application. # Test: Search for usages of `submitApplication` and `initReview`. Expect: Proper handling of `currentUserLocale` and successful execution of `handlePayment`. rg --type typescript $'submitApplication|initReview'Length of output: 88
Script:
#!/bin/bash # Description: Verify the integration and functionality of `currentUserLocale` and `handlePayment` in the application. # Test: Search for usages of `submitApplication` and `initReview`. Expect: Proper handling of `currentUserLocale` and successful execution of `handlePayment`. rg --type ts $'submitApplication|initReview'Length of output: 51999
Script:
#!/bin/bash # Description: Verify the integration of `currentUserLocale` and `handlePayment` in the application. # Test: Search for usages of `currentUserLocale` and `handlePayment`. Expect: Proper integration in relevant methods. rg --type ts 'currentUserLocale|handlePayment'Length of output: 5488
libs/application/templates/aosh/transfer-of-machine-ownership/src/lib/TransferOfMachineOwnershipTemplate.ts (1)
183-187
: The addition of anonExit
event and conditional transitions based on payment requirements enhances flow control and payment handling in the application template. Verify the correct implementation of these state transitions.Also applies to: 193-196
Verification successful
The search results indicate that the
onExit
and conditional transitions (cond
) are used extensively throughout the codebase, including in theTransferOfMachineOwnershipTemplate.ts
file. This confirms that the implementation ofonExit
and conditional transitions is consistent with the overall application architecture.
onExit
is used to define actions that should be executed when exiting a state.- Conditional transitions (
cond
) are used to determine the next state based on specific conditions.Given the extensive usage and the context provided, it appears that the implementation aligns with the intended design and functionality.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correct implementation of `onExit` and conditional transitions in the application template. # Test: Search for the usage of `onExit` and conditional transitions in the application. Expect: Correct implementation and functioning. rg --type typescript $'onExit|cond'Length of output: 71
Script:
#!/bin/bash # Description: Verify the correct implementation of `onExit` and conditional transitions in the application template. # Test: Search for the usage of `onExit` and conditional transitions in the application. Expect: Correct implementation and functioning. rg --type ts $'onExit|cond'Length of output: 284727
libs/application/ui-fields/src/lib/FindVehicleFormField/FindVehicleFormField.tsx (1)
97-97
: Improving error handling by ensuringvalidationErrorMessages
defaults to an empty array enhances the robustness of the component. Verify that this change is well-integrated and functions as expected in the component.Also applies to: 107-107, 118-118
Verification successful
The search results indicate that the
validationErrorMessages
property is used extensively across multiple files, including theFindVehicleFormField.tsx
file. The specific lines inFindVehicleFormField.tsx
wherevalidationErrorMessages
is handled show that the change to default it to an empty array is present.
libs/application/ui-fields/src/lib/FindVehicleFormField/FindVehicleFormField.tsx: validationErrorMessages: response?.validationErrorMessages ?? [],
This confirms that the change to handle potential null values in
validationErrorMessages
is integrated into the component.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the integration and functionality of improved error handling in the `FindVehicleFormField` component. # Test: Search for the usage of `validationErrorMessages` in the component. Expect: Proper handling of potential null values. rg --type typescript $'validationErrorMessages'Length of output: 81
Script:
#!/bin/bash # Description: Verify the integration and functionality of improved error handling in the `FindVehicleFormField` component. # Test: Search for the usage of `validationErrorMessages` in the component. Expect: Proper handling of potential null values. rg --type ts $'validationErrorMessages'Length of output: 13668
libs/application/templates/aosh/transfer-of-machine-ownership/src/utils/getSelectedMachine.ts
Show resolved
Hide resolved
libs/application/templates/aosh/change-machine-supervisor/src/utils/getSelectedMachine.ts
Show resolved
Hide resolved
libs/application/templates/aosh/request-for-inspection/src/utils/getSelectedMachine.ts
Show resolved
Hide resolved
libs/application/templates/aosh/deregister-machine/src/utils/getSelectedMachine.ts
Show resolved
Hide resolved
libs/application/templates/aosh/street-registration/src/utils/getSelectedMachine.ts
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 (3) |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14898 +/- ##
==========================================
- Coverage 37.10% 37.09% -0.01%
==========================================
Files 6353 6353
Lines 129358 129371 +13
Branches 36934 36939 +5
==========================================
+ Hits 47994 47996 +2
- Misses 81364 81375 +11
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
libs/application/ui-fields/src/lib/FindVehicleFormField/FindVehicleFormField.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.
Code owned files LGTM with one comment
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.yaml
Review profile: CHILL
Files selected for processing (1)
- libs/application/ui-fields/src/lib/FindVehicleFormField/FindVehicleFormField.tsx (6 hunks)
Files skipped from review as they are similar to previous changes (1)
- libs/application/ui-fields/src/lib/FindVehicleFormField/FindVehicleFormField.tsx
Fixing payment bug for AOSH,
Removing date field,
Fixing Contentful script,
Adding error logs for emails and sms for AOSH,
Few message fixes,
Fixing location component and adding moreInfo text in locationSection
...
Attach a link to issue if relevant
What
Specify what you're trying to achieve
Why
Specify why you need to achieve this
Screenshots / Gifs
Attach Screenshots / Gifs to help reviewers understand the scope of the pull request
Checklist:
Summary by CodeRabbit
New Features
location
property in theOverview
component for additional location details.submitButton
message for the buyer in theTransferOfMachineOwnership
form.Enhancements
'pickMachine.id'
to'machine.id'
across various forms for consistency.getSelectedMachine
function to handlefindVehicle
condition more effectively.TransferOfMachineOwnership
service.isPaymentRequired
function.Bug Fixes
extract-strings
command in therequest-for-inspection
project configuration.ChangeMachineSupervisorForm
.Refactor
location
import tolocationMessage
in theLocation
component for clarity.formConclusionSection
to useFormText
instead ofStaticText
.Chores
paymentRequiredForOwnerChange
in theWorkMachinesClientService
class.