-
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
feat(app-sys): changes to app sys that were bundled with financial aid update #17210
Conversation
WalkthroughThe pull request introduces several new functionalities and modifications across multiple files. It adds two new field builder functions, Changes
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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
🧹 Outside diff range and nitpick comments (5)
libs/application/ui-shell/src/utils.ts (1)
165-167
: Improve type checking with optional chainingThe component prototype check can be simplified using optional chaining.
- typeof component === 'function' && - !(component.prototype && component.prototype.isReactComponent) && - component.length === 0 + typeof component === 'function' && + !component.prototype?.isReactComponent && + component.length === 0🧰 Tools
🪛 Biome (1.9.4)
[error] 166-166: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
libs/application/ui-fields/src/lib/AccordionFormField/AccordionFormField.tsx (2)
12-14
: Add prop validation for required fieldsConsider adding runtime validation for required fields using PropTypes or a schema validation library to catch potential issues early in development.
19-25
: Optimize performance with useMemoConsider memoizing the items calculation to prevent unnecessary re-renders when other props change.
- useEffect(() => { - if (typeof accordionItems === 'function') { - setItems(accordionItems(application)) - } else { - setItems(accordionItems) - } - }, [accordionItems]) + const calculatedItems = useMemo(() => { + return typeof accordionItems === 'function' + ? accordionItems(application) + : accordionItems + }, [accordionItems, application]) + + useEffect(() => { + setItems(calculatedItems) + }, [calculatedItems])libs/application/ui-fields/src/lib/BankAccountFormField/BankAccountFormField.tsx (1)
14-82
: Document format patternsAdd JSDoc comments to document the expected format patterns for each input field. This will help other developers understand the validation requirements.
+/** + * BankAccountFormField component for collecting bank account information + * @param field - The bank account field configuration + * @param application - The application context + * + * Format patterns: + * - Bank number: #### (4 digits) + * - Ledger: ## (2 digits) + * - Account number: ###### (6 digits) + */ export const BankAccountFormField = ({ field, application }: Props) => {libs/application/types/src/lib/Fields.ts (1)
682-695
: Consider adding validation support to AccordionField.The AccordionField interface could benefit from validation capabilities to ensure content meets requirements.
Consider adding validation-related properties:
export interface AccordionField extends BaseField { readonly type: FieldTypes.ACCORDION component: FieldComponents.ACCORDION accordionItems: | Array<AccordionItem> | ((application: Application) => Array<AccordionItem>) marginTop?: ResponsiveProp<Space> marginBottom?: ResponsiveProp<Space> titleVariant?: TitleVariants + validate?: (items: Array<AccordionItem>) => boolean + validationErrorMessage?: FormText }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (9)
libs/application/core/src/lib/fieldBuilders.ts
(2 hunks)libs/application/core/src/lib/messages.ts
(1 hunks)libs/application/types/src/lib/Fields.ts
(4 hunks)libs/application/types/src/lib/Form.ts
(1 hunks)libs/application/ui-fields/src/lib/AccordionFormField/AccordionFormField.tsx
(1 hunks)libs/application/ui-fields/src/lib/BankAccountFormField/BankAccountFormField.tsx
(1 hunks)libs/application/ui-fields/src/lib/index.ts
(1 hunks)libs/application/ui-shell/src/lib/FormShell.tsx
(2 hunks)libs/application/ui-shell/src/utils.ts
(2 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
libs/application/types/src/lib/Form.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/index.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/ui-shell/src/lib/FormShell.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/core/src/lib/messages.ts (1)
Pattern libs/**/*
: "Confirm that the code adheres to the following:
- Reusability of components and hooks across different NextJS apps.
- TypeScript usage for defining props and exporting types.
- Effective tree-shaking and bundling practices."
libs/application/ui-shell/src/utils.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/BankAccountFormField/BankAccountFormField.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/AccordionFormField/AccordionFormField.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/core/src/lib/fieldBuilders.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 (1.9.4)
libs/application/ui-shell/src/utils.ts
[error] 166-166: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
🔇 Additional comments (6)
libs/application/types/src/lib/Form.ts (1)
82-82
: LGTM: Type change enhances logo flexibility
The change from React.FC
to FormComponent
type for the logo property improves flexibility by allowing dynamic logo generation based on application state.
libs/application/ui-shell/src/utils.ts (1)
160-189
: LGTM: Well-implemented type guards and component handling
The implementation provides robust type checking with proper TypeScript type guards. The getFormComponent
function handles all cases gracefully and maintains type safety throughout.
🧰 Tools
🪛 Biome (1.9.4)
[error] 166-166: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
libs/application/ui-shell/src/lib/FormShell.tsx (1)
28-28
: LGTM: Clean integration of dynamic logo handling
The integration of getFormComponent
is clean and maintains the component's simplicity while adding support for dynamic logos.
Also applies to: 70-70
libs/application/ui-fields/src/lib/index.ts (1)
33-34
: LGTM!
The new exports follow the established pattern and maintain alphabetical ordering.
libs/application/core/src/lib/fieldBuilders.ts (1)
1016-1040
: Verify accordion component integration.
The function implementation looks correct, but let's verify the AccordionFormField component exists.
✅ Verification successful
The accordion field implementation is correctly integrated with its component
The buildAccordionField
function is properly implemented and aligns with the AccordionFormField
component found in libs/application/ui-fields/src/lib/AccordionFormField/AccordionFormField.tsx
. The component:
- Accepts all the properties returned by the builder function
- Properly handles both static and dynamic
accordionItems
- Correctly uses the optional properties like
titleVariant
,marginTop
, andmarginBottom
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify AccordionFormField component exists
# Test: Search for AccordionFormField component definition
ast-grep --pattern 'export const AccordionFormField = $$$'
Length of output: 4641
libs/application/core/src/lib/messages.ts (1)
321-335
: LGTM! Messages follow the established pattern.
The new bank account related messages are well-structured and properly localized.
libs/application/ui-fields/src/lib/AccordionFormField/AccordionFormField.tsx
Show resolved
Hide resolved
libs/application/ui-fields/src/lib/BankAccountFormField/BankAccountFormField.tsx
Show resolved
Hide resolved
libs/application/ui-fields/src/lib/BankAccountFormField/BankAccountFormField.tsx
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17210 +/- ##
==========================================
- Coverage 35.75% 35.74% -0.01%
==========================================
Files 6935 6937 +2
Lines 148113 148149 +36
Branches 42233 42242 +9
==========================================
+ Hits 52953 52954 +1
- Misses 95160 95195 +35 Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Datadog ReportAll test runs ✅ 21 Total Test Services: 0 Failed, 20 Passed Test ServicesThis report shows up to 10 services
🔻 Code Coverage Decreases vs Default Branch (3) |
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.
LGTM
This PR currently has a merge conflict. Please resolve this and then re-add the |
What
Add back in changes to the application system that were reverted with the financial aid reveret
buildAccordionField
buildBankInfoField
dynamic logo for applications
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores