Skip to content

Commit dbf909a

Browse files
authored
Few bug fixes from QBO (#512)
* Few bug fixes from QBO * progress bar
1 parent ba6e7df commit dbf909a

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

src/app/core/services/common/accounting-export.service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { WorkspaceService } from './workspace.service';
77
import { HelperService } from './helper.service';
88
import { AccountingExportCount, AccountingExportGetParam } from '../../models/db/accounting-export.model';
99
import { SelectedDateFilter } from '../../models/qbd/misc/date-filter.model';
10+
import { Cacheable } from 'ts-cacheable';
1011

1112
@Injectable({
1213
providedIn: 'root'
@@ -64,6 +65,7 @@ export class AccountingExportService {
6465
return this.apiService.get(`/workspaces/${this.workspaceId}/accounting_exports/`, apiParams);
6566
}
6667

68+
@Cacheable()
6769
importExpensesFromFyle(version?: 'v1'): Observable<{}> {
6870
return this.apiService.post(`/workspaces/${this.workspaceId}/fyle/${version === 'v1' ? 'expense_groups' : 'accounting_exports'}/sync/`, {});
6971
}

src/app/integrations/business-central/business-central-main/business-central-dashboard/business-central-dashboard.component.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,18 @@ export class BusinessCentralDashboardComponent implements OnInit {
140140
this.reimbursableImportState = responses[4].reimbursable_expenses_export_type ? this.reimbursableExpenseImportStateMap[responses[4].reimbursable_expense_state] : null;
141141
this.cccImportState = responses[4].credit_card_expense_export_type ? this.cccExpenseImportStateMap[responses[4].credit_card_expense_state] : null;
142142

143+
this.isLoading = false;
144+
143145
if (queuedTasks.length) {
144146
this.isImportInProgress = false;
145147
this.isExportInProgress = true;
146148
this.pollExportStatus();
147-
this.isLoading = false;
148149
} else {
149150
this.accountingExportService.importExpensesFromFyle().subscribe(() => {
150-
this.isImportInProgress = false;
151-
this.isLoading = false;
151+
this.dashboardService.getExportableAccountingExportIds().subscribe((exportableAccountingExportIds) => {
152+
this.exportableAccountingExportIds = exportableAccountingExportIds.exportable_accounting_export_ids ?? [];
153+
this.isImportInProgress = false;
154+
});
152155
});
153156
}
154157
});

src/app/integrations/qbo/qbo-main/qbo-dashboard/qbo-dashboard.component.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class QboDashboardComponent implements OnInit {
8181

8282
private pollExportStatus(exportableAccountingExportIds: number[] = []): void {
8383
interval(3000).pipe(
84-
switchMap(() => from(this.dashboardService.getAllTasks([TaskLogState.ENQUEUED, TaskLogState.IN_PROGRESS, TaskLogState.FAILED], exportableAccountingExportIds, this.accountingExportType))),
84+
switchMap(() => from(this.dashboardService.getAllTasks([], exportableAccountingExportIds, this.accountingExportType))),
8585
takeWhile((response: QBOTaskResponse) =>
8686
response.results.filter(task =>
8787
(task.status === TaskLogState.IN_PROGRESS || task.status === TaskLogState.ENQUEUED)
@@ -106,7 +106,7 @@ export class QboDashboardComponent implements OnInit {
106106

107107
this.failedExpenseGroupCount = res.results.filter(task => task.status === TaskLogState.FAILED || task.status === TaskLogState.FATAL).length;
108108

109-
this.exportableAccountingExportIds = res.results.filter(task => task.status === TaskLogState.FAILED || task.status === TaskLogState.FATAL).map(taskLog => taskLog.id);
109+
this.exportableAccountingExportIds = res.results.filter(task => task.status === TaskLogState.FAILED || task.status === TaskLogState.FATAL).map(taskLog => taskLog.expense_group);
110110

111111
this.isExportInProgress = false;
112112
this.exportProgressPercentage = 0;
@@ -150,7 +150,10 @@ export class QboDashboardComponent implements OnInit {
150150
this.pollExportStatus();
151151
} else {
152152
this.accountingExportService.importExpensesFromFyle('v1').subscribe(() => {
153-
this.isImportInProgress = false;
153+
this.dashboardService.getExportableAccountingExportIds('v1').subscribe((exportableAccountingExportIds) => {
154+
this.exportableAccountingExportIds = exportableAccountingExportIds.exportable_expense_group_ids;
155+
this.isImportInProgress = false;
156+
});
154157
});
155158
}
156159
});

src/app/integrations/sage300/sage300-main/sage300-dashboard/sage300-dashboard.component.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,18 @@ export class Sage300DashboardComponent implements OnInit {
141141
this.reimbursableImportState = responses[4].reimbursable_expenses_export_type ? this.reimbursableExpenseImportStateMap[responses[4].reimbursable_expense_state] : null;
142142
this.cccImportState = responses[4].credit_card_expense_export_type ? this.cccExpenseImportStateMap[responses[4].credit_card_expense_state] : null;
143143

144+
this.isLoading = false;
145+
144146
if (queuedTasks.length) {
145147
this.isImportInProgress = false;
146148
this.isExportInProgress = true;
147149
this.pollExportStatus();
148-
this.isLoading = false;
149150
} else {
150151
this.accountingExportService.importExpensesFromFyle().subscribe(() => {
151-
this.isImportInProgress = false;
152-
this.isLoading = false;
152+
this.dashboardService.getExportableAccountingExportIds().subscribe((exportableAccountingExportIds) => {
153+
this.exportableAccountingExportIds = exportableAccountingExportIds.exportable_accounting_export_ids;
154+
this.isImportInProgress = false;
155+
});
153156
});
154157
}
155158
});

src/app/integrations/si/main/dashboard/dashboard.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-10-px !tw-font-400 !tw-
143143
<button *ngIf="!groupedErrorStat.EMPLOYEE_MAPPING || (groupedErrorStat.EMPLOYEE_MAPPING && groupedErrorStat.EMPLOYEE_MAPPING.resolvedCount !== groupedErrorStat.EMPLOYEE_MAPPING.totalCount)" type="button" (click)="showMappingResolve(IntacctErrorType.EMPLOYEE_MAPPING, errors.EMPLOYEE_MAPPING)" class="tw-text-white tw-text-500 tw-text-12-px tw-px-12-px tw-py-6-px tw-bg-slightly-normal-text-color tw-rounded-4-px tw-w-100-px tw-font-500">
144144
Resolve
145145
</button>
146-
<div class="tw-flex" *ngIf="groupedErrorStat.EMPLOYEE_MAPPING && groupedErrorStat.EMPLOYEE_MAPPING.resolvedCount === groupedErrorStat.EMPLOYEE_MAPPING.totalCount">
146+
<div class="tw-flex tw-items-center" *ngIf="groupedErrorStat.EMPLOYEE_MAPPING && groupedErrorStat.EMPLOYEE_MAPPING.resolvedCount === groupedErrorStat.EMPLOYEE_MAPPING.totalCount">
147147
<app-svg-icon [svgSource]="'check-circle-outline'" [width]="'24px'" [height]="'24px'" [styleClasses]="'tw-text-success-toast tw-pr-6-px'"></app-svg-icon>
148148
<p class="tw-text-faded-text-color tw-text-14-px">
149149
Resolved
@@ -165,7 +165,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-10-px !tw-font-400 !tw-
165165
<button *ngIf="!groupedErrorStat.CATEGORY_MAPPING || (groupedErrorStat.CATEGORY_MAPPING && groupedErrorStat.CATEGORY_MAPPING.resolvedCount !== groupedErrorStat.CATEGORY_MAPPING.totalCount)" type="button" (click)="showMappingResolve(IntacctErrorType.CATEGORY_MAPPING, errors.CATEGORY_MAPPING)" class="tw-text-white tw-text-500 tw-text-12-px tw-px-12-px tw-py-6-px tw-bg-slightly-normal-text-color tw-rounded-4-px tw-w-100-px tw-font-500">
166166
Resolve
167167
</button>
168-
<div class="tw-flex" *ngIf="groupedErrorStat.CATEGORY_MAPPING && groupedErrorStat.CATEGORY_MAPPING.resolvedCount === groupedErrorStat.CATEGORY_MAPPING.totalCount">
168+
<div class="tw-flex tw-items-center" *ngIf="groupedErrorStat.CATEGORY_MAPPING && groupedErrorStat.CATEGORY_MAPPING.resolvedCount === groupedErrorStat.CATEGORY_MAPPING.totalCount">
169169
<app-svg-icon [svgSource]="'check-circle-outline'" [width]="'24px'" [height]="'24px'" [styleClasses]="'tw-text-success-toast tw-pr-6-px'"></app-svg-icon>
170170
<p class="tw-text-faded-text-color tw-text-14-px">
171171
Resolved

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-10-px !tw-font-400 !tw-
2626
<button *ngIf="!groupedErrorStat.EMPLOYEE_MAPPING || (groupedErrorStat.EMPLOYEE_MAPPING && groupedErrorStat.EMPLOYEE_MAPPING.resolvedCount !== groupedErrorStat.EMPLOYEE_MAPPING.totalCount)" type="button" (click)="showMappingResolve(ErrorType.EMPLOYEE_MAPPING, errors.EMPLOYEE_MAPPING, ExportErrorSourceType.EMPLOYEE)" class="tw-text-white tw-text-500 tw-text-12-px tw-px-12-px tw-py-6-px tw-bg-slightly-normal-text-color tw-rounded-4-px tw-w-100-px tw-font-500">
2727
Resolve
2828
</button>
29-
<div class="tw-flex" *ngIf="groupedErrorStat.EMPLOYEE_MAPPING && groupedErrorStat.EMPLOYEE_MAPPING.resolvedCount === groupedErrorStat.EMPLOYEE_MAPPING.totalCount">
29+
<div class="tw-flex tw-items-center" *ngIf="groupedErrorStat.EMPLOYEE_MAPPING && groupedErrorStat.EMPLOYEE_MAPPING.resolvedCount === groupedErrorStat.EMPLOYEE_MAPPING.totalCount">
3030
<app-svg-icon [svgSource]="'check-circle-outline'" [width]="'24px'" [height]="'24px'" [styleClasses]="'tw-text-success-toast tw-pr-6-px'"></app-svg-icon>
3131
<p class="tw-text-faded-text-color tw-text-14-px">
3232
Resolved
@@ -48,7 +48,7 @@ <h5 class="!tw-text-faded-text-color tw-text-14-px tw-pt-10-px !tw-font-400 !tw-
4848
<button *ngIf="!groupedErrorStat.CATEGORY_MAPPING || (groupedErrorStat.CATEGORY_MAPPING && groupedErrorStat.CATEGORY_MAPPING.resolvedCount !== groupedErrorStat.CATEGORY_MAPPING.totalCount)" type="button" (click)="showMappingResolve(ErrorType.CATEGORY_MAPPING, errors.CATEGORY_MAPPING, ExportErrorSourceType.CATEGORY)" class="tw-text-white tw-text-500 tw-text-12-px tw-px-12-px tw-py-6-px tw-bg-slightly-normal-text-color tw-rounded-4-px tw-w-100-px tw-font-500">
4949
Resolve
5050
</button>
51-
<div class="tw-flex" *ngIf="groupedErrorStat.CATEGORY_MAPPING && groupedErrorStat.CATEGORY_MAPPING.resolvedCount === groupedErrorStat.CATEGORY_MAPPING.totalCount">
51+
<div class="tw-flex tw-items-center" *ngIf="groupedErrorStat.CATEGORY_MAPPING && groupedErrorStat.CATEGORY_MAPPING.resolvedCount === groupedErrorStat.CATEGORY_MAPPING.totalCount">
5252
<app-svg-icon [svgSource]="'check-circle-outline'" [width]="'24px'" [height]="'24px'" [styleClasses]="'tw-text-success-toast tw-pr-6-px'"></app-svg-icon>
5353
<p class="tw-text-faded-text-color tw-text-14-px">
5454
Resolved

src/assets/themes/theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
--success-toast: #24A148;
5656
--alert-toast: #DA1E28;
5757
--line-inactive: #CCCDD7;
58-
--progress-bar-bg: #015884;
58+
--progress-bar-bg: var(--white);
5959
--mapped-green-border: #D9EBE1;
6060
--mapped-green-bg: #EEF8F2;
6161
--unmapped-red-border: #F5C0C3;

0 commit comments

Comments
 (0)