-
Notifications
You must be signed in to change notification settings - Fork 0
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: qbd direct advanced settings onboarding changes and content changes #1084
fix: qbd direct advanced settings onboarding changes and content changes #1084
Conversation
WalkthroughThe pull request introduces several modifications across multiple files, primarily focusing on enhancing the clarity and consistency of text content in integration settings for QuickBooks Desktop, NetSuite, Xero, and Sage Intacct. Changes include rephrasing labels in the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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
CodeRabbit Configuration 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: 2
🧹 Outside diff range and nitpick comments (6)
src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.html (1)
1-4
: Consider adding accessibility attributes and loading states.While the structure is clean and logical, consider enhancing the component with:
- ARIA landmarks for better screen reader support
- Loading states for better UX during data fetching
-<div class="tw-pb-48-px"> +<div class="tw-pb-48-px" role="region" aria-label="QuickBooks Desktop Advanced Settings"> + <div *ngIf="isLoading" class="tw-flex tw-justify-center"> + <app-loader></app-loader> + </div> + <div *ngIf="!isLoading"> <app-onboarding-steppers [onboardingSteps]="onboardingSteps"></app-onboarding-steppers> <app-qbd-direct-advanced-settings></app-qbd-direct-advanced-settings> + </div> </div>src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.ts (1)
28-29
: Consider implementing OnDestroy if subscriptions are added.If you plan to add any subscriptions (e.g., for workspace state changes), implement OnDestroy to properly clean them up.
-export class QbdDirectOnboardingAdvancedSettingsComponent implements OnInit { +export class QbdDirectOnboardingAdvancedSettingsComponent implements OnInit, OnDestroy { + private destroy$: Subject<void> = new Subject<void>(); + + ngOnDestroy(): void { + this.destroy$.next(); + this.destroy$.complete(); + }src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-advanced-settings.model.ts (1)
29-29
: Consider centralizing UI display valuesThe change to use a more readable "Expense/Report ID" label is good. However, consider centralizing these UI display values and their corresponding API values in a constant mapping to maintain consistency and ease future updates.
// Consider adding at class/file level: private static readonly MEMO_DISPLAY_MAP = { expense_key: 'Expense/Report ID' } as const; static defaultTopMemoOptions(): string[] { return ["employee_name", this.MEMO_DISPLAY_MAP.expense_key]; }src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-advanced-settings/qbd-direct-advanced-settings.component.html (1)
131-131
: Consider improving template readability.While the functionality is correct, the line is quite long. Consider breaking it into multiple lines for better readability:
- <app-configuration-step-footer [ctaText]="!saveInProgress ? (isOnboarding ? ConfigurationCtaText.SAVE_AND_CONTINUE : ConfigurationCtaText.SAVE) : ConfigurationCtaText.SAVING" [isButtonDisabled]="!advancedSettingsForm.valid || saveInProgress || !skipExportForm.valid" (save)="save()" [showBackButton]="true" (navigateToPreviousStep)="navigateToPreviousStep()"></app-configuration-step-footer> + <app-configuration-step-footer + [ctaText]="!saveInProgress ? (isOnboarding ? ConfigurationCtaText.SAVE_AND_CONTINUE : ConfigurationCtaText.SAVE) : ConfigurationCtaText.SAVING" + [isButtonDisabled]="!advancedSettingsForm.valid || saveInProgress || !skipExportForm.valid" + [showBackButton]="true" + (save)="save()" + (navigateToPreviousStep)="navigateToPreviousStep()"> + </app-configuration-step-footer>src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-advanced-settings/qbd-direct-advanced-settings.component.ts (1)
140-142
: Consider improving type safety and route managementWhile the navigation implementation is functional, there are a few improvements that could make it more maintainable and type-safe:
- The route path is hardcoded, which could be problematic if routes change
- The method lacks return type annotation
Consider applying these improvements:
- navigateToPreviousStep() { + navigateToPreviousStep(): void { + const IMPORT_SETTINGS_ROUTE = '/integrations/qbd_direct/onboarding/import_settings'; - this.router.navigate([`/integrations/qbd_direct/onboarding/import_settings`]); + this.router.navigate([IMPORT_SETTINGS_ROUTE]);This refactor:
- Adds explicit return type for better type safety
- Extracts the route path to a constant for better maintainability
src/app/branding/fyle-contents-config.ts (1)
97-100
: Consider adding examples for skip export conditions.While the text changes improve clarity, consider enhancing the skip export description with examples of common scenarios where users might want to skip exports.
- skipExportLabel: 'Skip Export of Specific Expenses from Fyle to QuickBooks Desktop', - skipExportSubLabel: 'Set up a conditional rule to selectively skip exporting certain expenses from Fyle to QuickBooks Desktop. ', + skipExportLabel: 'Skip Export of Specific Expenses from Fyle to QuickBooks Desktop', + skipExportSubLabel: 'Set up a conditional rule to selectively skip exporting certain expenses from Fyle to QuickBooks Desktop (e.g., expenses with specific categories, projects, or custom fields). ',
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (7)
src/app/branding/fyle-contents-config.ts
(1 hunks)src/app/core/models/common/advanced-settings.model.ts
(1 hunks)src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-advanced-settings.model.ts
(2 hunks)src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.html
(1 hunks)src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.ts
(1 hunks)src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-advanced-settings/qbd-direct-advanced-settings.component.html
(2 hunks)src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-advanced-settings/qbd-direct-advanced-settings.component.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/app/core/models/common/advanced-settings.model.ts
🔇 Additional comments (8)
src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.html (1)
2-3
: Verify error handling and component communication.
The advanced settings component might need to communicate with the stepper component for navigation and state management.
Let's verify the component integration:
✅ Verification successful
Component integration is properly implemented with sufficient error handling and state management
The verification shows that:
- The advanced settings component has proper error handling with try-catch blocks and error toasts
- Component communication is handled through services (WorkspaceService) for state management
- The parent component (QbdDirectOnboardingAdvancedSettingsComponent) correctly integrates with the child components using the onboarding steps model
- Form validation, watchers, and state updates are properly implemented in the advanced settings component
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if the components handle errors and communicate properly
# Look for EventEmitter outputs in the advanced settings component
ast-grep --pattern 'class QbdDirectAdvancedSettingsComponent {
$$$
@Output() $_ = new EventEmitter
$$$
}'
# Check for error handling in the parent component
rg -A 5 'catch|error' src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/
Length of output: 232
Script:
#!/bin/bash
# Let's try a different approach to verify component communication
# Check the advanced settings component implementation
fd "qbd-direct-advanced-settings.component.ts" --exec cat {}
# Check the parent component implementation
fd "qbd-direct-onboarding-advanced-settings.component.ts" --exec cat {}
# Look for any service interactions
fd "qbd-direct.*service.ts" --exec cat {}
Length of output: 21558
src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.ts (2)
1-9
: LGTM! Imports are well-organized and follow Angular best practices.
All necessary dependencies are properly imported and used within the component.
13-17
: Verify template dependencies for imported modules.
The component is properly configured as standalone. However, let's verify that all imported modules are actually used in the template.
✅ Verification successful
Based on the gathered information, I can now provide the final response:
All imported modules are justified and necessary
CommonModule
: While no direct usage of CommonModule directives is visible in the template, it's a fundamental module required for Angular componentsSharedModule
: Provides theOnboardingSteppersComponent
which is used in the template viaapp-onboarding-steppers
QbdDirectSharedModule
: Provides theQbdDirectAdvancedSettingsComponent
which is used in the template viaapp-qbd-direct-advanced-settings
QbdDirectAdvancedSettingsComponent
: Used directly in the template
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check template usage of imported modules
# Check template file for usage of imported module components/directives
rg -A 5 '<(app-qbd-direct|common\/|shared\/|ng[A-Z])' src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.html
Length of output: 337
Script:
#!/bin/bash
# Let's fix the regex and check template usage of imported modules
rg -A 5 "<(app-qbd-direct|common/|shared/|ng[A-Z])" src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.html
# Also get the template content to analyze all usages
cat src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.html
# Check what QbdDirectAdvancedSettingsComponent provides
rg -l "QbdDirectAdvancedSettingsComponent" --type ts
Length of output: 1200
Script:
#!/bin/bash
# Let's check what app-onboarding-steppers is and its module
rg -l "app-onboarding-steppers" --type html
rg "class OnboardingSteppersComponent" --type ts -A 5
# Let's also verify the actual usage of CommonModule and SharedModule features
rg -A 5 "(\*ng|\[(ng|routerLink)|\{\{)" src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.html
# Check if OnboardingSteppersComponent is part of QbdDirectSharedModule or SharedModule
rg "OnboardingSteppersComponent.*export" --type ts
Length of output: 5522
Script:
#!/bin/bash
# Check if OnboardingSteppersComponent is declared in SharedModule
rg -A 10 "SharedModule" src/app/shared/shared.module.ts
# Check if QbdDirectAdvancedSettingsComponent is declared in QbdDirectSharedModule
rg -A 10 "QbdDirectSharedModule" src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-shared.module.ts
# Check if the component uses any CommonModule directives in its class
rg "class QbdDirectOnboardingAdvancedSettingsComponent" -A 20 src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.ts
Length of output: 861
src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-advanced-settings/qbd-direct-advanced-settings.component.html (2)
57-57
: LGTM! Dynamic labels improve clarity.
The dynamic inclusion of the employee mapping type in both label and sublabel provides better context to users about what exactly will be created in QuickBooks Desktop.
Also applies to: 59-59
131-131
: Verify navigation state handling.
The addition of back navigation requires proper state management. Ensure that:
- Form data is preserved when navigating back
- The previous route (/integrations/qbd_direct/onboarding/import_settings) exists and is accessible
- Unsaved changes are handled appropriately
✅ Verification successful
Navigation implementation is simple and safe
The back navigation is properly implemented with a straightforward router navigation to /integrations/qbd_direct/onboarding/import_settings
. The component:
- Uses proper form handling with reactive forms
- Saves form data before navigation through the
save()
method - Has proper state management through various services (QbdDirectAdvancedSettingsService, etc.)
- Handles unsaved changes by disabling the navigation button when forms are invalid (
[isButtonDisabled]="!advancedSettingsForm.valid || saveInProgress || !skipExportForm.valid"
)
The route /integrations/qbd_direct/onboarding/import_settings
exists and is properly configured in the routing modules.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if the import settings route exists and is properly configured
rg -A 5 "path.*import_settings"
# Verify state management in the component
ast-grep --pattern 'navigateToPreviousStep() {
$$$
}'
Length of output: 11103
Script:
#!/bin/bash
# Let's check the component implementation to understand the navigation and state handling
rg -g "qbd-direct-advanced-settings.component.ts" "navigateToPreviousStep" -A 5
# Check if there's any state management service being used
rg -g "qbd-direct-advanced-settings.component.ts" "constructor.*" -A 10
# Check for form handling
rg -g "qbd-direct-advanced-settings.component.ts" "advancedSettingsForm" -A 5
Length of output: 13337
src/app/branding/fyle-contents-config.ts (3)
74-75
: LGTM! Improved clarity in Chart of Account Types text.
The changes make the text more concise and user-friendly while maintaining clarity about the default behavior.
83-83
: LGTM! Enhanced clarity in customization section.
The text now better explains the purpose of the customization section and its relationship to data export.
88-91
: LGTM! Better distinction between memo field types.
The changes improve clarity by:
- Clearly distinguishing between top-level and line-item level memo fields
- Using correct apostrophe formatting in possessive form
brandingContent = brandingContent.configuration.advancedSettings; | ||
|
||
onboardingSteps: OnboardingStepper[] = new QbdDirectOnboardingModel().getOnboardingSteps(this.brandingContent.stepName, this.workspaceService.getOnboardingState()); |
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.
🛠️ Refactor suggestion
Move complex initialization to ngOnInit.
The onboardingSteps
initialization involves multiple service calls and complex operations. Consider moving this to ngOnInit
for better lifecycle management and error handling.
- onboardingSteps: OnboardingStepper[] = new QbdDirectOnboardingModel().getOnboardingSteps(this.brandingContent.stepName, this.workspaceService.getOnboardingState());
+ onboardingSteps: OnboardingStepper[] = [];
+
+ ngOnInit(): void {
+ try {
+ const onboardingState = this.workspaceService.getOnboardingState();
+ this.onboardingSteps = new QbdDirectOnboardingModel().getOnboardingSteps(
+ this.brandingContent.stepName,
+ onboardingState
+ );
+ } catch (error) {
+ console.error('Failed to initialize onboarding steps:', error);
+ // Handle error appropriately
+ }
+ }
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
brandingContent = brandingContent.configuration.advancedSettings; | |
onboardingSteps: OnboardingStepper[] = new QbdDirectOnboardingModel().getOnboardingSteps(this.brandingContent.stepName, this.workspaceService.getOnboardingState()); | |
brandingContent = brandingContent.configuration.advancedSettings; | |
onboardingSteps: OnboardingStepper[] = []; | |
ngOnInit(): void { | |
try { | |
const onboardingState = this.workspaceService.getOnboardingState(); | |
this.onboardingSteps = new QbdDirectOnboardingModel().getOnboardingSteps( | |
this.brandingContent.stepName, | |
onboardingState | |
); | |
} catch (error) { | |
console.error('Failed to initialize onboarding steps:', error); | |
// Handle error appropriately | |
} | |
} |
const index = topMemo.indexOf('Expense/Report ID'); | ||
topMemo[index] = 'expense_key'; | ||
|
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.
🛠️ Refactor suggestion
Implement more robust string replacement logic
The current implementation using array index manipulation could be fragile if the array structure changes or if the string is not found. Consider implementing a more robust mapping approach.
- const index = topMemo.indexOf('Expense/Report ID');
- topMemo[index] = 'expense_key';
+ // Map UI display values to API values
+ const topMemoMapped = topMemo.map(memo =>
+ memo === 'Expense/Report ID' ? 'expense_key' : memo
+ );
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const index = topMemo.indexOf('Expense/Report ID'); | |
topMemo[index] = 'expense_key'; | |
// Map UI display values to API values | |
const topMemoMapped = topMemo.map(memo => | |
memo === 'Expense/Report ID' ? 'expense_key' : memo | |
); | |
d059b71
into
qbd-direct-onboarding-import-settings-main
#1082) * qbd direct export settings onboarding changes and content changes * fix: qbd direct import settings onboarding changes and content changes (#1083) * qbd direct import settings onboarding changes and content changes * qbd direct advanced settings onboarding changes and content changes (#1084)
* QA fixes * qa fixes * qa fixes * fix: qbd direct export settings onboarding changes and content changes (#1082) * qbd direct export settings onboarding changes and content changes * fix: qbd direct import settings onboarding changes and content changes (#1083) * qbd direct import settings onboarding changes and content changes * qbd direct advanced settings onboarding changes and content changes (#1084) * QA fixes * fix: QBD direct bug fixes (#1085) * QBD direct bug fixes * QBD direct bug fixes * QBD direct bug fixes
Description
fix: qbd direct advanced settings onboarding changes and content changes
ClickupPlease add link here
https://app.clickup.com/t/86cwzceku
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Improvements