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: QBD direct bug fixes #1101

Merged
merged 10 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/branding/c1-contents-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const c1Contents = {
},
connector: {
configurationHeaderText: 'Connect to QuickBooks Desktop',
configurationSubHeaderText: 'Connect to QuickBooks desktop by completing the following steps.',
configurationSubHeaderText: 'Connect to QuickBooks Desktop by completing the following steps.',
stepName: 'Connect to QuickBooks Desktop',
subLabel: 'Provide your credentials to establish a secure connection between your Expense Management and NetSuite account'
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/branding/fyle-branding-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,6 @@ export const fyleDemoVideoLinks: DemoVideo[string] = {
TRAVELPERK: 'https://www.youtube.com/embed/2oYdc8KcQnk',
XERO: 'https://www.youtube.com/embed/IplJd7tGWBk',
NETSUITE: 'https://www.youtube.com/embed/wQXQYTLsVH8',
QBD_DIRECT: 'https://www.youtube.com/embed/wQXQYTLsVH8'
QBD_DIRECT: 'https://www.youtube.com/embed/b63lS2DG5j4'
}
};
4 changes: 2 additions & 2 deletions src/app/branding/fyle-contents-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ export const fyleContents = {
configurationSubHeaderText: 'Begin your QuickBooks integration by completing the following steps.'
},
connector: {
configurationHeaderText: 'Connect to QuickBooks desktop',
configurationSubHeaderText: 'Connect to QuickBooks desktop by completing the following steps.',
configurationHeaderText: 'Connect to QuickBooks Desktop',
configurationSubHeaderText: 'Connect to QuickBooks Desktop by completing the following steps.',
stepName: 'Connect to QuickBooks Desktop',
subLabel: 'Expenses will be posted to the NetSuite Tenant Mapping selected here. Once configured, you can not change ' + brandingConfig.brandName + ' organization or Tenant Mapping.'
},
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/models/common/advanced-settings.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class AdvancedSettingsModel {
merchant: 'Pizza Hut',
report_number: 'C/2021/12/R/1',
spent_on: today.toLocaleDateString(),
expense_key: 'txDdlUFWkahX',
expense_key: 'E/2024/02/T/11',
expense_link: `${environment.fyle_app_url}/app/main/#/enterprise/view_expense/`
};
let memoPreviewText = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type QbdDirectAdvancedSettingsPost = {
emails_added: EmailOption[],
interval_hours: number,
auto_create_merchant_as_vendor: boolean
auto_create_reimbursable_enitity: boolean,
auto_create_reimbursable_entity: boolean,
}

export interface QbdDirectAdvancedSettingsGet extends QbdDirectAdvancedSettingsPost {
Expand Down Expand Up @@ -56,7 +56,7 @@ export class QbdDirectAdvancedSettingsModel extends AdvancedSettingsModel {
exportSchedule: new FormControl(advancedSettings?.schedule_is_enabled ? advancedSettings?.schedule_is_enabled : false),
email: new FormControl(advancedSettings?.emails_selected ? advancedSettings?.emails_selected : null),
exportScheduleFrequency: new FormControl(advancedSettings?.schedule_is_enabled ? advancedSettings?.interval_hours : 1),
autoCreateReimbursableEnitity: new FormControl(advancedSettings?.auto_create_reimbursable_enitity ? advancedSettings?.auto_create_reimbursable_enitity : false),
autoCreateReimbursableEnitity: new FormControl(advancedSettings?.auto_create_reimbursable_entity ? advancedSettings?.auto_create_reimbursable_entity : false),
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 form control name to match type definition

The form control name uses the misspelled version autoCreateReimbursableEnitity while accessing a correctly spelled property from the API response.

Apply this fix:

-            autoCreateReimbursableEnitity: new FormControl(advancedSettings?.auto_create_reimbursable_entity ? advancedSettings?.auto_create_reimbursable_entity : false),
+            autoCreateReimbursableEntity: new FormControl(advancedSettings?.auto_create_reimbursable_entity ? advancedSettings?.auto_create_reimbursable_entity : false),
📝 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
autoCreateReimbursableEnitity: new FormControl(advancedSettings?.auto_create_reimbursable_entity ? advancedSettings?.auto_create_reimbursable_entity : false),
autoCreateReimbursableEntity: new FormControl(advancedSettings?.auto_create_reimbursable_entity ? advancedSettings?.auto_create_reimbursable_entity : false),

autoCreateMerchantsAsVendors: new FormControl(advancedSettings?.auto_create_merchant_as_vendor ? advancedSettings?.auto_create_merchant_as_vendor : false),
skipExport: new FormControl(isSkipExportEnabled),
searchOption: new FormControl('')
Expand All @@ -79,7 +79,7 @@ export class QbdDirectAdvancedSettingsModel extends AdvancedSettingsModel {
schedule_is_enabled: advancedSettingForm.get('exportSchedule')?.value ? advancedSettingForm.get('exportSchedule')?.value : false,
emails_selected: advancedSettingForm.get('exportSchedule')?.value ? selectedEmailsEmails : [],
interval_hours: advancedSettingForm.get('exportSchedule')?.value ? advancedSettingForm.get('exportScheduleFrequency')?.value : null,
auto_create_reimbursable_enitity: advancedSettingForm.get('autoCreateReimbursableEnitity')?.value ? advancedSettingForm.get('autoCreateReimbursableEnitity')?.value : false,
auto_create_reimbursable_entity: advancedSettingForm.get('autoCreateReimbursableEnitity')?.value ? advancedSettingForm.get('autoCreateReimbursableEnitity')?.value : false,
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 form control access in payload construction

The payload construction attempts to access the misspelled form control while assigning to the correctly spelled property.

Apply this fix:

-            auto_create_reimbursable_entity: advancedSettingForm.get('autoCreateReimbursableEnitity')?.value ? advancedSettingForm.get('autoCreateReimbursableEnitity')?.value : false,
+            auto_create_reimbursable_entity: advancedSettingForm.get('autoCreateReimbursableEntity')?.value ? advancedSettingForm.get('autoCreateReimbursableEntity')?.value : false,
📝 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
auto_create_reimbursable_entity: advancedSettingForm.get('autoCreateReimbursableEnitity')?.value ? advancedSettingForm.get('autoCreateReimbursableEnitity')?.value : false,
auto_create_reimbursable_entity: advancedSettingForm.get('autoCreateReimbursableEntity')?.value ? advancedSettingForm.get('autoCreateReimbursableEntity')?.value : false,

auto_create_merchant_as_vendor: advancedSettingForm.get('autoCreateMerchantsAsVendors')?.value ? advancedSettingForm.get('autoCreateMerchantsAsVendors')?.value : false,
emails_added: advancedSettingForm.get('exportSchedule')?.value ? additionalEmails : []
};
Expand Down
6 changes: 3 additions & 3 deletions src/app/core/services/common/dashboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export class DashboardService {
return this.apiService.post(url, {});
}

getExportErrors(version?: string | 'v1', appName?: string): Observable<any> {
if (!appName && version === 'v1') {
getExportErrors(version?: string | 'v1'): Observable<any> {
if (version === 'v1') {
return this.apiService.get(`/v2/workspaces/${this.workspaceId}/errors/`, {is_resolved: false});
} else if (appName === AppName.QBD_DIRECT) {
} else if (version === AppName.QBD_DIRECT) {
return this.apiService.get(`/workspaces/${this.workspaceId}/export_logs/errors/`, {is_resolved: false});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class QbdDirectDashboardComponent implements OnInit {
[AccountingErrorType.CATEGORY_MAPPING]: null
};

getExportErrors$: Observable<ErrorResponse> = this.dashboardService.getExportErrors(undefined, AppName.QBD_DIRECT);
getExportErrors$: Observable<ErrorResponse> = this.dashboardService.getExportErrors(AppName.QBD_DIRECT);

getAccountingExportSummary$: Observable<AccountingExportSummary> = this.accountingExportService.getAccountingExportSummary(AppName.QBD_DIRECT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
[appName]="AppName.QBD_DIRECT"
[isCategoryMappingGeneric]="sourceField === FyleField.CATEGORY ? true : false"
[displayName]="displayName"
[detailAccountType] = "detailAccountType"
[isMultiLineOption]="sourceField === FyleField.CATEGORY && brandingConfig.brandId !== 'co' ? true : false">
</app-generic-mapping-v2>
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ export class QbdDirectBaseMappingComponent implements OnInit {

chartOfAccounts: string[];

detailAccountType: string[] | undefined;

constructor(
private route: ActivatedRoute,
private mappingService: MappingService,
Expand All @@ -72,6 +74,7 @@ export class QbdDirectBaseMappingComponent implements OnInit {
}

destinationOptionsWatcher(detailAccountType?: string[]): void {
this.detailAccountType = detailAccountType;
this.mappingService.getPaginatedDestinationAttributes(this.destinationField, undefined, this.displayName, '', detailAccountType).subscribe((responses) => {
this.destinationOptions = responses.results as QbdDirectDestinationAttribute[];
this.isLoading = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div>
<div>
<app-landing-page-header [buttonText]="'Start'" [iconPath]="'assets/logos/qbo.png'" [appName]="'QuickBooks Desktop - Direct Integration'" [appDescription]="brandingContent.contentText" [isConnectionInProgress]="isQbdConnectionInProgress" [isLoading]="false" [isIntegrationConnected]="false" [redirectLink]="redirectLink" (connectIntegration)="connectQbdDirect()" [logoStyleClasses]="'tw-p-16-px'"></app-landing-page-header>
<app-landing-page-header [buttonText]="'Start'" [iconPath]="'assets/logos/qbo.png'" [appName]="'QuickBooks Desktop '" [appDescription]="brandingContent.contentText" [isConnectionInProgress]="isQbdConnectionInProgress" [isLoading]="false" [isIntegrationConnected]="false" [redirectLink]="redirectLink" (connectIntegration)="connectQbdDirect()" [logoStyleClasses]="'tw-p-16-px'"></app-landing-page-header>
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Based on the search results, I can now generate the final response:

Remove trailing space from QuickBooks Desktop string

The trailing space in 'QuickBooks Desktop ' is indeed problematic as it's being used inconsistently across the codebase:

  • Most occurrences use 'QuickBooks Desktop' (without space)
  • Only the landing page header component has special handling with .includes('QuickBooks Desktop ')
  • This inconsistency could lead to bugs if the string comparison logic changes

The proper fix would be to:

  1. Remove the trailing space from qbd-direct-onboarding-landing.component.html
  2. Update the condition in app-landing-page-header.component.ts to use exact string comparison instead of includes()
🔗 Analysis chain

Verify the impact of appName change

The appName has been changed to 'QuickBooks Desktop ' to match the new condition checks. However:

  1. The trailing space in the string seems like a fragile solution
  2. This change should be verified across all QBD integration flows
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other instances of QuickBooks Desktop string to ensure consistency
rg -l "QuickBooks Desktop" | while read -r file; do
  echo "=== $file ==="
  rg "QuickBooks Desktop" "$file"
done

Length of output: 25142

</div>
<div>
<app-landing-page-body [headlineText]="brandingContent.guideHeaderText" [headerText]="'A quick guide to help you set up your Fyle-QuickBooks Desktop integration.'" [embedVideo]="embedVideoLink" [embedImage]="'assets/co/coQBOLanding.svg'" [svgPath]="'assets/flow-charts/' + brandingConfig.brandId +'-qbd-direct-flow-chart.svg'" [appName]="appName" [redirectLink]="redirectLink"></app-landing-page-body>
<app-landing-page-body [headlineText]="brandingContent.guideHeaderText" [headerText]="'A quick guide to help you set up your Fyle-QuickBooks Desktop integration.'" [embedVideo]="embedVideoLink" [embedImage]="'assets/co/coQBOLanding.svg'" [svgPath]="'assets/flow-charts/' + brandingConfig.brandId +'-qbd-direct-flow-chart.svg'" [appName]="appName"></app-landing-page-body>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@
(searchOptionsDropdown)="searchOptionsDropdown($event)"
[optionLabel]="'value'"
[isFieldMandatory]="true"
[mandatoryErrorListName]="'accounts payable'"
Copy link
Contributor

Choose a reason for hiding this comment

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

same

[mandatoryErrorListName]="'a default credit account'"
[label]="brandingContent.corporateCard.defaultCCCAccountPayableLabel + (exportSettingsForm.get('creditCardExportType')?.value | snakeCaseToSpaceCase | titlecase)"
[subLabel]="brandingContent.corporateCard.defaultCCCAccountPayableSubLabel + (exportSettingsForm.get('creditCardExportType')?.value | snakeCaseToSpaceCase | titlecase) + ' ,while debit lines will reflect the category chosen by the employee for each respective expense'"
[iconPath]="'list'"
[placeholder]="'Select accounts payable'"
Copy link
Contributor

Choose a reason for hiding this comment

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

same

[placeholder]="'Select default account'"
[isMultiLineOption]="true"
[formControllerName]="'defaultCCCAccountsPayableAccountName'">
</app-configuration-select-field>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ <h5 class="!tw-text-text-muted tw-text-14-px tw-pt-10-px !tw-font-400 !tw-leadin
<h4 class="tw-text-14-px !tw-font-500 tw-text-text-secondary tw-w-600-px">{{ error.error_title | snakeCaseToSpaceCase | titlecase }}</h4>
<div class="flex-wrapper">
<h5 class="!tw-text-text-muted tw-text-12-px tw-pt-10-px !tw-font-400 !tw-leading-4 tw-w-600-px tw-flex tw-items-center tw-justify-start">
<p>{{ error.error_detail }}.
<p>{{ error.error_detail }}
<a *ngIf="error.article_link && brandingFeatureConfig.allowIntacctHelperDoc" class=" tw-pr-4-px tw-text-link-primary tw-w-fit tw-cursor-pointer tw-inline-flex tw-items-center"
(click)="windowService.openInNewTab(error.article_link)">
{{ helper.sentenseCaseConversion('Read More') }}
Expand Down Expand Up @@ -135,6 +135,6 @@ <h3 class="dialog-sub-header">
<p class="tw-text-text-primary tw-text-20-px tw-line-height-20">{{ brandingConfig.brandId === 'co' ? (errorType | snakeCaseToSpaceCase | sentenceCase) : (errorType | snakeCaseToSpaceCase | titlecase) }} {{brandingContentCommon.errors}}</p>
<p class="dialog-sub-header">Resolve the following mapping errors to export your failed expenses successfully to {{uiExposedAppName}}</p>
</p-header>
<app-generic-mapping-table *ngIf="isMappingResolveVisible && !isLoading" [employeeFieldMapping]="employeeFieldMapping" [isLoading]="isLoading" [appName]="appName" [isDashboardMappingResolve]="true" [destinationField]="destinationField" [filteredMappings]="filteredMappings" [sourceField]="sourceField" [destinationOptions]="destinationOptions" [displayName]="displayName" [isMultiLineOption]="isMultiLineOption"></app-generic-mapping-table>
<app-generic-mapping-table *ngIf="isMappingResolveVisible && !isLoading" [employeeFieldMapping]="employeeFieldMapping" [isLoading]="isLoading" [appName]="appName" [isDashboardMappingResolve]="true" [destinationField]="destinationField" [filteredMappings]="filteredMappings" [sourceField]="sourceField" [destinationOptions]="destinationOptions" [displayName]="displayName" [isMultiLineOption]="isMultiLineOption" [detailAccountType]="detailAccountType"></app-generic-mapping-table>
</p-dialog>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export class DashboardErrorSectionComponent implements OnInit {

isMultiLineOption: boolean;

detailAccountType: string[] | undefined;

constructor(
private dashboardService: DashboardService,
private mappingService: MappingService,
Expand Down Expand Up @@ -147,10 +149,12 @@ export class DashboardErrorSectionComponent implements OnInit {
this.mappingService.getGroupedDestinationAttributes([this.destinationField], 'v2').subscribe(groupedDestinationResponse => {
if (this.sourceField === 'EMPLOYEE') {
this.destinationOptions = this.destinationField === FyleField.EMPLOYEE ? groupedDestinationResponse.EMPLOYEE : groupedDestinationResponse.VENDOR;
this.detailAccountType = undefined;
} else if (this.sourceField === 'CATEGORY') {
if (this.destinationField === 'EXPENSE_TYPE') {
this.destinationOptions = groupedDestinationResponse.EXPENSE_TYPE;
} else {
this.detailAccountType = this.chartOfAccounts;
this.destinationOptions = this.appName !== AppName.QBD_DIRECT ? groupedDestinationResponse.ACCOUNT : this.destinationOptionsWatcher( this.chartOfAccounts, groupedDestinationResponse.ACCOUNT as QbdDirectDestinationAttribute[]);
}
}
Expand Down Expand Up @@ -212,8 +216,9 @@ export class DashboardErrorSectionComponent implements OnInit {
}

handleResolvedMappingStat(): void {
this.dashboardService.getExportErrors(this.errorsVersion, this.appName).subscribe((errors) => {
const argument = this.errorsVersion === 'v1' ? errors : (errors as ErrorResponse).results;
const errorVersion = this.appName === AppName.QBD_DIRECT ? this.appName : this.errorsVersion;
this.dashboardService.getExportErrors(errorVersion).subscribe((errors) => {
const argument = errorVersion === 'v1' ? errors : (errors as ErrorResponse).results;
Comment on lines +219 to +221
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

Add error handling for export errors retrieval.

The service call to getExportErrors lacks error handling, which could lead to unhandled exceptions.

-    this.dashboardService.getExportErrors(errorVersion).subscribe((errors) => {
+    this.dashboardService.getExportErrors(errorVersion).subscribe({
+      next: (errors) => {
       const argument = errorVersion === 'v1' ? errors : (errors as ErrorResponse).results;
       const newError: AccountingGroupedErrors = this.formatErrors(argument);
+      },
+      error: (error) => {
+        console.error('Failed to fetch export errors:', error);
+        // Consider showing an error message to the user
+      }
+    });

Committable suggestion skipped: line range outside the PR's diff.

const newError: AccountingGroupedErrors = this.formatErrors(argument);

if (this.errors.CATEGORY_MAPPING.length !== newError.CATEGORY_MAPPING.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
<button *ngIf="isIntegrationConnected && (appName === AppName.BAMBOO_HR || appName === AppName.TRAVELPERK)" pButton type="button" class="p-button danger-outline" (click)="disconnect()">
{{ isConnectionInProgress ? 'Disconnecting' : 'Disconnect' }}
</button>
<button *ngIf="!isIntegrationConnected && (appName === AppName.QBD || appName === AppName.NETSUITE || appName === AppName.INTACCT || appName === AppName.SAGE300 || appName === AppName.BUSINESS_CENTRAL || appName.includes('QuickBooks Desktop - Direct Integration'))" pButton type="button" class="p-button-raised" (click)="connect()">
<button *ngIf="!isIntegrationConnected && (appName === AppName.QBD || appName === AppName.NETSUITE || appName === AppName.INTACCT || appName === AppName.SAGE300 || appName === AppName.BUSINESS_CENTRAL || appName.includes('QuickBooks Desktop '))" pButton type="button" class="p-button-raised" (click)="connect()">
{{buttonText}}
<app-svg-icon *ngIf="(appName === AppName.QBD || appName.includes('QuickBooks Desktop - Direct Integration')) && brandingFeatureConfig.isIconsInsideButtonAllowed" [svgSource]="'arrow-tail-right-medium'" [width]="'18px'" [height]="'18px'" [styleClasses]="'tw-pl-10-px tw-pt-2-px !tw-text-12-px'"></app-svg-icon>
<app-svg-icon *ngIf="(appName === AppName.QBD || appName.includes('QuickBooks Desktop ')) && brandingFeatureConfig.isIconsInsideButtonAllowed" [svgSource]="'arrow-tail-right-medium'" [width]="'18px'" [height]="'18px'" [styleClasses]="'tw-pl-10-px tw-pt-2-px !tw-text-12-px'"></app-svg-icon>
<app-loader class="tw-ml-10-px" *ngIf="isConnectionInProgress" [styleClass]="'spinner-16-white tw-top-2-px'"></app-loader>
</button>
<iframe *ngIf="iframeSourceUrl && (appName === AppName.TRAVELPERK)" scrolling="no" [src]="iframeSourceUrl" class="tw-mt-40-px tw-w-270-px tw-h-84-px"></iframe>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class AppLandingPageHeaderComponent implements OnInit {
}

connect(): void {
if (this.appName === AppName.TRAVELPERK || this.appName === AppName.BUSINESS_CENTRAL || this.appName === AppName.BAMBOO_HR || this.appName === AppName.XERO || this.appName.includes('QuickBooks Desktop - Direct Integration')) {
if (this.appName === AppName.TRAVELPERK || this.appName === AppName.BUSINESS_CENTRAL || this.appName === AppName.BAMBOO_HR || this.appName === AppName.XERO || this.appName.includes('QuickBooks Desktop ')) {
this.initiateOAuth();
return;
} else if (this.postConnectionRoute === 'qbd/onboarding/export_settings') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export class GenericMappingTableComponent implements OnInit {

@Input() isMultiLineOption: boolean = false;

@Input() detailAccountType: string[] | undefined;

private searchSubject = new Subject<string>();

searchQuery: string;
Expand Down Expand Up @@ -134,7 +136,7 @@ export class GenericMappingTableComponent implements OnInit {
const existingOptions = this.destinationOptions.concat();
const newOptions: DestinationAttribute[] = [];

this.mappingService.getPaginatedDestinationAttributes(this.destinationField, event.searchTerm, this.displayName, this.appName).subscribe((response) => {
this.mappingService.getPaginatedDestinationAttributes(this.destinationField, event.searchTerm, this.displayName, this.appName, this.detailAccountType).subscribe((response) => {
response.results.forEach((option) => {
// If option is not already present in the list, add it
if (!this.optionsMap[option.id.toString()]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</div>
<div *ngIf="!isLoading">
<div *ngIf="filteredMappingCount">
<app-generic-mapping-table [isLoading]="isLoading" [appName]="appName" [isDashboardMappingResolve]="false" [destinationField]="destinationField" [filteredMappings]="filteredMappings" [sourceField]="sourceField" [mappingStats]="mappingStats" [employeeFieldMapping]="employeeFieldMapping" [destinationOptions]="destinationOptions" [displayName]="displayName" [isMultiLineOption]="isMultiLineOption"></app-generic-mapping-table>
<app-generic-mapping-table [isLoading]="isLoading" [appName]="appName" [isDashboardMappingResolve]="false" [destinationField]="destinationField" [filteredMappings]="filteredMappings" [sourceField]="sourceField" [mappingStats]="mappingStats" [employeeFieldMapping]="employeeFieldMapping" [destinationOptions]="destinationOptions" [displayName]="displayName" [isMultiLineOption]="isMultiLineOption" [detailAccountType]="detailAccountType"></app-generic-mapping-table>
</div>
<div class="tw-p-24-px tw-border-t-separator" *ngIf="filteredMappingCount && !isLoading" >
<app-paginator [totalCount]="totalCount" [pageType]="PaginatorPage.MAPPING" [page]="currentPage" [dropDownValue]="limit" (pageSizeChangeEvent)="pageSizeChanges($event)" (pageOffsetChangeEvent)="pageOffsetChanges($event)"></app-paginator>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ export class GenericMappingV2Component implements OnInit {

@Input() isMultiLineOption: boolean = false;

@Input() detailAccountType: string[] | undefined;

isInitialSetupComplete: boolean = false;

mappingStats: MappingStats;
Expand Down
Loading
Loading