From 69d2ec053982e0a4f102b0363704b0fd2dbc8a88 Mon Sep 17 00:00:00 2001 From: Dhaarani <55541808+DhaaraniCIT@users.noreply.github.com> Date: Fri, 20 Dec 2024 16:33:41 +0530 Subject: [PATCH] feat: qbd direct tracking for export and sync on click (#1134) * feat: qbd direct tracking for export and sync on click * wording change for connector page --- src/app/core/models/enum/enum.model.ts | 10 ++++++---- .../qbd-direct-core/qbd-direct-helper.service.ts | 7 +++++-- .../qbd-direct-dashboard.component.ts | 9 +++++---- .../qbd-direct-main/qbd-direct-main.component.ts | 8 ++------ 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/app/core/models/enum/enum.model.ts b/src/app/core/models/enum/enum.model.ts index 0b177a22d..c4397d664 100644 --- a/src/app/core/models/enum/enum.model.ts +++ b/src/app/core/models/enum/enum.model.ts @@ -84,9 +84,9 @@ export enum TravelperkUpdateEvent { export enum QbdDirectUpdateEvent { CONFIRM_PRE_REQUISITES_QBD_DIRECT = 'Confirm Pre Requisites QuickBooks Desktop Connector', - CONNECT_QBD_DIRECT = 'Connect QuickBooks Desktop Connector', - PENDING_QWC_UPLOAD_QBD_DIRECT = 'Pending QWC Upload QuickBooks Desktop Connector', - DESTINATION_SYNC_COMPLETE_QBD_DIRECT = 'Destination Sync Complete QuickBooks Desktop Connector', + CONNECT_QBD_DIRECT = 'Step 2.1 - Connect QuickBooks Desktop Connector', + PENDING_QWC_UPLOAD_QBD_DIRECT = 'Step 2.2 - Upload QWC downloaded file to QuickBooks Desktop Connector', + DESTINATION_SYNC_COMPLETE_QBD_DIRECT = 'Step 2.3 - Sync destination entities with QuickBooks Desktop Connector', EXPORT_SETTING_QBD_DIRECT = 'Export Settings QuickBooks Desktop Connector', IMPORT_SETTINGS_QBD_DIRECT = 'Import Settings QuickBooks Desktop Connector', ADVANCED_SETTINGS_QBD_DIRECT = 'Advanced Settings QuickBooks Desktop Connector', @@ -165,7 +165,9 @@ export enum ClickEvent { PREVIEW_INTACCT_EXPORT = 'Preview Sage Intacct Export', INTACCT_EXPORT = 'Export Sage Intacct', CONNECT_SAGE300 = 'Connect Sage 300 CRE', - CONNECT_BUSINESS_CENTRAL = 'Connect Dynamic 365 Business Central' + CONNECT_BUSINESS_CENTRAL = 'Connect Dynamic 365 Business Central', + QBD_DIRECT_EXPORT = 'Direct Export Quickbooks Desktop', + QBD_DIRECT_SYNC = 'Sync Quickbooks Desktop Direct' } export enum ProgressPhase { diff --git a/src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-helper.service.ts b/src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-helper.service.ts index ecd714845..34fe0d6c8 100644 --- a/src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-helper.service.ts +++ b/src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-helper.service.ts @@ -3,7 +3,8 @@ import { ApiService } from '../../common/api.service'; import { WorkspaceService } from '../../common/workspace.service'; import { Observable } from 'rxjs'; import { IntegrationsToastService } from '../../common/integrations-toast.service'; -import { ToastSeverity } from 'src/app/core/models/enum/enum.model'; +import { ClickEvent, ToastSeverity, TrackingApp } from 'src/app/core/models/enum/enum.model'; +import { TrackingService } from '../../integration/tracking.service'; @Injectable({ providedIn: 'root' @@ -13,7 +14,8 @@ export class QbdDirectHelperService { constructor( private apiService: ApiService, private workspaceService: WorkspaceService, - private toastService: IntegrationsToastService + private toastService: IntegrationsToastService, + private trackingService: TrackingService ) { } importQBDAttributes(refresh: boolean): Observable<{}> { @@ -21,6 +23,7 @@ export class QbdDirectHelperService { } importAttributes(refresh: boolean): void { + this.trackingService.onClickEvent(TrackingApp.QBD_DIRECT, ClickEvent.QBD_DIRECT_SYNC); this.workspaceService.importFyleAttributes(refresh).subscribe(); this.importQBDAttributes(refresh).subscribe(); this.toastService.displayToastMessage(ToastSeverity.SUCCESS, 'Syncing data dimensions from Quickbooks Desktop'); diff --git a/src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-dashboard/qbd-direct-dashboard.component.ts b/src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-dashboard/qbd-direct-dashboard.component.ts index 2a29efacc..b421f3ec7 100644 --- a/src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-dashboard/qbd-direct-dashboard.component.ts +++ b/src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-dashboard/qbd-direct-dashboard.component.ts @@ -6,13 +6,13 @@ import { brandingFeatureConfig } from 'src/app/branding/branding-config'; import { brandingConfig } from 'src/app/branding/c1-contents-config'; import { AccountingExportSummary, AccountingExportSummaryModel } from 'src/app/core/models/db/accounting-export-summary.model'; import { DestinationFieldMap, DashboardModel } from 'src/app/core/models/db/dashboard.model'; -import { AccountingGroupedErrors, AccountingGroupedErrorStat, Error, ErrorResponse } from 'src/app/core/models/db/error.model'; -import { AppName, AccountingErrorType, QbdDirectTaskLogType, ReimbursableImportState, CCCImportState, AppUrl, TaskLogState } from 'src/app/core/models/enum/enum.model'; +import { AccountingGroupedErrors, AccountingGroupedErrorStat, ErrorResponse } from 'src/app/core/models/db/error.model'; +import { AppName, AccountingErrorType, ReimbursableImportState, CCCImportState, AppUrl, TaskLogState, ClickEvent, TrackingApp } from 'src/app/core/models/enum/enum.model'; import { QbdDirectTaskResponse, QbdDirectTaskLog } from 'src/app/core/models/qbd-direct/db/qbd-direct-task-log.model'; import { QbdDirectImportSettingModel } from 'src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.model'; import { AccountingExportService } from 'src/app/core/services/common/accounting-export.service'; import { DashboardService } from 'src/app/core/services/common/dashboard.service'; -import { WorkspaceService } from 'src/app/core/services/common/workspace.service'; +import { TrackingService } from 'src/app/core/services/integration/tracking.service'; import { QbdDirectExportSettingsService } from 'src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-export-settings.service'; import { QbdDirectImportSettingsService } from 'src/app/core/services/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.service'; import { SharedModule } from 'src/app/shared/shared.module'; @@ -83,12 +83,13 @@ export class QbdDirectDashboardComponent implements OnInit { private accountingExportService: AccountingExportService, private dashboardService: DashboardService, private QbdDirectExportSettingsService: QbdDirectExportSettingsService, - private workspaceService: WorkspaceService, + private trackingService: TrackingService, private importSettingService: QbdDirectImportSettingsService ) { } export() { this.isExportInProgress = true; + this.trackingService.onClickEvent(TrackingApp.QBD_DIRECT, ClickEvent.QBD_DIRECT_EXPORT); this.dashboardService.triggerAccountingExport('v1').subscribe(() => { this.pollExportStatus(this.exportableAccountingExportIds); }); diff --git a/src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-main.component.ts b/src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-main.component.ts index 20f6aa9b8..7082ecce1 100644 --- a/src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-main.component.ts +++ b/src/app/integrations/qbd-direct/qbd-direct-main/qbd-direct-main.component.ts @@ -3,9 +3,7 @@ import { Component, OnInit } from '@angular/core'; import { Router, RouterModule } from '@angular/router'; import { MenuItem } from 'primeng/api'; import { brandingContent, brandingFeatureConfig } from 'src/app/branding/branding-config'; -import { AppName, ToastSeverity } from 'src/app/core/models/enum/enum.model'; -import { IntegrationsToastService } from 'src/app/core/services/common/integrations-toast.service'; -import { WorkspaceService } from 'src/app/core/services/common/workspace.service'; +import { AppName } from 'src/app/core/models/enum/enum.model'; import { QbdDirectHelperService } from 'src/app/core/services/qbd-direct/qbd-direct-core/qbd-direct-helper.service'; import { SharedModule } from 'src/app/shared/shared.module'; @@ -35,9 +33,7 @@ export class QbdDirectMainComponent implements OnInit { constructor( private qbdDirectHelperService: QbdDirectHelperService, - private router: Router, - private toastService: IntegrationsToastService, - private workspaceService: WorkspaceService + private router: Router ) { }