Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(samgongustofa): shared vehicle radio form field #16905

Merged
merged 34 commits into from
Nov 19, 2024

Conversation

johannaagma
Copy link
Member

@johannaagma johannaagma commented Nov 15, 2024

...

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:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Formatting passes locally with my changes
  • I have rebased against main before asking for a review

Summary by CodeRabbit

  • New Features
    • Introduced the VehicleRadioFormField component for enhanced vehicle and plate selection with improved validation and error handling.
  • Bug Fixes
    • Updated validation logic for vehicle selection and license plate renewal to improve user feedback.
  • Chores
    • Removed deprecated VehicleRadioField components across various modules to streamline the codebase.
  • Documentation
    • Updated type definitions to include the new VehicleRadioField interface, expanding available field types for vehicle selection.

Stop using mileageRequired from answers in getSelectedVehicle and always look at the value from externalData (it should not change)
…leswithmileageandinsp (not basicVehicleInformation)

Cleanup make+vehcom (basicVehicleInformation) vs make (currentvehicles)
Display always E, L and W messages (but E and L first)
Allow all users to retry submit application if all approvals are finished
Display ValidationErrorMessages always in overview, no matter who is reviewing
Add validation per plate if user has more than 5
Copy link
Contributor

coderabbitai bot commented Nov 15, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request involves the removal of the VehicleRadioField component across multiple modules and its replacement with a new component called VehicleRadioFormField. The new component introduces enhanced functionality, including improved validation and error handling capabilities. Additionally, several related components and schemas have been updated to accommodate these changes, including modifications in how vehicle and plate selection are managed within forms.

Changes

File Change Summary
libs/application/templates/transport-authority/change-co-owner-of-vehicle/src/fields/VehiclesField/VehicleRadioField.tsx Component removed: VehicleRadioField
libs/application/templates/transport-authority/change-co-owner-of-vehicle/src/fields/VehiclesField/index.tsx Component updated: VehicleRadioFieldVehicleRadioFormField; import updated; rendering logic adjusted
libs/application/templates/transport-authority/change-operator-of-vehicle/src/fields/VehiclesField/VehicleRadioField.tsx Component removed: VehicleRadioField
libs/application/templates/transport-authority/change-operator-of-vehicle/src/fields/VehiclesField/index.tsx Component updated: VehicleRadioFieldVehicleRadioFormField; import updated; rendering logic adjusted
libs/application/templates/transport-authority/license-plate-renewal/src/fields/PlateField/PlateRadioField.tsx Component removed: PlateRadioField
libs/application/templates/transport-authority/license-plate-renewal/src/fields/PlateField/index.tsx Component updated: PlateRadioFieldVehicleRadioFormField; new field configuration added
libs/application/templates/transport-authority/license-plate-renewal/src/lib/dataSchema.ts Property updated: value in LicensePlateRenewalSchema changed from required to optional
libs/application/templates/transport-authority/order-vehicle-license-plate/src/fields/VehiclesField/VehicleRadioField.tsx Component removed: VehicleRadioField
libs/application/templates/transport-authority/order-vehicle-license-plate/src/fields/VehiclesField/index.tsx Component updated: VehicleRadioFieldVehicleRadioFormField; import updated; rendering logic adjusted
libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/VehicleRadioField.tsx Component removed: VehicleRadioField
libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/VehicleSelectField.tsx Props updated to include errors; state management enhanced; error handling improved
libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/index.tsx Component updated: VehicleRadioFieldVehicleRadioFormField; import updated; error handling removed
libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/forms/OrderVehicleRegistrationCertificateForm/InformationSection/vehicleSubSection.ts Field identifiers updated for clarity
libs/application/templates/transport-authority/transfer-of-vehicle-ownership/src/fields/VehiclesField/VehicleRadioField.tsx Component removed: VehicleRadioField
libs/application/templates/transport-authority/transfer-of-vehicle-ownership/src/fields/VehiclesField/index.tsx Component updated: VehicleRadioFieldVehicleRadioFormField; import updated; rendering logic adjusted
libs/application/types/src/lib/Fields.ts New interface VehicleRadioField added; Field union type updated to include this new interface
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleDetails.ts New interfaces VehicleDetails, PlateOwnership, and ValidationErrorMessage added
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx New component VehicleRadioFormField added with enhanced functionality for vehicle selection
libs/application/ui-fields/src/lib/index.ts New export for VehicleRadioFormField added

Possibly related PRs

Suggested labels

automerge, deploy-feature

Suggested reviewers

  • johannaagma
  • Toti91
  • sigruntg

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@johannaagma johannaagma changed the base branch from main to fix/transport-authority-error-handling-warnsever November 15, 2024 14:49
Base automatically changed from fix/transport-authority-error-handling-warnsever to main November 18, 2024 10:02
@johannaagma johannaagma marked this pull request as ready for review November 18, 2024 11:31
@johannaagma johannaagma requested review from a team as code owners November 18, 2024 11:31
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 2.91262% with 100 lines in your changes missing coverage. Please review.

Project coverage is 36.42%. Comparing base (53378fd) to head (b9459f7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ib/VehicleRadioFormField/VehicleRadioFormField.tsx 0.99% 100 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #16905      +/-   ##
==========================================
- Coverage   36.45%   36.42%   -0.04%     
==========================================
  Files        6903     6904       +1     
  Lines      144598   145360     +762     
  Branches    41288    41545     +257     
==========================================
+ Hits        52720    52941     +221     
- Misses      91878    92419     +541     
Flag Coverage Δ
air-discount-scheme-web 0.00% <ø> (ø)
api 3.34% <ø> (ø)
application-api-files 62.42% <100.00%> (+0.06%) ⬆️
application-core 71.03% <100.00%> (-0.04%) ⬇️
application-system-api 41.02% <100.00%> (+<0.01%) ⬆️
application-template-api-modules 27.72% <100.00%> (-0.01%) ⬇️
application-templates-accident-notification 28.98% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 25.87% <ø> (ø)
application-templates-driving-license 18.14% <ø> (ø)
application-templates-estate 12.14% <ø> (ø)
application-templates-example-payment 24.80% <ø> (ø)
application-templates-financial-aid 15.48% <ø> (ø)
application-templates-general-petition 23.07% <ø> (ø)
application-templates-inheritance-report 6.52% <ø> (ø)
application-templates-marriage-conditions 15.04% <ø> (ø)
application-templates-mortgage-certificate 43.42% <100.00%> (+0.05%) ⬆️
application-templates-parental-leave 29.86% <ø> (ø)
application-types 6.57% <0.00%> (-0.03%) ⬇️
application-ui-components 1.27% <ø> (ø)
application-ui-shell 20.57% <0.99%> (-0.25%) ⬇️
clients-charge-fjs-v2 24.11% <ø> (ø)
judicial-system-web 27.16% <ø> (ø)
services-endorsements-api 53.21% <ø> (ø)
web 1.77% <ø> (ø)

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

Files with missing lines Coverage Δ
...hority/license-plate-renewal/src/lib/dataSchema.ts 66.66% <ø> (ø)
libs/application/types/src/lib/Fields.ts 100.00% <100.00%> (ø)
...ib/VehicleRadioFormField/VehicleRadioFormField.tsx 0.99% <0.99%> (ø)

... and 11 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53378fd...b9459f7. Read the comment docs.

---- 🚨 Try these New Features:

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Outside diff range and nitpick comments (18)
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleDetails.ts (3)

1-4: Add JSDoc documentation for error message interface.

Consider adding JSDoc comments to document the purpose and usage of the ValidationErrorMessage interface and its fields.

+/**
+ * Represents a validation error message with an optional error number and default message.
+ */
 interface ValidationErrorMessage {
+  /** Unique identifier for the error */
   errorNo?: string | null
+  /** Human-readable error message */
   defaultMessage?: string | null
 }

6-15: Enhance type safety for vehicle details.

Consider the following improvements to make the interface more type-safe:

  • Add string literal types for role to restrict possible values
  • Use a number type for mileageReading if it represents a numeric value
  • Consider using non-nullable types where appropriate
 export interface VehicleDetails {
   permno?: string
   make?: string
   color?: string
-  role?: string
+  role?: 'owner' | 'operator' | 'other'
   requireMileage?: boolean | null
-  mileageReading?: string | null
+  mileageReading?: number | null
   isDebtLess?: boolean | null
   validationErrorMessages?: ValidationErrorMessage[] | null
 }

17-22: Improve date handling in plate ownership interface.

Consider using a more specific type for dates to ensure proper date format validation. You could either:

  1. Use a Date type if working with Date objects
  2. Add documentation specifying the expected date format if using strings
+/**
+ * Represents ownership details for a vehicle plate
+ * @property startDate - ISO 8601 formatted date string (YYYY-MM-DD)
+ * @property endDate - ISO 8601 formatted date string (YYYY-MM-DD)
+ */
 export interface PlateOwnership {
   regno: string
-  startDate: string
-  endDate: string
+  startDate: `${number}-${number}-${number}` // Template literal type for YYYY-MM-DD
+  endDate: `${number}-${number}-${number}`   // Template literal type for YYYY-MM-DD
   validationErrorMessages?: ValidationErrorMessage[] | null
 }
libs/application/templates/transport-authority/order-vehicle-license-plate/src/forms/OrderVehicleLicensePlateForm/InformationSection/plateSizeSubSection.ts (1)

Line range hint 41-54: Consider adding TypeScript type for vehicle information

While the ID change from plateSize.vehicleType to vehicleInfo.type improves consistency, we could enhance type safety by defining an interface for the vehicle information structure.

Consider adding:

interface VehicleInfo {
  plate: string;
  type: string;
}

This would make the field structure more maintainable and provide better TypeScript support.

libs/application/templates/transport-authority/license-plate-renewal/src/fields/PlateField/index.tsx (1)

56-74: LGTM! Well-structured field configuration with comprehensive validation.

The implementation properly utilizes the shared VehicleRadioFormField component with thorough validation and error handling.

Consider extracting the field configuration to a separate constant for better maintainability:

const PLATE_FIELD_CONFIG = {
  id: 'pickPlate',
  title: information.labels.pickPlate.title,
  // ... rest of the configuration
} as const;

// Then in JSX:
<VehicleRadioFormField {...props} field={PLATE_FIELD_CONFIG} />
libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/index.tsx (1)

70-79: Consider adding additional validation props.

Based on the AI summary, the VehicleRadioFormField component supports additional validation props that could enhance the user experience:

  • shouldValidateDebtStatus
  • alertMessageErrorTitle
 field={{
   id: 'pickVehicle',
   title: information.labels.pickVehicle.title,
   type: FieldTypes.VEHICLE_RADIO,
   component: FieldComponents.VEHICLE_RADIO,
   children: undefined,
   itemType: 'VEHICLE',
   itemList: currentVehicleList?.vehicles,
   inputErrorMessage: error.requiredValidVehicle,
+  shouldValidateDebtStatus: true,
+  alertMessageErrorTitle: error.validationErrorTitle,
 }}
libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/VehicleSelectField.tsx (4)

22-22: Consider adding proper type for the errors prop

While the addition of the errors prop is good, using any type in its usage reduces type safety. Consider defining a proper interface for the errors structure.

-> = ({ currentVehicleList, application, errors }) => {
+interface FormErrors {
+  pickVehicle?: {
+    vehicle?: string;
+    plate?: string;
+  };
+}
+> = ({ currentVehicleList, application, errors }: { errors: FormErrors }) => {

46-48: Consider centralizing the form field paths

The path 'pickVehicle.plate' is used in multiple places. Consider extracting it to a constant to improve maintainability.

+const FORM_PATHS = {
+  VEHICLE_PLATE: 'pickVehicle.plate',
+  VEHICLE: 'pickVehicle.vehicle',
+} as const;

-const [plate, setPlate] = useState<string>(
-  getValueViaPath(application.answers, 'pickVehicle.plate', '') as string,
-)
+const [plate, setPlate] = useState<string>(
+  getValueViaPath(application.answers, FORM_PATHS.VEHICLE_PLATE, '') as string,
+)

Line range hint 51-64: Consider adding explicit error handling for missing permno

The current implementation silently handles missing permno. Consider adding explicit error handling to improve debugging and user feedback.

 const onChange = (option: Option) => {
   const currentVehicle = currentVehicleList[parseInt(option.value, 10)]
   setIsLoading(true)
-  if (currentVehicle.permno) {
+  try {
+    if (!currentVehicle?.permno) {
+      throw new Error('Selected vehicle has no permit number');
+    }
     setSelectedVehicle({
       permno: currentVehicle.permno,
       make: currentVehicle?.make || '',
       color: currentVehicle?.color || '',
       role: currentVehicle?.role,
     })
     setValue('pickVehicle.plate', currentVehicle.permno || '')
     setPlate(currentVehicle.permno || '')
-    setIsLoading(false)
+  } catch (error) {
+    console.error('Error in vehicle selection:', error);
+    setSelectedVehicle(null);
+    setValue('pickVehicle.plate', '');
+    setPlate('');
+  } finally {
+    setIsLoading(false);
   }
 }

98-100: Error display implementation is good but type safety could be improved

The error display logic with internationalization is well implemented. However, the type casting to any could be replaced with the proper error type as suggested earlier.

-{!isLoading && plate.length === 0 && (errors as any)?.pickVehicle && (
+{!isLoading && plate.length === 0 && errors?.pickVehicle && (
libs/application/templates/transport-authority/order-vehicle-license-plate/src/fields/VehiclesField/index.tsx (2)

69-84: Consider extracting field configuration

While the implementation is correct, the field configuration object could be extracted to a separate constant or utility function to improve maintainability and reusability.

Consider applying this refactor:

+ const getVehicleRadioFieldConfig = (
+   information: any,
+   error: any,
+   vehicles: any[]
+ ) => ({
+   id: 'pickVehicle',
+   title: information.labels.pickVehicle.title,
+   type: FieldTypes.VEHICLE_RADIO,
+   component: FieldComponents.VEHICLE_RADIO,
+   children: undefined,
+   itemType: 'VEHICLE',
+   itemList: vehicles,
+   alertMessageErrorTitle: information.labels.pickVehicle.hasErrorTitle,
+   validationErrorFallbackMessage: error.validationFallbackErrorMessage,
+   inputErrorMessage: error.requiredValidVehicle,
+ });

  <VehicleRadioFormField
    {...props}
-   field={{
-     id: 'pickVehicle',
-     title: information.labels.pickVehicle.title,
-     type: FieldTypes.VEHICLE_RADIO,
-     component: FieldComponents.VEHICLE_RADIO,
-     children: undefined,
-     itemType: 'VEHICLE',
-     itemList: currentVehicleList?.vehicles,
-     alertMessageErrorTitle: information.labels.pickVehicle.hasErrorTitle,
-     validationErrorFallbackMessage: error.validationFallbackErrorMessage,
-     inputErrorMessage: error.requiredValidVehicle,
-   }}
+   field={getVehicleRadioFieldConfig(
+     information,
+     error,
+     currentVehicleList?.vehicles
+   )}
  />

Line range hint 41-85: Extract magic numbers as named constants

The vehicle count thresholds (5 and 20) should be extracted as named constants to improve maintainability and make the business logic more explicit.

Consider applying this refactor:

+ const VEHICLE_COUNT_THRESHOLDS = {
+   SEARCH_FORM: 20,
+   SELECT_FIELD: 5
+ } as const;

  return (
    <Box paddingTop={2}>
-     {currentVehicleList.totalRecords > 20 ? (
+     {currentVehicleList.totalRecords > VEHICLE_COUNT_THRESHOLDS.SEARCH_FORM ? (
        <FindVehicleFormField
          // ... props
        />
-     ) : currentVehicleList.totalRecords > 5 ? (
+     ) : currentVehicleList.totalRecords > VEHICLE_COUNT_THRESHOLDS.SELECT_FIELD ? (
        <VehicleSelectField
          // ... props
        />
      ) : (
        <VehicleRadioFormField
          // ... props
        />
      )}
    </Box>
  )
libs/application/templates/transport-authority/transfer-of-vehicle-ownership/src/fields/VehiclesField/index.tsx (1)

106-108: Enhance type safety for itemType and optional itemList.

Consider these improvements:

  1. Use a typed constant for itemType instead of string literal 'VEHICLE'
  2. Add null check for itemList as currentVehicleList could be undefined
+ const ITEM_TYPE = {
+   VEHICLE: 'VEHICLE',
+ } as const;

  itemType: 'VEHICLE',
- itemList: currentVehicleList?.vehicles,
+ itemType: ITEM_TYPE.VEHICLE,
+ itemList: currentVehicleList?.vehicles ?? [],
libs/application/templates/transport-authority/change-operator-of-vehicle/src/fields/VehiclesField/index.tsx (2)

102-122: LGTM! Enhanced form field implementation.

The new VehicleRadioFormField implementation provides comprehensive validation and error handling. The field configuration is well-structured and type-safe.

Consider extracting the magic numbers in the conditions to named constants:

+const MAX_VEHICLES_FOR_RADIO = 5;
+const MAX_VEHICLES_FOR_SELECT = 20;

-currentVehicleList.totalRecords > 20 ?
+currentVehicleList.totalRecords > MAX_VEHICLES_FOR_SELECT ?
   <FindVehicleFormField
   ...
-: currentVehicleList.totalRecords > 5 ?
+: currentVehicleList.totalRecords > MAX_VEHICLES_FOR_RADIO ?

104-122: Consider extracting field configuration.

The field configuration object is quite large and could be extracted to improve maintainability and reusability.

Consider this refactor:

const vehicleRadioFieldConfig = {
  id: 'pickVehicle',
  title: information.labels.pickVehicle.title,
  description: information.labels.pickVehicle.description,
  type: FieldTypes.VEHICLE_RADIO,
  component: FieldComponents.VEHICLE_RADIO,
  children: undefined,
  itemType: 'VEHICLE',
  itemList: currentVehicleList?.vehicles,
  shouldValidateDebtStatus: true,
  alertMessageErrorTitle: information.labels.pickVehicle.hasErrorTitle,
  validationErrorMessages: applicationCheck.validation,
  validationErrorFallbackMessage: applicationCheck.validation.fallbackErrorMessage,
  inputErrorMessage: error.requiredValidVehicle,
  debtStatusErrorMessage: information.labels.pickVehicle.isNotDebtLessTag,
};

// In JSX:
<VehicleRadioFormField {...props} field={vehicleRadioFieldConfig} />
libs/application/types/src/lib/Fields.ts (1)

677-691: Enhance code organization and documentation

The interface could benefit from better organization and documentation:

  1. Group validation-related properties
  2. Add JSDoc comments for complex properties

Consider this refactoring:

interface ValidationConfig {
  shouldValidateDebtStatus?: boolean;
  shouldValidateRenewal?: boolean;
  validationErrorMessages?: Record<string, FormText>;
  validationErrorFallbackMessage?: FormText;
  debtStatusErrorMessage?: FormText;
  validateRenewal?: (item: VehicleItem | PlateItem) => boolean;
}

/** Represents a radio field for selecting vehicles or plates */
interface VehicleRadioField extends InputField {
  readonly type: FieldTypes.VEHICLE_RADIO;
  component: FieldComponents.VEHICLE_RADIO;
  
  /** Determines whether the field is for vehicle or plate selection */
  itemType: 'VEHICLE' | 'PLATE';
  
  /** List of vehicles or plates to choose from */
  itemList: Array<VehicleItem | PlateItem>;
  
  /** Configuration for validation rules and error messages */
  validation?: ValidationConfig;
  
  /** Error message for invalid input */
  inputErrorMessage: FormText;
  
  /** Optional tag to display renewal expiration */
  renewalExpiresAtTag?: StaticText;
}
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx (2)

83-168: Specify explicit return type for vehicleOptions function

For better type safety and clarity, consider specifying the explicit return type for the vehicleOptions function.

Apply the following change:

- const vehicleOptions = (vehicles: VehicleDetails[]) => {
+ const vehicleOptions = (vehicles: VehicleDetails[]): Option[] => {
🧰 Tools
🪛 Biome

[error] 151-151: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)


170-255: Specify explicit return type for plateOptions function

For better type safety and clarity, consider specifying the explicit return type for the plateOptions function.

Apply the following change:

- const plateOptions = (plates: PlateOwnership[]) => {
+ const plateOptions = (plates: PlateOwnership[]): Option[] => {
🧰 Tools
🪛 Biome

[error] 238-238: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between d89ae9c and 6d5f553.

📒 Files selected for processing (20)
  • libs/application/templates/transport-authority/change-co-owner-of-vehicle/src/fields/VehiclesField/VehicleRadioField.tsx (0 hunks)
  • libs/application/templates/transport-authority/change-co-owner-of-vehicle/src/fields/VehiclesField/index.tsx (2 hunks)
  • libs/application/templates/transport-authority/change-operator-of-vehicle/src/fields/VehiclesField/VehicleRadioField.tsx (0 hunks)
  • libs/application/templates/transport-authority/change-operator-of-vehicle/src/fields/VehiclesField/index.tsx (2 hunks)
  • libs/application/templates/transport-authority/license-plate-renewal/src/fields/PlateField/PlateRadioField.tsx (0 hunks)
  • libs/application/templates/transport-authority/license-plate-renewal/src/fields/PlateField/index.tsx (2 hunks)
  • libs/application/templates/transport-authority/license-plate-renewal/src/lib/dataSchema.ts (1 hunks)
  • libs/application/templates/transport-authority/order-vehicle-license-plate/src/fields/VehiclesField/VehicleRadioField.tsx (0 hunks)
  • libs/application/templates/transport-authority/order-vehicle-license-plate/src/fields/VehiclesField/index.tsx (2 hunks)
  • libs/application/templates/transport-authority/order-vehicle-license-plate/src/forms/OrderVehicleLicensePlateForm/InformationSection/plateSizeSubSection.ts (2 hunks)
  • libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/VehicleRadioField.tsx (0 hunks)
  • libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/VehicleSelectField.tsx (5 hunks)
  • libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/index.tsx (2 hunks)
  • libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/forms/OrderVehicleRegistrationCertificateForm/InformationSection/vehicleSubSection.ts (2 hunks)
  • libs/application/templates/transport-authority/transfer-of-vehicle-ownership/src/fields/VehiclesField/VehicleRadioField.tsx (0 hunks)
  • libs/application/templates/transport-authority/transfer-of-vehicle-ownership/src/fields/VehiclesField/index.tsx (2 hunks)
  • libs/application/types/src/lib/Fields.ts (4 hunks)
  • libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleDetails.ts (1 hunks)
  • libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx (1 hunks)
  • libs/application/ui-fields/src/lib/index.ts (1 hunks)
💤 Files with no reviewable changes (6)
  • libs/application/templates/transport-authority/change-co-owner-of-vehicle/src/fields/VehiclesField/VehicleRadioField.tsx
  • libs/application/templates/transport-authority/change-operator-of-vehicle/src/fields/VehiclesField/VehicleRadioField.tsx
  • libs/application/templates/transport-authority/license-plate-renewal/src/fields/PlateField/PlateRadioField.tsx
  • libs/application/templates/transport-authority/order-vehicle-license-plate/src/fields/VehiclesField/VehicleRadioField.tsx
  • libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/VehicleRadioField.tsx
  • libs/application/templates/transport-authority/transfer-of-vehicle-ownership/src/fields/VehiclesField/VehicleRadioField.tsx
🧰 Additional context used
📓 Path-based instructions (14)
libs/application/templates/transport-authority/change-co-owner-of-vehicle/src/fields/VehiclesField/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/transport-authority/change-operator-of-vehicle/src/fields/VehiclesField/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/transport-authority/license-plate-renewal/src/fields/PlateField/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/transport-authority/license-plate-renewal/src/lib/dataSchema.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/transport-authority/order-vehicle-license-plate/src/fields/VehiclesField/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/transport-authority/order-vehicle-license-plate/src/forms/OrderVehicleLicensePlateForm/InformationSection/plateSizeSubSection.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/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/VehicleSelectField.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/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/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/transport-authority/order-vehicle-registration-certificate/src/forms/OrderVehicleRegistrationCertificateForm/InformationSection/vehicleSubSection.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/transport-authority/transfer-of-vehicle-ownership/src/fields/VehiclesField/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/types/src/lib/Fields.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/VehicleRadioFormField/VehicleDetails.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/VehicleRadioFormField/VehicleRadioFormField.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/ui-fields/src/lib/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."
🪛 Biome
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx

[error] 151-151: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)


[error] 238-238: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🔇 Additional comments (21)
libs/application/templates/transport-authority/license-plate-renewal/src/lib/dataSchema.ts (2)

Line range hint 1-13: LGTM! Well-structured schema definition

The schema is well-defined using zod with proper TypeScript integration and exports. The modular structure ensures reusability across different NextJS applications.


7-7: Verify the impact of making the 'value' field optional

This change could affect form validation behavior in components using this schema. Please ensure this aligns with the new VehicleRadioFormField requirements.

Let's verify the usage of this schema:

✅ Verification successful

Making 'value' field optional is correct and safe

The schema change aligns perfectly with the component's implementation:

  • The PlateSelectField component handles the initial empty state correctly
  • The field is used as an index selector for the plate list, where an empty initial state is valid
  • Form validation is properly managed through the required regno field, which is set only after successful plate validation
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for imports of LicensePlateRenewalSchema to understand impact
rg -l "LicensePlateRenewalSchema" 

# Search for components using pickPlate.value
rg "pickPlate.*value" 

# Look for VehicleRadioFormField usage with this schema
rg "VehicleRadioFormField.*LicensePlateRenewal"

Length of output: 907


Script:

#!/bin/bash
# Let's examine the PlateSelectField component and its usage
cat libs/application/templates/transport-authority/license-plate-renewal/src/fields/PlateField/PlateSelectField.tsx

# Check the getSelectedVehicle utility
cat libs/application/templates/transport-authority/license-plate-renewal/src/utils/getSelectedVehicle.ts

# Look at the template to understand the form structure
cat libs/application/templates/transport-authority/license-plate-renewal/src/lib/LicensePlateRenewalTemplate.ts

Length of output: 11552

libs/application/templates/transport-authority/order-vehicle-license-plate/src/forms/OrderVehicleLicensePlateForm/InformationSection/plateSizeSubSection.ts (2)

Line range hint 27-54: Verify form validation after ID changes

The ID changes from plateSize.* to vehicleInfo.* might affect form validation and data persistence. Please ensure:

  1. Existing form data is migrated or handled appropriately
  2. Form validation rules are updated to use the new field IDs
  3. Any dependent components are updated to reference the new structure

Let's check for any validation rules or dependencies:

#!/bin/bash
# Description: Look for validation rules and dependencies that might need updating

# Search for validation rules
echo "Checking for validation rules:"
rg -A 5 "validation.*plateSize\.(vehiclePlate|vehicleType)"

# Search for form data access
echo "Checking for form data access:"
rg -A 5 "answers\[.*plateSize\.(vehiclePlate|vehicleType)"

Line range hint 27-40: Verify consistent usage of the new vehicleInfo namespace

The ID change from plateSize.vehiclePlate to vehicleInfo.plate appears to be part of a larger refactoring. The new namespace better represents the data category.

Let's verify this change is consistent across the codebase:

✅ Verification successful

The search results show consistent usage of vehicleInfo.plate across multiple transport authority templates and UI field components. There are no remaining occurrences of the old plateSize.vehiclePlate pattern. Let's verify one more aspect - the schema/type definitions to ensure type safety:


ID change from plateSize.vehiclePlate to vehicleInfo.plate is consistently implemented

The verification shows that:

  • The new vehicleInfo.plate pattern is consistently used across multiple transport authority templates
  • No legacy occurrences of plateSize.vehiclePlate remain in the codebase
  • The field ID is properly handled in form components like VehicleRadioFormField and FindVehicleFormField
  • The change is consistently applied in related vehicle management templates (transfer, registration, operator change)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining occurrences of the old ID pattern and verify consistent usage of the new pattern

# Check for any remaining uses of the old pattern
echo "Checking for remaining uses of old pattern:"
rg "plateSize\.vehiclePlate"

# Check usage of new pattern to ensure consistency
echo "Checking usage of new pattern:"
rg "vehicleInfo\.plate"

Length of output: 2081


Script:

#!/bin/bash
# Check type definitions and interfaces using vehicleInfo
ast-grep --pattern 'interface $_ {
  $$$
  vehicleInfo?: {
    $$$
  }
  $$$
}'

# Also check for any type imports or references
rg "type.*vehicleInfo" -A 2

Length of output: 482

libs/application/ui-fields/src/lib/index.ts (2)

28-28: LGTM! Export follows established patterns.

The new export follows the consistent pattern used throughout the file and maintains proper organization.


28-28: Verify component implementation meets library standards.

Since this is a shared library component, let's verify the implementation meets our requirements.

libs/application/templates/transport-authority/license-plate-renewal/src/fields/PlateField/index.tsx (1)

1-5: LGTM! Well-structured imports following best practices.

The imports are properly organized, with explicit named exports that enable effective tree-shaking. Good use of shared types and UI components from the application libraries.

Also applies to: 14-16

libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/index.tsx (2)

6-6: LGTM! Import statements follow best practices.

The imports are properly structured for tree-shaking optimization and follow the module organization pattern.

Also applies to: 11-14


68-79: LGTM! Component implementation follows best practices.

The implementation properly uses TypeScript and follows component reusability patterns.

libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/fields/VehiclesField/VehicleSelectField.tsx (1)

4-9: LGTM: Import changes are well-structured

The addition of InputError from the shared UI library aligns with the component's enhanced error handling capabilities while maintaining reusability across different NextJS apps.

libs/application/templates/transport-authority/order-vehicle-license-plate/src/fields/VehiclesField/index.tsx (1)

9-12: LGTM! Imports follow best practices

The imports are properly structured, using shared UI components from the application package which promotes reusability across different NextJS apps.

libs/application/templates/transport-authority/order-vehicle-registration-certificate/src/forms/OrderVehicleRegistrationCertificateForm/InformationSection/vehicleSubSection.ts (1)

Line range hint 1-140: Well-structured and reusable form configuration!

The implementation follows good practices:

  • Uses TypeScript effectively with proper type imports
  • Implements a modular builder pattern for form construction
  • Maintains clear separation of concerns with external data handling
  • Provides consistent field configurations
libs/application/templates/transport-authority/transfer-of-vehicle-ownership/src/fields/VehiclesField/index.tsx (2)

14-17: LGTM! Import changes follow best practices.

The imports are properly structured for optimal tree-shaking and reusability across NextJS apps.


97-98: LGTM! Component implementation is well-structured.

The VehicleRadioFormField implementation includes comprehensive validation, error handling, and debt status checking capabilities.

Also applies to: 99-117

libs/application/templates/transport-authority/change-co-owner-of-vehicle/src/fields/VehiclesField/index.tsx (2)

13-16: LGTM! Clean import structure following tree-shaking practices.

The imports are properly organized and follow effective tree-shaking practices by importing specific components from the UI fields package.


97-117: LGTM! Comprehensive field configuration with proper validation.

The new VehicleRadioFormField implementation includes:

  • Proper TypeScript prop types
  • Comprehensive validation error messages
  • Debt status validation
  • Reusable field configuration
libs/application/templates/transport-authority/change-operator-of-vehicle/src/fields/VehiclesField/index.tsx (1)

13-16: LGTM! Clean import structure.

The imports follow TypeScript conventions and promote reusability across NextJS apps by importing from the shared UI fields library.

libs/application/types/src/lib/Fields.ts (3)

259-259: LGTM: Enum addition follows conventions

The new VEHICLE_RADIO type follows the established naming pattern and maintains alphabetical ordering.


294-294: LGTM: Component enum addition follows conventions

The new VehicleRadioFormField component follows React naming conventions and maintains consistency with other form field components.


787-787: LGTM: Field union type correctly updated

The VehicleRadioField is properly added to the Field union type, enabling proper type checking throughout the application.

libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx (1)

28-284: Component adheres to coding guidelines and is well-implemented

The VehicleRadioFormField component is properly designed with TypeScript types, promoting reusability across different NextJS applications. It effectively manages form state and integrates well with the application.

🧰 Tools
🪛 Biome

[error] 151-151: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)


[error] 238-238: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

@datadog-island-is
Copy link

datadog-island-is bot commented Nov 18, 2024

Datadog Report

All test runs 21bca09 🔗

23 Total Test Services: 0 Failed, 22 Passed
🔻 Test Sessions change in coverage: 3 decreased, 2 increased, 91 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
air-discount-scheme-web 0 0 0 2 0 6.85s 1 no change Link
api 0 0 0 4 0 2.45s 1 no change Link
application-api-files 0 0 0 2 0 4.29s 1 increased (+0.06%) Link
application-core 0 0 0 97 0 14.73s 1 decreased (-0.06%) Link
application-system-api 0 0 0 112 2 3m 27.05s 1 no change Link
application-template-api-modules 0 0 0 116 0 2m 4.76s 1 no change Link
application-templates-accident-notification 0 0 0 148 0 19.17s 1 no change Link
application-templates-criminal-record 0 0 0 2 0 11.21s 1 no change Link
application-templates-driving-license 0 0 0 13 0 16.63s 1 no change Link
application-templates-example-payment 0 0 0 2 0 12.13s 1 no change Link

🔻 Code Coverage Decreases vs Default Branch (3)

  • application-ui-shell - jest 26.77% (-0.28%) - Details
  • application-core - jest 78.63% (-0.06%) - Details
  • application-types - jest 5.43% (-0.03%) - Details

Copy link
Member

@berglindoma13 berglindoma13 left a comment

Choose a reason for hiding this comment

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

bara ein spurning

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (2)
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx (2)

52-78: Optimize selection handler and improve type safety

The selection handler could be improved in several ways:

  1. Use type guards instead of type casting
  2. Implement early returns for better readability
  3. Batch setValue calls for better performance

Consider this refactor:

  const onRadioControllerSelect = (s: string) => {
+   const index = parseInt(s, 10)
+   if (isNaN(index)) return
+
    if (field.itemType === 'VEHICLE') {
-     const currentVehicleList = field.itemList as VehicleDetails[]
+     if (!Array.isArray(field.itemList)) return
+     const currentVehicleList = field.itemList as VehicleDetails[]
      const currentVehicle = currentVehicleList?.[parseInt(s, 10)]
+     if (!currentVehicle) return
      const permno = currentVehicle?.permno || ''

      setSelectedValue(permno)

+     // Batch update form values
+     const updates = {
+       [`${field.id}.plate`]: permno,
+       [`${field.id}.type`]: currentVehicle.make,
+       [`${field.id}.color`]: currentVehicle.color || undefined,
+       'vehicleMileage.requireMileage': currentVehicle.requireMileage,
+       'vehicleMileage.mileageReading': currentVehicle.mileageReading,
+     }
+     Object.entries(updates).forEach(([key, value]) => setValue(key, value))

+     if (permno) {
+       setValue('vehicleInfo.plate', permno)
+       setValue('vehicleInfo.type', currentVehicle.make)
+     }
    }
    // Similar refactor for PLATE type...
  }

254-281: LGTM! Consider type guard for itemList

The rendering logic is well-implemented. Consider adding a type guard for better type safety:

  let options: Option[] = []
  if (field.itemType === 'VEHICLE') {
+   if (!Array.isArray(field.itemList)) return []
    options = vehicleOptions(field.itemList as VehicleDetails[])
  } else if (field.itemType === 'PLATE') {
+   if (!Array.isArray(field.itemList)) return []
    options = plateOptions(field.itemList as PlateOwnership[])
  }
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6d5f553 and c3e946e.

📒 Files selected for processing (2)
  • libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleDetails.ts (1 hunks)
  • libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleDetails.ts
🧰 Additional context used
📓 Path-based instructions (1)
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.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."
🪛 Biome
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx

[error] 148-148: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)


[error] 235-235: Missing key property for this element in iterable.

The order of the items may change, and having a key can help React identify which item was moved.
Check the React documentation.

(lint/correctness/useJsxKeyInIterable)

🔇 Additional comments (1)
libs/application/ui-fields/src/lib/VehicleRadioFormField/VehicleRadioFormField.tsx (1)

1-28: LGTM! Well-structured type definitions and imports.

The code follows TypeScript best practices with proper type definitions and organized imports.

@johannaagma johannaagma added the automerge Merge this PR as soon as all checks pass label Nov 19, 2024
@kodiakhq kodiakhq bot merged commit 025f1f8 into main Nov 19, 2024
93 checks passed
@kodiakhq kodiakhq bot deleted the fix/samgongustofa-vehicle-radio-form-field branch November 19, 2024 11:43
jonnigs pushed a commit that referenced this pull request Nov 26, 2024
* Fix typo

* Fix mileageReading vs isRequired
Stop using mileageRequired from answers in getSelectedVehicle and always look at the value from externalData (it should not change)

* Make sure to always use requiresMileageRegistration from currentvehicleswithmileageandinsp (not basicVehicleInformation)
Cleanup make+vehcom (basicVehicleInformation) vs make (currentvehicles)

* Cleanup

* cleanup

* cleanup

* cleanup

* Use shared function to extract messages from error body
Display always E, L and W messages (but E and L first)

* Use dummy mileage value when validating per vehicle (owner/operator change)

* Catch error from mileage api

* Fix the way validation errors are displayed in SGS ownerchange
Allow all users to retry submit application if all approvals are finished

* Apply same change to change co-owner + change operator
Display ValidationErrorMessages always in overview, no matter who is reviewing

* Cleanup

* Cleanup in LicensePlateRenewal + OrderVehicleLicensePlate
Add validation per plate if user has more than 5

* Fix the way vehicle subModel is displayed

* Fixes after review

* Fix the way errors are displayed for RenewLicensePlate
Add MocablePayment

* Add validation for OrderVehicleLicensePlate

* Cleanup

* Fix comment

* Create RadioFormField

* Fix field currentVehicleList

* Use RadioFormField in all SGS applications

* Use RadioFormField in all SGS applications

* Cleanup

* cleanup

* cleanup field names

* Fixes after review

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants