Skip to content

Commit

Permalink
Fix for Dashboard Export Section : Polling Fix (#469)
Browse files Browse the repository at this point in the history
* Fix Polling

* QBO and Sage300 Fix for polling

* removed loggers
  • Loading branch information
anishfyle authored Jan 25, 2024
1 parent 7568586 commit feb7e07
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { environment } from 'src/environments/environment';
})
export class BusinessCentralDashboardComponent implements OnInit {

isLoading: boolean;
isLoading: boolean = true;

appName: AppName = AppName.BUSINESS_CENTRAL;

Expand Down Expand Up @@ -74,7 +74,6 @@ export class BusinessCentralDashboardComponent implements OnInit {
this.exportProgressPercentage = Math.round((this.processedCount / this.exportableAccountingExportIds.length) * 100);

if (res.results.filter(task => (task.status === AccountingExportStatus.IN_PROGRESS || task.status === AccountingExportStatus.ENQUEUED || task.status === AccountingExportStatus.EXPORT_QUEUED)).length === 0) {
this.isLoading = true;
forkJoin([
this.getExportErrors$,
this.getAccountingExportSummary$
Expand All @@ -85,17 +84,18 @@ export class BusinessCentralDashboardComponent implements OnInit {
CATEGORY_MAPPING: null
};
this.accountingExportSummary = responses[1];
this.isLoading = false;
});

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

this.exportableAccountingExportIds = res.results.filter(task => task.status === AccountingExportStatus.FAILED || task.status === AccountingExportStatus.FATAL).map(taskLog => taskLog.id);

this.isExportInProgress = false;
this.exportProgressPercentage = 0;
this.processedCount = 0;

if (this.failedExpenseGroupCount === 0) {
this.refinerService.triggerSurvey(
AppName.SAGE300, environment.refiner_survey.intacct.export_done_survery_id, RefinerSurveyType.EXPORT_DONE
AppName.BUSINESS_CENTRAL, environment.refiner_survey.intacct.export_done_survery_id, RefinerSurveyType.EXPORT_DONE
);
}
}
Expand Down Expand Up @@ -133,6 +133,7 @@ export class BusinessCentralDashboardComponent implements OnInit {
this.isImportInProgress = false;
this.isExportInProgress = true;
this.pollExportStatus();
this.isLoading = false;
} else {
this.accountingExportService.importExpensesFromFyle().subscribe(() => {
this.isImportInProgress = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export class QboDashboardComponent implements OnInit {
});

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

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

this.isExportInProgress = false;
this.exportProgressPercentage = 0;
this.processedCount = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ export class Sage300DashboardComponent implements OnInit {
});

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

this.exportableAccountingExportIds = res.results.filter(task => task.status === AccountingExportStatus.FAILED || task.status === AccountingExportStatus.FATAL).map(taskLog => taskLog.id);

this.isExportInProgress = false;
this.exportProgressPercentage = 0;
this.processedCount = 0;
Expand Down

0 comments on commit feb7e07

Please sign in to comment.