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

intacct import settings changes #535

Closed
wants to merge 4 commits into from

Conversation

DhaaraniCIT
Copy link
Contributor

@DhaaraniCIT DhaaraniCIT commented Feb 12, 2024

Summary by CodeRabbit

  • New Features

    • Introduced a new category type TAX for enhanced financial categorization.
    • Enhanced the user interface of the Intacct import settings with dynamic content and improved layout.
    • Added new configuration options for Intacct dependent import fields, including a warning system for dependent field configurations.
    • Implemented a preview link feature in configuration step headers for better user guidance.
  • Refactor

    • Streamlined and improved the logic for handling tax import visibility and dependent field warnings in Intacct import settings.
  • Style

    • Updated CSS styling for better alignment, button visibility, and overall user experience across configuration components.
    • Added a new size variant in Tailwind CSS for consistent design scaling.
  • Documentation

    • Commented out and restructured sections for clearer understanding and maintenance of configuration field components.

Copy link
Contributor

coderabbitai bot commented Feb 12, 2024

Important

Auto Review Skipped

Auto reviews are limited to the following labels: review. Please add one of these labels to enable auto reviews.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Walkthrough

This update introduces a new enum value to enhance category destination options, expands the model with additional types for import settings, and restructures the UI for the Intacct import settings component. It involves adjustments in layout, styling, and logic to improve user interface dynamics based on branding, with a focus on tax import visibility and dependent field warnings. Additionally, configuration components see layout and logic enhancements, and a new size variant is added to the Tailwind CSS configuration.

Changes

Files Change Summary
.../enum/enum.model.ts Added TAX to IntacctCategoryDestination enum.
.../intacct-configuration/import-settings.model.ts Added IntacctDependentImportFields type; imported ImportSettingsCustomFieldRow.
.../intacct-shared/intacct-import-settings.component.{html,scss,ts} Restructured UI and logic for dynamic content rendering; adjusted CSS; added and updated methods for handling import settings.
.../configuration/configuration-import-field.component.{html,scss,ts} Adjusted layout, styling, and logic for input fields and add button visibility.
.../configuration/configuration-step-sub-header.component.{html,ts} Updated sub-header styling; added preview link and event emitter for isPreviewClick.
tailwind.config.js Added 560-px size variant (560px).

🐰✨
In code's garden, changes bloom,
Where enums grow and UIs groom.
Tailwind whispers, styles assume,
Across the fields, our updates zoom.
🌼📝 With every push, enhancements loom,
By rabbit's paw, success we presume.
🚀💻

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@DhaaraniCIT
Copy link
Contributor Author

@coderabbitai review

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.

Review Status

Actionable comments generated: 7

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f1e15bc and a712c85.
Files selected for processing (11)
  • src/app/core/models/enum/enum.model.ts (1 hunks)
  • src/app/core/models/intacct/intacct-configuration/import-settings.model.ts (2 hunks)
  • src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.html (1 hunks)
  • src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.scss (1 hunks)
  • src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.ts (8 hunks)
  • src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.html (2 hunks)
  • src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.scss (2 hunks)
  • src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.ts (2 hunks)
  • src/app/shared/components/configuration/configuration-step-sub-header/configuration-step-sub-header.component.html (1 hunks)
  • src/app/shared/components/configuration/configuration-step-sub-header/configuration-step-sub-header.component.ts (2 hunks)
  • tailwind.config.js (1 hunks)
Files skipped from review due to trivial changes (1)
  • tailwind.config.js
Additional comments: 21
src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.scss (2)
  • 1-3: Ensure the use of @apply directive follows Tailwind CSS conventions and check if tw-border-0 is a valid class within your Tailwind configuration.
  • 5-7: Verify that the custom width classes lg:tw-w-600-px and md:tw-w-560-px are defined in your Tailwind configuration, as Tailwind does not include these by default.
src/app/shared/components/configuration/configuration-step-sub-header/configuration-step-sub-header.component.html (1)
  • 5-12: Ensure that the click event handler previewClick() is correctly implemented in the component's TypeScript file and that it emits an event or performs the intended action.
src/app/shared/components/configuration/configuration-step-sub-header/configuration-step-sub-header.component.ts (2)
  • 15-17: Confirm that the isPreviewClick event emitter is correctly handled in the parent component to perform the intended action upon emission.
  • 21-23: Ensure the previewClick method correctly emits the isPreviewClick event without needing additional data. If additional data is required for the event, consider passing it with .emit(data).
src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.scss (2)
  • 66-66: Verify that the padding and layout adjustments in .add-button-container align with the design specifications and do not cause any layout shifts or alignment issues in the UI.
  • 101-103: Ensure that the width adjustments for .inputbox input and .inputbox .p-dropdown are responsive and do not cause overflow or misalignment issues on different screen sizes.
src/app/core/models/intacct/intacct-configuration/import-settings.model.ts (1)
  • 25-30: Confirm that the IntacctDependentImportFields type is correctly utilized in the application and that its structure aligns with the requirements for dependent import fields.
src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.ts (2)
  • 6-6: Confirm that the AppName enum is correctly used within the component and aligns with the application's naming conventions and requirements.
  • 59-59: Ensure that the null check on accountingFieldOptions in the showOrHideAddButton method correctly handles cases where accountingFieldOptions might be undefined or empty.
src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.html (8)
  • 16-26: Verify that the app-configuration-step-sub-header and app-configuration-info-label components are correctly integrated and that their inputs (label, subLabel, infoText, etc.) are properly bound and rendered.
  • 30-35: Ensure that the app-configuration-import-field component is correctly integrated with the importSettingsForm, and verify that the component's inputs and event handlers are properly configured.
  • 38-39: Confirm that the conditional class longerDropDown is correctly applied based on the importSettingsForm.value?.importTaxCodes and isImportTaxVisible conditions, and ensure it does not cause layout issues.
  • 43-53: Verify the integration of app-configuration-step-sub-header and app-configuration-info-label components for the second section, ensuring that dynamic content based on brandingConfig.brandName is correctly rendered.
  • 57-67: Ensure that the app-configuration-import-field component is correctly integrated for the second section, with all necessary inputs and event handlers properly configured, especially the dynamic inputs like costCategoryOption and dependentDestinationValue.
  • 71-80: Confirm that the app-configuration-step-footer and app-configuration-custom-field-creation-dialog components are correctly integrated, with all inputs, outputs, and conditional rendering logic properly configured.
  • 85-91: Ensure that the app-configuration-confirmation-dialog component is correctly integrated, with the event handler and dynamic content based on brandingConfig.brandName properly configured.
  • 94-100: Verify that the app-preview-dialog component is correctly integrated, with visibility controlled by isDialogVisible and isPreviewDialogVisible, and ensure that the dialog's content and event handlers are properly configured.
src/app/core/models/enum/enum.model.ts (1)
  • 10-11: Confirm that the addition of the TAX value to the IntacctCategoryDestination enum aligns with the application's requirements for handling tax-related data and is correctly utilized where needed.
src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.html (1)
  • 12-196: Ensure dynamic content rendering and conditional display logic align with the new UI requirements and branding configurations.
src/app/integrations/intacct/intacct-shared/intacct-import-settings/intacct-import-settings.component.ts (1)
  • 92-118: Ensure the defaultImportFields and dependentImportFields arrays are correctly initialized and used, aligning with the new import settings functionality.

Comment on lines 1 to 5
<div [formGroup]="form">
<div *ngIf="!isDestinationFixedImport && !isCloneSettingView" class="fields-header" fxLayout="row" fxLayoutAlign="start center">
<!-- <div *ngIf="!isDestinationFixedImport && !isCloneSettingView" class="fields-header" fxLayout="row" fxLayoutAlign="start center">
<div class="fields-header-text tw-pl-48-px tw-w-450-px">{{appName}} Dimensions</div>
<div class="fields-header-text tw-w-30-vw">{{brandingConfig.brandName}} Fields</div>
<div class="fields-header-text tw-flex tw-w-[10vw] tw-whitespace-nowrap">
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [2-11]

Commented-out code should be removed if it's no longer needed to keep the codebase clean.

<div *ngIf="i===0" class="tw-text-16-px tw-font-500 tw-text-normal-text-color tw-mb-18-px">
<p>{{appName}} Dimensions</p>
</div>
<input type="text" class="tw-text-14-px tw-text-text-secondary !tw-font-500 !tw-px-14-px !tw-py-10-px tw-border tw-border-solid !tw-border-separator tw-rounded-4-px" value="{{ defaultField.destination_field | snakeCaseToSpaceCase | titlecase }}" disabled>
Copy link
Contributor

