-
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
intacct import settings changes #535
Conversation
Important Auto Review SkippedAuto 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 To trigger a single review, invoke the WalkthroughThis 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
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
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.
Review Status
Actionable comments generated: 7
Configuration used: CodeRabbit UI
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 iftw-border-0
is a valid class within your Tailwind configuration.- 5-7: Verify that the custom width classes
lg:tw-w-600-px
andmd: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 handlerpreviewClick()
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 theisPreviewClick
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 theshowOrHideAddButton
method correctly handles cases whereaccountingFieldOptions
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
andapp-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 theimportSettingsForm
, 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 theimportSettingsForm.value?.importTaxCodes
andisImportTaxVisible
conditions, and ensure it does not cause layout issues.- 43-53: Verify the integration of
app-configuration-step-sub-header
andapp-configuration-info-label
components for the second section, ensuring that dynamic content based onbrandingConfig.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 likecostCategoryOption
anddependentDestinationValue
.- 71-80: Confirm that the
app-configuration-step-footer
andapp-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 onbrandingConfig.brandName
properly configured.- 94-100: Verify that the
app-preview-dialog
component is correctly integrated, with visibility controlled byisDialogVisible
andisPreviewDialogVisible
, 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 theIntacctCategoryDestination
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
anddependentImportFields
arrays are correctly initialized and used, aligning with the new import settings functionality.
<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"> |
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.
📝 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> |
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.
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.
<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> |
<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> |
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.
Error messages should be handled and displayed programmatically rather than hardcoding the message in the template.
showWarningForDependentFields(): void { | ||
this.showDependentFieldWarning = true; | ||
} |
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.
The showWarningForDependentFields
method appears redundant or is not fully implemented. Verify its necessity or complete its implementation.
closeDialog() { | ||
this.isDialogVisible = false; | ||
} |
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.
Use a method or service for dialog visibility management to encapsulate the logic and improve maintainability.
this.isImportTaxVisible = true; | ||
if (this.isImportTaxVisible) { | ||
const data = { | ||
source_field: MappingSourceField.TAX_GROUP, | ||
destination_field: IntacctCategoryDestination.TAX, | ||
formController: 'importTaxCodes' | ||
}; | ||
this.defaultImportFields.push(data); | ||
} |
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.
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.
acceptDependentFieldWarning(data: ConfigurationWarningOut): void { | ||
this.showDependentFieldWarning = false; | ||
if (!isWarningAccepted) { | ||
if (!data.hasAccepted) { |
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.
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.'" |
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.
don't hard code "Fyle", @coderabbitai why is this not detected in your review?
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.
@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:
- In
generic-mapping-table.component.html
:
<th class="!tw-pl-40-px">{{sourceField | snakeCaseToSpaceCase | titlecase}} in Fyle</th>
- 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>
- 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
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.
yes would like a guidance
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.
@ashwin1111, to replace hardcoded "Fyle" instances with {{brandingConfig.brandName}}
in HTML files, you can follow these steps:
-
Identify Hardcoded Instances: Use
ripgrep
(rg) to search for "Fyle" in all HTML files. If you don't haveripgrep
, you can usegrep
. Here's how you can do it withripgrep
:rg 'Fyle' --glob '*.html'
This command will list all occurrences of "Fyle" in HTML files, along with their file paths.
-
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. -
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. -
Automate for Multiple Files: If there are many files to update, you can combine
find
orrg
withxargs
to apply thesed
command across multiple files. Here's an example usingfind
: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. -
Review Changes: After running the replacement commands, review the changes to ensure that all replacements are correct and no instances are missed.
-
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"> |
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.
why is this commented out?
Add more fields | ||
</a> | ||
</div> | ||
</div> |
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.
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()"> |
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.
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"> |
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.
tw-text-text-muted instead of faded-text-color
Summary by CodeRabbit
New Features
TAX
for enhanced financial categorization.Refactor
Style
Documentation