Skip to content

Commit

Permalink
PR commit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DhaaraniCIT committed Dec 16, 2024
1 parent 6f884f1 commit f9337be
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app/core/models/enum/enum.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ 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',
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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ export class QbdDirectOnboardingConnectorComponent implements OnInit {

sessionStartTime: Date = new Date();

workspace: QbdDirectWorkspace;

constructor(
private router: Router,
private workspaceService: WorkspaceService,
Expand Down Expand Up @@ -116,6 +118,22 @@ export class QbdDirectOnboardingConnectorComponent implements OnInit {
proceedToConnection() {
this.isDownloadfileLoading = true;
this.workspaceService.updateWorkspaceOnboardingState({onboarding_state: QbdDirectOnboardingState.PENDING_QWC_UPLOAD}).subscribe((workspaceResponse: QbdDirectWorkspace) => {
this.workspace = workspaceResponse;
if (this.workspaceService.getOnboardingState() === QbdDirectOnboardingState.CONNECTION) {
this.trackingService.integrationsOnboardingCompletion(TrackingApp.QBD_DIRECT, QbdDirectOnboardingState.CONNECTION, 2);
} else {
const oldWorkspaceResponse = workspaceResponse;
oldWorkspaceResponse.onboarding_state = QbdDirectOnboardingState.CONNECTION;
this.trackingService.onUpdateEvent(
TrackingApp.QBD_DIRECT,
QbdDirectUpdateEvent.CONNECT_QBD_DIRECT,
{
phase: ProgressPhase.ONBOARDING,
oldState: oldWorkspaceResponse,
newState: workspaceResponse
}
);
}
this.isDownloadStepCompleted = true;
this.isDownloadfileLoading = false;
});
Expand Down Expand Up @@ -193,6 +211,21 @@ export class QbdDirectOnboardingConnectorComponent implements OnInit {
} else {
this.handleDataSyncState(workspaceResponse[0]);
}
if (workspaceResponse[0].onboarding_state in [QbdDirectOnboardingState.DESTINATION_SYNC_IN_PROGRESS, QbdDirectOnboardingState.DESTINATION_SYNC_COMPLETE]) {
this.trackingService.integrationsOnboardingCompletion(TrackingApp.QBD_DIRECT, QbdDirectOnboardingState.PENDING_QWC_UPLOAD, 2);
} else {
const oldWorkspaceResponse = this.workspace;
oldWorkspaceResponse.onboarding_state = QbdDirectOnboardingState.PENDING_QWC_UPLOAD;
this.trackingService.onUpdateEvent(
TrackingApp.QBD_DIRECT,
QbdDirectUpdateEvent.PENDING_QWC_UPLOAD_QBD_DIRECT,
{
phase: ProgressPhase.ONBOARDING,
oldState: oldWorkspaceResponse,
newState: workspaceResponse[0]
}
);
}
});
}

Expand Down Expand Up @@ -228,7 +261,7 @@ export class QbdDirectOnboardingConnectorComponent implements OnInit {
oldWorkspaceResponse.onboarding_state = QbdDirectOnboardingState.DESTINATION_SYNC_COMPLETE;
this.trackingService.onUpdateEvent(
TrackingApp.QBD_DIRECT,
QbdDirectUpdateEvent.CONNECT_QBD_DIRECT,
QbdDirectUpdateEvent.DESTINATION_SYNC_COMPLETE_QBD_DIRECT,
{
phase: ProgressPhase.ONBOARDING,
oldState: oldWorkspaceResponse,
Expand Down

0 comments on commit f9337be

Please sign in to comment.