Choose a reason for hiding this comment

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

All icons should have a standard size of 24*24 strictly. The icon size here does not comply.

- [width]="'16px'" [height]="'16px'"
+ [width]="'24px'" [height]="'24px'"

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.

Suggested change
<input type="text" class="tw-text-14-px tw-text-text-secondary !tw-font-500 !tw-px-14-px !tw-py-10-px tw-border tw-border-solid !tw-border-separator tw-rounded-4-px" value="{{ defaultField.destination_field | snakeCaseToSpaceCase | titlecase }}" disabled>
<input type="text" class="tw-text-14-px tw-text-text-secondary !tw-font-500 !tw-px-14-px !tw-py-10-px tw-border tw-border-solid !tw-border-separator tw-rounded-4-px" value="{{ defaultField.destination_field | snakeCaseToSpaceCase | titlecase }}" disabled>

Comment on lines +186 to +188
<div class="tw-text-alert-toast tw-pt-4 tw-pl-1" *ngIf="form.get('expenseFields')?.hasError('duplicatefyleFieldOptions') || form.get('expenseFields')?.hasError('duplicateaccountingFieldOptions')">
*{{brandingConfig.brandName}} and {{appName}} Fields should be unique.
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Error messages should be handled and displayed programmatically rather than hardcoding the message in the template.

Comment on lines +136 to +138
showWarningForDependentFields(): void {
this.showDependentFieldWarning = true;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The showWarningForDependentFields method appears redundant or is not fully implemented. Verify its necessity or complete its implementation.

Comment on lines +173 to +175
closeDialog() {
this.isDialogVisible = false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a method or service for dialog visibility management to encapsulate the logic and improve maintainability.

Comment on lines +513 to +521
this.isImportTaxVisible = true;
if (this.isImportTaxVisible) {
const data = {
source_field: MappingSourceField.TAX_GROUP,
destination_field: IntacctCategoryDestination.TAX,
formController: 'importTaxCodes'
};
this.defaultImportFields.push(data);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a conditionally pushed object to defaultImportFields inside ngOnInit or similar lifecycle methods can lead to unintended side effects on component re-initialization. Consider moving this logic to a more controlled environment or ensuring idempotency.

Comment on lines +572 to +574
acceptDependentFieldWarning(data: ConfigurationWarningOut): void {
this.showDependentFieldWarning = false;
if (!isWarningAccepted) {
if (!data.hasAccepted) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The handling of data.hasAccepted in acceptDependentFieldWarning seems to lack validation or error handling for when data is not as expected. Ensure robustness in data handling.

<div class="tw-mb-24-px tw-rounded-lg tw-border-separator tw-border tw-bg-configuration-bg">
<app-configuration-step-sub-header
[label]="'Import Sage Intacct Dimensions'"
[subLabel]="'The Sage Intacct dimensions listed below will be mapped to their corresponding Fyle Field as shown below. Importing these dimensions from Sage Intacct to Fyle will make the values available as a dropdown in the expense form for your employees to choose from.'"
Copy link
Contributor

Choose a reason for hiding this comment

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

don't hard code "Fyle", @coderabbitai why is this not detected in your review?

Copy link
Contributor

Choose a reason for hiding this comment

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

@ashwin1111, the search has identified several instances across the project where "Fyle" is hardcoded within HTML files. These instances should be replaced with {{brandingConfig.brandName}} or an equivalent dynamic reference to adhere to the white-labeling requirements. Here are a few examples of where changes are needed:

  1. In generic-mapping-table.component.html:
<th class="!tw-pl-40-px">{{sourceField | snakeCaseToSpaceCase | titlecase}} in Fyle</th>
  1. In export-log-dialog/export-log-child-table-dialog.component.html:
<td class="tw-underline tw-cursor-pointer" (click)="openExpenseinFyle(rowData.expense_id, rowData.org_id)">{{expense.expense_number}}</td>
  1. In configuration-import-field.component.html:
<p class="tw-mb-8-px tw-text-14-px tw-text-sub-text-color !tw-font-400">Fyle Field <app-mandatory-field></app-mandatory-field> </p>

And several others across different components and integration settings. Each of these instances needs to be reviewed and updated to ensure the application fully supports white-labeling by dynamically referencing the brand name from the configuration.

Would you like guidance on how to proceed with these updates, or is there anything else I can assist you with?

Analysis chain

@ashwin1111, you're absolutely right, and I apologize for missing that. The hardcoded "Fyle" should indeed be replaced with brandingConfig.brandName to adhere to the white-labeling requirements. For the specific instance you pointed out, the correction would look like this:

- Importing these dimensions from Sage Intacct to Fyle will make the values available as a dropdown in the expense form for your employees to choose from.
+ Importing these dimensions from Sage Intacct to {{brandingConfig.brandName}} will make the values available as a dropdown in the expense form for your employees to choose from.

To ensure there are no other instances of this issue across the project, I recommend running a comprehensive search. Would you like me to perform this search for you?

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for hardcoded "Fyle" in all HTML files within the project.
rg 'Fyle' --glob '*.html'

Length of output: 3514

Copy link
Contributor

Choose a reason for hiding this comment

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

yes would like a guidance

Copy link
Contributor

Choose a reason for hiding this comment

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

@ashwin1111, to replace hardcoded "Fyle" instances with {{brandingConfig.brandName}} in HTML files, you can follow these steps:

  1. Identify Hardcoded Instances: Use ripgrep (rg) to search for "Fyle" in all HTML files. If you don't have ripgrep, you can use grep. Here's how you can do it with ripgrep:

    rg 'Fyle' --glob '*.html'

    This command will list all occurrences of "Fyle" in HTML files, along with their file paths.

  2. Review Each Instance: Before replacing, review each instance to ensure that replacing "Fyle" with {{brandingConfig.brandName}} is contextually appropriate. Some instances might be part of URLs, comments, or other places where a direct replacement might not be suitable.

  3. Replace Instances: Once you've identified the correct instances to replace, you can use the sed command for in-place replacement. Here's an example command to replace "Fyle" with {{brandingConfig.brandName}} in a specific file:

    sed -i 's/Fyle/{{brandingConfig.brandName}}/g' path/to/file.html

    Note: -i option is used for in-place editing. Please make sure to backup your files before running this command, as it makes direct changes to the files.

  4. Automate for Multiple Files: If there are many files to update, you can combine find or rg with xargs to apply the sed command across multiple files. Here's an example using find:

    find . -name '*.html' | xargs sed -i 's/Fyle/{{brandingConfig.brandName}}/g'

    This command finds all HTML files and replaces "Fyle" with {{brandingConfig.brandName}} in each file.

  5. Review Changes: After running the replacement commands, review the changes to ensure that all replacements are correct and no instances are missed.

  6. Test: Finally, test your application to ensure that the dynamic branding works as expected and that there are no issues caused by the replacements.

Please ensure you have appropriate backups and have tested these commands in a safe environment before running them on your actual project files. Let me know if you need further assistance!

@@ -1,5 +1,5 @@
<div [formGroup]="form">
<div *ngIf="!isDestinationFixedImport && !isCloneSettingView" class="fields-header" fxLayout="row" fxLayoutAlign="start center">
<!-- <div *ngIf="!isDestinationFixedImport && !isCloneSettingView" class="fields-header" fxLayout="row" fxLayoutAlign="start center">
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this commented out?

Add more fields
</a>
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

lot of things are changed in this file, pls test out QBO, QBO - Clone setting, Dynamics, Sage 300 and Intacct

<h5 class="tw-text-faded-text-color tw-text-14-px tw-pt-8-px !tw-font-400 tw-w-600-px tw-text-pretty">
{{subLabel}}
<div *ngIf="showPreview" class="tw-inline-flex">
<a class="tw-text-hyperlink-color tw-pr-4-px tw-w-fit tw-cursor-pointer" (click)="previewClick()">
Copy link
Contributor

Choose a reason for hiding this comment

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

tw-text-link-primary instead of hyperlink-color

@@ -2,7 +2,13 @@
<h4 class="tw-text-text-primary tw-font-500">
{{label}}
</h4>
<h5 class="tw-text-text-muted tw-text-14-px tw-pt-8-px !tw-font-400">
{{subLabel}}
<h5 class="tw-text-faded-text-color tw-text-14-px tw-pt-8-px !tw-font-400 tw-w-600-px tw-text-pretty">
Copy link
Contributor

Choose a reason for hiding this comment

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

tw-text-text-muted instead of faded-text-color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants