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: card num in memo #1109

Merged
merged 3 commits into from
Dec 11, 2024
Merged

fix: card num in memo #1109

merged 3 commits into from
Dec 11, 2024

Conversation

anishfyle
Copy link
Contributor

@anishfyle anishfyle commented Dec 11, 2024

Description

  • fix card num option in qbo and intacct

Clickup

Summary by CodeRabbit

  • New Features

    • Enhanced handling of export settings configurations for improved flexibility and robustness.
    • Simplified logic for filtering memo options based on export type.
    • Improved consistency in data structures for export values.
  • Bug Fixes

    • Corrected formatting of fields to ensure they are treated as arrays when necessary.

Copy link
Contributor

coderabbitai bot commented Dec 11, 2024

Walkthrough

The pull request introduces several updates to the AdvancedSettingsModel class in the advanced-settings.model.ts file. Key modifications include enhancements to the getMemoOptions method for better handling of export settings configurations and simplification of memo option filtering logic. Additionally, the constructSkipExportValue method has been adjusted to ensure proper formatting of fields as arrays when they are strings. These changes collectively improve the robustness and functionality of the AdvancedSettingsModel.

Changes

File Path Change Summary
src/app/core/models/common/advanced-settings.model.ts - Updated method signatures for getMemoOptions, constructSkipExportValue, constructExportFilterPayload, constructSkipExportPayload, setConditionFields, getSelectedOperator, getFieldValue, and setupSkipExportForm in the AdvancedSettingsModel and SkipExportModel classes.

Possibly related PRs

  • feat: add card num and employee name #1086: Modifies the AdvancedSettingsModel class by adding the card_number to the memo options, which is directly related to the modifications made in the main PR that also focuses on the getMemoOptions method in the same class.
  • fix: intacct css fix #1015: This PR includes changes to the advancedSettings section, which may indirectly relate to the overall handling of advanced settings, although it does not modify the same methods or logic as the main PR.
  • test: fix flaky test #1018: This PR involves modifications to the test suite for the QboAdvancedSettingsComponent, which may relate to the changes in the handling of memo options in the main PR, particularly if the component interacts with the AdvancedSettingsModel.
  • fix: qbd direct advanced settings onboarding changes and content changes #1084: This PR includes changes to the advancedSettings section, which may relate to the overall handling of advanced settings, although it does not modify the same methods or logic as the main PR.
  • fix: dashboard error section fixes #1107: This PR modifies the DashboardErrorSectionComponent, which may relate to the overall application functionality but does not directly connect to the changes in the AdvancedSettingsModel class.
  • fix: QBD fixes post testing #1108: This PR addresses fixes related to QBD following testing, which may relate to the overall functionality of the application but does not directly connect to the changes in the AdvancedSettingsModel class.

Suggested labels

size/M

Suggested reviewers

  • DhaaraniCIT
  • ashwin1111

🐇 In the meadow, changes bloom,
Advanced settings find more room.
Memo options now refined,
With logic clearer, well-defined.
A hop, a skip, in code we play,
Enhancements brightening our way! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between aabe8c5 and 580b8ec.

📒 Files selected for processing (1)
  • src/app/core/models/common/advanced-settings.model.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/core/models/common/advanced-settings.model.ts

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 generate docstrings to generate docstrings for this PR. (Experiment)
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@github-actions github-actions bot added the size/XS Extra Small PR label Dec 11, 2024
Copy link

PR description must contain a link to a ClickUp (case-insensitive)

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: 0

🧹 Outside diff range and nitpick comments (1)
src/app/core/models/common/advanced-settings.model.ts (1)

82-87: Refactor repetitive property checks into a single assignment

The assignment to cccExportType can be simplified to reduce code duplication and improve readability.

Apply this diff to consolidate the assignments:

-    if ('configurations' in exportSettings) {
-      cccExportType = exportSettings.configurations?.corporate_credit_card_expenses_object ?? undefined;
-    } else if ('configuration' in exportSettings) {
-      cccExportType = exportSettings.configuration?.corporate_credit_card_expenses_object ?? undefined;
-    } else if ('workspace_general_settings' in exportSettings) {
-      cccExportType = exportSettings.workspace_general_settings?.corporate_credit_card_expenses_object ?? undefined;
-    }
+    cccExportType = exportSettings.configurations?.corporate_credit_card_expenses_object ??
+                    exportSettings.configuration?.corporate_credit_card_expenses_object ??
+                    exportSettings.workspace_general_settings?.corporate_credit_card_expenses_object ?? undefined;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 984aacb and aabe8c5.

📒 Files selected for processing (1)
  • src/app/core/models/common/advanced-settings.model.ts (1 hunks)
🔇 Additional comments (1)
src/app/core/models/common/advanced-settings.model.ts (1)

90-93: Memo options filtering logic is correct

The conditional logic properly handles the inclusion of 'card_number' in the memo options based on cccExportType.

@anishfyle anishfyle requested a review from ashwin1111 December 11, 2024 07:12
@anishfyle anishfyle added the deploy Triggers deployment of active branch to Staging label Dec 11, 2024
Copy link

Unit Test Coverage % values
Statements 34.05% ( 4200 / 12334 )
Branches 27.67% ( 1209 / 4369 )
Functions 26.69% ( 922 / 3454 )
Lines 34.21% ( 4132 / 12078 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy Triggers deployment of active branch to Staging size/XS Extra Small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants