-
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: netsuite > category mapping errors > dialogue > table header text #1045
fix: netsuite > category mapping errors > dialogue > table header text #1045
Conversation
…header text bugfix to show "Expense Category" instead of "Account" in the table header when ccc export type is Expense Report.
WalkthroughThe changes in this pull request involve modifications to 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: 0
🧹 Outside diff range and nitpick comments (1)
src/app/integrations/netsuite/netsuite-main/netsuite-dashboard/netsuite-dashboard.component.ts (1)
132-132
: Consider extracting the complex condition into a helper method.While the logic is correct and aligns with the PR objective to fix category mapping, the condition could be made more readable by extracting it into a helper method.
Consider refactoring like this:
- CATEGORY: (responses[4].configuration.reimbursable_expenses_object === NetsuiteReimbursableExpensesObject.EXPENSE_REPORT || responses[4].configuration.corporate_credit_card_expenses_object === NetSuiteCorporateCreditCardExpensesObject.EXPENSE_REPORT) ? NetsuiteCategoryDestination.EXPENSE_CATEGORY : NetsuiteCategoryDestination.ACCOUNT + CATEGORY: this.getCategoryDestination(responses[4].configuration) + private getCategoryDestination(configuration: any): string { + const isExpenseReport = + configuration.reimbursable_expenses_object === NetsuiteReimbursableExpensesObject.EXPENSE_REPORT || + configuration.corporate_credit_card_expenses_object === NetSuiteCorporateCreditCardExpensesObject.EXPENSE_REPORT; + + return isExpenseReport + ? NetsuiteCategoryDestination.EXPENSE_CATEGORY + : NetsuiteCategoryDestination.ACCOUNT; + }This refactoring:
- Improves readability by giving the logic a descriptive name
- Makes the code more maintainable
- Makes the condition easier to test
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- src/app/integrations/netsuite/netsuite-main/netsuite-dashboard/netsuite-dashboard.component.ts (1 hunks)
🔇 Additional comments (1)
src/app/integrations/netsuite/netsuite-main/netsuite-dashboard/netsuite-dashboard.component.ts (1)
131-132
: LGTM: Improved error handling for accounting export summary.The addition of error handling using
catchError
operator is a good defensive programming practice. It ensures the application continues to function even if the accounting export summary request fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (30)
- src/app/core/services/common/helper.service.ts (1 hunks)
- src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-advanced-settings.service.spec.ts (1 hunks)
- src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-export-settings.service.spec.ts (1 hunks)
- src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.service.spec.ts (1 hunks)
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-auth.service.spec.ts (1 hunks)
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-connector.service.spec.ts (1 hunks)
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-helper.service.spec.ts (1 hunks)
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-mappings.service.spec.ts (1 hunks)
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-workspace.service.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-configuration/qbd-direct-configuration.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-dashboard/qbd-direct-dashboard.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-export-log/qbd-direct-complete-export-log/qbd-direct-complete-export-log.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-export-log/qbd-direct-export-log.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-export-log/qbd-direct-skipped-export-log/qbd-direct-skipped-export-log.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-main.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-mapping/qbd-direct-base-mapping/qbd-direct-base-mapping.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-mapping/qbd-direct-mapping.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-connector/qbd-direct-onboarding-connector.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-done/qbd-direct-onboarding-done.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-export-settings/qbd-direct-onboarding-export-settings.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-import-settings/qbd-direct-onboarding-import-settings.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-landing/qbd-direct-onboarding-landing.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-advanced-settings/qbd-direct-advanced-settings.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-export-settings/qbd-direct-export-settings.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-export-settings/qbd-direct-export-settings.component.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-import-settings/qbd-direct-import-settings.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-shared.component.spec.ts (1 hunks)
- src/app/integrations/qbd-direct/qbd-direct.component.spec.ts (1 hunks)
✅ Files skipped from review due to trivial changes (29)
- src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-advanced-settings.service.spec.ts
- src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-export-settings.service.spec.ts
- src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.service.spec.ts
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-auth.service.spec.ts
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-connector.service.spec.ts
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-helper.service.spec.ts
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-mappings.service.spec.ts
- src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-workspace.service.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-configuration/qbd-direct-configuration.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-dashboard/qbd-direct-dashboard.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-export-log/qbd-direct-complete-export-log/qbd-direct-complete-export-log.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-export-log/qbd-direct-export-log.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-export-log/qbd-direct-skipped-export-log/qbd-direct-skipped-export-log.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-main.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-mapping/qbd-direct-base-mapping/qbd-direct-base-mapping.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-mapping/qbd-direct-mapping.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-advanced-settings/qbd-direct-onboarding-advanced-settings.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-connector/qbd-direct-onboarding-connector.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-done/qbd-direct-onboarding-done.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-export-settings/qbd-direct-onboarding-export-settings.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-import-settings/qbd-direct-onboarding-import-settings.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding-landing/qbd-direct-onboarding-landing.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-onboarding/qbd-direct-onboarding.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-advanced-settings/qbd-direct-advanced-settings.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-export-settings/qbd-direct-export-settings.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-export-settings/qbd-direct-export-settings.component.ts
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-import-settings/qbd-direct-import-settings.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-shared.component.spec.ts
- src/app/integrations/qbd-direct/qbd-direct.component.spec.ts
🔇 Additional comments (1)
src/app/core/services/common/helper.service.ts (1)
55-55
: Verify PR scope: Changes seem unrelated to NetSuite category mapping.The change to QBD Direct API URL handling appears unrelated to the PR's stated objective of fixing NetSuite category mapping errors in the dialogue table header text. Please clarify if this change is intentional or if it should be in a separate PR.
Let's verify if there are any NetSuite-related changes that might have been missed:
@@ -52,7 +52,7 @@ export class HelperService { | |||
const apiUrlMap: AppUrlMap = { | |||
[AppUrl.INTACCT]: environment.production ? `${this.apiBaseUrl}/intacct-api/api` : environment.si_api_url, | |||
[AppUrl.QBD]: environment.qbd_api_url, | |||
[AppUrl.QBD_DIRECT]: environment.qbd_direct_api_url, | |||
[AppUrl.QBD_DIRECT]: ('qbd_direct_api_url' in environment) ? environment.qbd_direct_api_url as string : "", |
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
Consider using nullish coalescing for URL fallback.
While the defensive check for qbd_direct_api_url
existence is good, consider using the nullish coalescing operator for a more concise implementation.
- [AppUrl.QBD_DIRECT]: ('qbd_direct_api_url' in environment) ? environment.qbd_direct_api_url as string : "",
+ [AppUrl.QBD_DIRECT]: environment.qbd_direct_api_url ?? "",
This achieves the same result but is more idiomatic in modern TypeScript. The nullish coalescing operator (??
) will return the right-hand side only when the left-hand side is null
or undefined
, which is exactly what we want here.
📝 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.
[AppUrl.QBD_DIRECT]: ('qbd_direct_api_url' in environment) ? environment.qbd_direct_api_url as string : "", | |
[AppUrl.QBD_DIRECT]: environment.qbd_direct_api_url ?? "", |
|
Description
bugfix to show "Expense Category" instead of "Account" in the table header when ccc export type is Expense Report.
Clickup
app.clickup.com
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Tests