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: dynamic content for xero customize settings #1112

Merged
merged 3 commits into from
Dec 12, 2024
Merged

Conversation

NileshPant1999
Copy link
Contributor

@NileshPant1999 NileshPant1999 commented Dec 11, 2024

Description

Please add PR description here, add screenshots if needed

Clickup

https://app.clickup.com/t/

Summary by CodeRabbit

  • New Features

    • Enhanced integration settings for Xero and Sage Intacct, providing new customization options and guidance for users.
    • Added new labels and descriptions for exporting corporate card expenses in the Xero integration.
    • Introduced additional configuration options for expense payment types and vendor settings in Sage Intacct.
  • Bug Fixes

    • Updated HTML templates to use dynamic content for labels and sub-labels, improving consistency with branding configurations.
  • Documentation

    • Improved instructions and clarity for integration setup processes for users.

Copy link
Contributor

coderabbitai bot commented Dec 11, 2024

Walkthrough

The pull request introduces modifications to the configuration objects for various integrations, specifically enhancing the c1Contents, fyleContents, and ContentConfiguration types. Key updates include the addition of new properties and sub-properties for Xero and Sage Intacct integrations, improving the clarity and customization of integration settings. The HTML template for Xero's advanced settings has also been updated to utilize dynamic values from the configuration instead of hardcoded strings, ensuring consistency across the application.

Changes

File Path Change Summary
src/app/branding/c1-contents-config.ts Updated c1Contents with new properties for xero and intacct, enhancing configuration options.
src/app/branding/fyle-contents-config.ts Modified fyleContents to add new fields in advancedSettings for Xero and Sage Intacct.
src/app/core/models/branding/content-configuration.model.ts Expanded ContentConfiguration type with new properties for xero and intacct.
src/app/integrations/xero/xero-shared/xero-advanced-settings/xero-advanced-settings.component.html Updated HTML template to use dynamic labels from brandingContent.

Possibly related PRs

Suggested labels

size/M

Suggested reviewers

  • ashwin1111
  • DhaaraniCIT

Poem

🐇 In the land of code where changes bloom,
New settings sprout, dispelling the gloom.
Xero and Intacct, with labels so bright,
Guiding the users to set up just right.
With templates now dynamic, all text in its place,
Integration's a dance, a smooth, joyful grace! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f158ff and 8c6374f.

📒 Files selected for processing (1)
  • src/app/branding/c1-contents-config.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/app/branding/c1-contents-config.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
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: 1

🧹 Outside diff range and nitpick comments (2)
src/app/branding/c1-contents-config.ts (1)

257-260: Fix trailing comma and approve content

The content strings are well-defined and clear. However, there's a trailing comma that should be removed.

                customPreferencesSubLabel: 'Create new records in Xero if no contacts found or the accounting period is closed.',
                memoStructureLabel: 'Set the line-item description field in Xero',
                memoStructureSubLabel: 'Choose from a list of available data points that you\'d like to export to the description field in Xero.',
-                customizeSectionSubLabel: 'Customize the data that you\'d like to export from Expense Management to Xero by choosing which data points need to be exported.',
+                customizeSectionSubLabel: 'Customize the data that you\'d like to export from Expense Management to Xero by choosing which data points need to be exported.'
🧰 Tools
🪛 eslint

[error] 260-260: Unexpected trailing comma.

(comma-dangle)

🪛 GitHub Check: lint

[failure] 260-260:
Unexpected trailing comma

src/app/branding/fyle-contents-config.ts (1)

253-253: LGTM! Consider refactoring common strings.

The added customization sub-label for Xero integration is well-formatted and consistent with other integration configurations.

Consider extracting common strings and patterns into reusable constants to improve maintainability. For example:

// Constants for common text patterns
const CUSTOMIZE_SECTION_TEXT = {
  prefix: 'In this section, you can customize the data that you\'d like to export from ',
  suffix: '. You can choose what data points need to be exported and what shouldn\'t be.'
};

// Usage in configuration
customizeSectionSubLabel: CUSTOMIZE_SECTION_TEXT.prefix + brandingConfig.brandName + ' to Xero' + CUSTOMIZE_SECTION_TEXT.suffix

This would help:

  1. Reduce duplication across different integration configurations
  2. Make text updates easier to maintain
  3. Ensure consistency in messaging
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 4039a6d and 8f158ff.

📒 Files selected for processing (4)
  • src/app/branding/c1-contents-config.ts (1 hunks)
  • src/app/branding/fyle-contents-config.ts (1 hunks)
  • src/app/core/models/branding/content-configuration.model.ts (1 hunks)
  • src/app/integrations/xero/xero-shared/xero-advanced-settings/xero-advanced-settings.component.html (1 hunks)
🧰 Additional context used
🪛 eslint
src/app/branding/c1-contents-config.ts

[error] 260-260: Unexpected trailing comma.

(comma-dangle)

🪛 GitHub Check: lint
src/app/branding/c1-contents-config.ts

[failure] 260-260:
Unexpected trailing comma

🔇 Additional comments (2)
src/app/integrations/xero/xero-shared/xero-advanced-settings/xero-advanced-settings.component.html (1)

114-115: LGTM: Dynamic content implementation

The implementation correctly uses dynamic content from brandingContent for memo structure labels, improving maintainability and consistency.

src/app/core/models/branding/content-configuration.model.ts (1)

251-253: LGTM: Type definitions for dynamic content

The new string type definitions for memo structure and customization section labels are properly structured and align with the template requirements.

@@ -103,16 +103,16 @@
<div class="tw-mb-16-px">
<app-configuration-step-sub-header
[label]="'Customization'"
[subLabel]="'In this section, you can customize the data that you\'d like to export from ' + brandingConfig.brandName + ' to Xero. You can choose what data points need to be exported and what shouldn\'t be.'">
[subLabel]="brandingContent.customizeSectionSubLAbel">
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix typo in property name

There's a typo in the property name customizeSectionSubLAbel (capital 'A'). This should match the case used in the content configuration.

-    [subLabel]="brandingContent.customizeSectionSubLAbel">
+    [subLabel]="brandingContent.customizeSectionSubLabel">
📝 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.

Suggested change
[subLabel]="brandingContent.customizeSectionSubLAbel">
[subLabel]="brandingContent.customizeSectionSubLabel">

Copy link

Unit Test Coverage % values
Statements 34.04% ( 4199 / 12333 )
Branches 27.58% ( 1205 / 4368 )
Functions 26.69% ( 922 / 3454 )
Lines 34.2% ( 4131 / 12077 )

@NileshPant1999 NileshPant1999 merged commit e29b6a5 into master Dec 12, 2024
4 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 12, 2024
JustARatherRidiculouslyLongUsername added a commit that referenced this pull request Dec 12, 2024
* fix: remove validation temporarily (#1111)

* fix: add a default bank account field for CCC expenses

* fix: add missing options to bank accounts on page init

* fix: dynamic content for xero customize settings (#1112)

* fix: update sublabel key to avoid build fail (#1116)

* fix: Prod fixes of QBD direct (#1118)

* fix bugs (#1119)

* refactor: capitalization

* fix: only ccc exports not being saved (#1121)

---------

Co-authored-by: Ashwin Thanaraj <[email protected]>
Co-authored-by: Nilesh Pant <[email protected]>
Co-authored-by: Dhaarani <[email protected]>
Co-authored-by: Anish Kr Singh <[email protected]>
JustARatherRidiculouslyLongUsername added a commit that referenced this pull request Dec 12, 2024
* fix: restrict JE modules to group by expense only

* fix: add a default bank account field for CCC expenses (#1114)

* fix: remove validation temporarily (#1111)

* fix: add a default bank account field for CCC expenses

* fix: add missing options to bank accounts on page init

* fix: dynamic content for xero customize settings (#1112)

* fix: update sublabel key to avoid build fail (#1116)

* fix: Prod fixes of QBD direct (#1118)

* fix bugs (#1119)

* refactor: capitalization

* fix: only ccc exports not being saved (#1121)

---------

Co-authored-by: Ashwin Thanaraj <[email protected]>
Co-authored-by: Nilesh Pant <[email protected]>
Co-authored-by: Dhaarani <[email protected]>
Co-authored-by: Anish Kr Singh <[email protected]>

---------

Co-authored-by: Ashwin Thanaraj <[email protected]>
Co-authored-by: Nilesh Pant <[email protected]>
Co-authored-by: Dhaarani <[email protected]>
Co-authored-by: Anish Kr Singh <[email protected]>
JustARatherRidiculouslyLongUsername added a commit that referenced this pull request Dec 12, 2024
* fix: initialize chart of accounts multiselect when there is no api response (#1110)

* fix: remove the posted at date option for ccc expenses grouped by report (#1105)

* fix: update login error flow and fix redirect url (#1117)

* fix: restrict JE modules to group by expense only (#1113)

* fix: restrict JE modules to group by expense only

* fix: add a default bank account field for CCC expenses (#1114)

* fix: remove validation temporarily (#1111)

* fix: add a default bank account field for CCC expenses

* fix: add missing options to bank accounts on page init

* fix: dynamic content for xero customize settings (#1112)

* fix: update sublabel key to avoid build fail (#1116)

* fix: Prod fixes of QBD direct (#1118)

* fix bugs (#1119)

* refactor: capitalization

* fix: only ccc exports not being saved (#1121)

---------

Co-authored-by: Ashwin Thanaraj <[email protected]>
Co-authored-by: Nilesh Pant <[email protected]>
Co-authored-by: Dhaarani <[email protected]>
Co-authored-by: Anish Kr Singh <[email protected]>

---------

Co-authored-by: Ashwin Thanaraj <[email protected]>
Co-authored-by: Nilesh Pant <[email protected]>
Co-authored-by: Dhaarani <[email protected]>
Co-authored-by: Anish Kr Singh <[email protected]>

---------

Co-authored-by: Ashwin Thanaraj <[email protected]>
Co-authored-by: Nilesh Pant <[email protected]>
Co-authored-by: Dhaarani <[email protected]>
Co-authored-by: Anish Kr Singh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Extra Small PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants