Skip to content

Commit 64a9f70

Browse files
fix: dashboard error section fixes (#1107)
* dashboard error section fixes * dashboard error section fixes * configuration fixes --------- Co-authored-by: Ashwin Thanaraj <[email protected]>
1 parent 1a8fa49 commit 64a9f70

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class QbdDirectImportSettingModel extends ImportSettingsModel {
3636
chartOfAccountTypes: new FormControl(importSettings?.import_settings?.chart_of_accounts ? importSettings.import_settings.chart_of_accounts.map(item => item.replace(/([a-z])([A-Z])/g, '$1 $2')) : ['Expense']),
3737
importVendorsAsMerchants: new FormControl(importSettings?.import_settings?.import_vendor_as_merchant ?? false),
3838
searchOption: new FormControl(''),
39-
importCodeFields: new FormControl( importSettings?.import_settings?.import_code_fields ? importSettings.import_settings.import_code_fields : null),
39+
importCodeFields: new FormControl( importSettings?.import_settings?.import_code_fields ? importSettings.import_settings.import_code_fields : []),
4040
importCategoryCode: new FormControl(this.getImportCodeField(importCode, 'ACCOUNT', QbdDirectImportCodeFieldCodeConfig)),
4141
workSpaceId: new FormControl(importSettings?.workspace_id)
4242
});

src/app/integrations/qbd-direct/qbd-direct-shared/qbd-direct-export-settings/qbd-direct-export-settings.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
[options]="reimbursableExpenseGroupingFieldOptions"
9898
[iconPath]="'question-square-outline'"
9999
[placeholder]="'Select expense grouping'"
100+
[appName]="appName"
100101
[isDisableTextRequired]="isReimbursableExportGroupDisabled()"
101102
[isDisabled]="isReimbursableExportGroupDisabled()"
102103
[formControllerName]="'reimbursableExportGroup'">

src/app/shared/components/configuration/configuration-import-field/configuration-import-field.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ <h5 *ngIf="!isCloneSettingView" class="!tw-text-text-muted tw-text-14-px !tw-fon
9595
<app-svg-icon *ngIf="(expenseField.get('source_field')?.value !== 'CATEGORY') && (uiExposedAppName === AppName.XERO ? expenseField.get('destination_field')?.value !== 'CUSTOMER' : true )" [svgSource]="'cross-medium'" [c1SvgSource]="'grv-cross-filled-medium'" (click)="removeFilter(expenseField)" [height]="'18px'" [width]="'18px'" [styleClasses]="'tw-mt-4-px'"></app-svg-icon>
9696
</ng-template>
9797
</p-dropdown>
98-
<p *ngIf="(expenseField.get('source_field')?.value && !expenseField.valid && !hasDuplicateOption(expenseField, i, 'source_field')) || (!expenseField.get('source_field')?.value && expenseField.value.import_to_fyle)" class="tw-text-alert-toast tw-text-12-px tw-pt-4-px">
98+
<p *ngIf="(expenseField.get('source_field')?.value && !expenseField.valid && !hasDuplicateOption(expenseField, i, 'source_field'))" class="tw-text-alert-toast tw-text-12-px tw-pt-4-px">
9999
{{brandingConfig.brandName}} Fields should be unique
100100
</p>
101101
</div>

src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ <h5 *ngIf="formControllerName === 'cccExportType' && brandingConfig.brandId ===
9797
<span *ngIf="brandingConfig.brandId === 'co'"> in {{uiExposedAppName}}</span>
9898
</div>
9999
<div *ngIf="!showExportPreview && isDisabled && isDisableTextRequired" class="sub-text tw-text-pretty">
100-
<span>Auto-selected based on your export module</span>
101-
<span *ngIf="(formControllerName === 'reimbursableExportGroup' || formControllerName === 'creditCardExportGroup') && appName === AppName.QBD_DIRECT && form.controls.creditCardExportType.value !== 'CREDIT_CARD_PURCHASE'"> Auto-selected when your default credit account is set to an Accounts Payable account</span>
100+
<span *ngIf="!((formControllerName === 'reimbursableExportGroup' || formControllerName === 'creditCardExportGroup') && appName === AppName.QBD_DIRECT && form.controls.creditCardExportType.value !== 'CREDIT_CARD_PURCHASE' && form.controls.reimbursableExportType.value !== 'BILL')">Auto-selected based on your export module</span>
101+
<span *ngIf="(formControllerName === 'reimbursableExportGroup' || formControllerName === 'creditCardExportGroup') && appName === AppName.QBD_DIRECT && form.controls.creditCardExportType.value !== 'CREDIT_CARD_PURCHASE' && form.controls.reimbursableExportType.value !== 'BILL'"> Auto-selected when your default credit account is set to an Accounts Payable account</span>
102102
</div>
103103
<div *ngIf="brandingConfig.brandId !== 'co' && form.controls[formControllerName].value==='spent_at' && isOnboarding && form.get('cccExportType')?.value && form.get('cccExportGroup')?.value === 'REPORT'" class="sub-text">
104104
<span>Using the Spend Date may lead to multiple single line<br>item entries.</span>

src/app/shared/components/dashboard/dashboard-error-section/dashboard-error-section.component.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,13 @@ export class DashboardErrorSectionComponent implements OnInit {
125125
this.displayName = undefined;
126126
}
127127

128-
this.mappingService.getPaginatedDestinationAttributes(this.destinationField, undefined, this.displayName).subscribe((response: any) => {
128+
if (this.destinationField === AccountingField.ACCOUNT && this.appName === AppName.QBD_DIRECT) {
129+
this.detailAccountType = this.chartOfAccounts;
130+
} else {
131+
this.detailAccountType = undefined;
132+
}
133+
134+
this.mappingService.getPaginatedDestinationAttributes(this.destinationField, undefined, this.displayName, this.appName, this.detailAccountType).subscribe((response: any) => {
129135
this.destinationOptions = response.results;
130136

131137
this.setErrors(errorType);
@@ -149,13 +155,11 @@ export class DashboardErrorSectionComponent implements OnInit {
149155
this.mappingService.getGroupedDestinationAttributes([this.destinationField], 'v2').subscribe(groupedDestinationResponse => {
150156
if (this.sourceField === 'EMPLOYEE') {
151157
this.destinationOptions = this.destinationField === FyleField.EMPLOYEE ? groupedDestinationResponse.EMPLOYEE : groupedDestinationResponse.VENDOR;
152-
this.detailAccountType = undefined;
153158
} else if (this.sourceField === 'CATEGORY') {
154159
if (this.destinationField === 'EXPENSE_TYPE') {
155160
this.destinationOptions = groupedDestinationResponse.EXPENSE_TYPE;
156161
} else {
157-
this.detailAccountType = this.chartOfAccounts;
158-
this.destinationOptions = this.appName !== AppName.QBD_DIRECT ? groupedDestinationResponse.ACCOUNT : this.destinationOptionsWatcher( this.chartOfAccounts, groupedDestinationResponse.ACCOUNT as QbdDirectDestinationAttribute[]);
162+
this.destinationOptions = groupedDestinationResponse.ACCOUNT;
159163
}
160164
}
161165

0 commit comments

Comments
 (0)