-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: qbd direct onboarding landing page #1056
Changes from all commits
f7f5b88
1eddecd
67d26ba
e9bcf87
f414acf
cad4ae1
dec8237
5681cba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ export type Workspace = { | |
created_at: Date; | ||
updated_at: Date; | ||
} | ||
|
||
export type WorkspaceOnboardingState = { | ||
onboarding_state: string; | ||
} | ||
Comment on lines
+11
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider using string literal union type for better type safety The Here's a suggested improvement: +/**
+ * Represents the onboarding state of a workspace in QBD direct integration
+ */
export type WorkspaceOnboardingState = {
- onboarding_state: string;
+ onboarding_state: 'LANDING_PAGE' | 'IN_PROGRESS' | 'COMPLETE'; // Add all valid states
} This change will:
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,8 @@ import { AppUrl, BusinessCentralOnboardingState, IntacctOnboardingState, Netsuit | |
import { ApiService } from './api.service'; | ||
import { HelperService } from './helper.service'; | ||
import { AppUrlMap } from '../../models/integrations/integrations.model'; | ||
import { Workspace } from '../../models/db/workspaces.model'; | ||
import { XeroWorkspace } from '../../models/xero/db/xero-workspace.model'; | ||
import { WorkspaceOnboardingState } from '../../models/db/workspaces.model'; | ||
import { QbdDirectWorkspace } from '../../models/qbd-direct/db/qbd-direct-workspaces.model'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
|
@@ -74,4 +74,8 @@ export class WorkspaceService { | |
getWorkspaceGeneralSettings(): Observable<any> { | ||
return this.apiService.get(`/workspaces/${this.getWorkspaceId()}/settings/general/`, {}); | ||
} | ||
|
||
updateWorkspaceOnboardingState(payload: WorkspaceOnboardingState): Observable<QbdDirectWorkspace> { | ||
return this.apiService.patch(`/workspaces/${this.getWorkspaceId()}/onboarding_state/`, payload); | ||
} | ||
Comment on lines
+78
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Inconsistency found between onboarding state enums The verification reveals a mismatch between the onboarding states. The code uses
🔗 Analysis chainVerify onboarding state values consistency Ensure that the WorkspaceOnboardingState values align with QBDOnboardingState enum values used in the service. Let me gather more information about the QBD onboarding states to verify the consistency. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for QBDOnboardingState enum definition and WorkspaceOnboardingState usage
echo "Searching for QBDOnboardingState enum definition:"
rg -A 5 "QBDOnboardingState\s*=" src/
echo "\nSearching for WorkspaceOnboardingState usage:"
rg -A 2 "WorkspaceOnboardingState" src/
Length of output: 2763 Script: #!/bin/bash
# Search for QBD onboarding state enums and their values
echo "Searching for QBD onboarding state enum definitions:"
rg -B2 -A5 "enum.*OnboardingState" src/
# Search for actual usage of onboarding states in the codebase
echo "\nSearching for onboarding state assignments:"
rg "onboarding_state.*=.*" src/
Length of output: 6119 |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { ApiService } from '../../common/api.service'; | ||
import { WorkspaceService } from '../../common/workspace.service'; | ||
import { Observable } from 'rxjs'; | ||
import { QbdConnectorPost, QbdConnectorGet, SyncDataType } from 'src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-connector.model'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
export class QbdDirectConnectorService { | ||
|
||
constructor() { } | ||
constructor( | ||
private apiService: ApiService, | ||
private workspaceService: WorkspaceService | ||
) { } | ||
|
||
postQbdDirectConntion(payload: QbdConnectorPost): Observable<QbdConnectorGet> { | ||
return this.apiService.post(`/workspaces/${this.workspaceService.getWorkspaceId()}/connector_settings/`, payload); | ||
} | ||
|
||
syncAttribuites(): Observable<SyncDataType[]> { | ||
return this.apiService.get(`/workspaces/${this.workspaceService.getWorkspaceId()}/qbd/attribute_stats/`, {}); | ||
} | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,61 @@ | ||
<p>qbd-direct-onboarding-connector works!</p> | ||
<div class="tw-pb-48-px"> | ||
<app-onboarding-steppers [onboardingSteps]="onboardingSteps"></app-onboarding-steppers> | ||
<div> | ||
<div *ngIf="isLoading" class="tw-flex tw-justify-center tw-items-center tw-pt-80-px"> | ||
<app-loader></app-loader> | ||
</div> | ||
<div *ngIf="!isLoading" class="configuration--contents tw-border-border-tertiary tw-mt-24-px" [ngClass]="{'tw-mx-120-px tw-shadow-app-card': brandingConfig.brandId === 'fyle', 'tw-mx-60-px tw-shadow-shadow-level-1': brandingConfig.brandId === 'co'}"> | ||
<div> | ||
<app-configuration-step-header | ||
[headerText]="brandingContent.configurationHeaderText" | ||
[contentText]="brandingContent.configurationSubHeaderText" | ||
[redirectLink]="redirectLink"> | ||
</app-configuration-step-header> | ||
</div> | ||
<div class="tw-px-24-px"> | ||
<div class="tw-py-24-px"> | ||
<app-qbd-direct-download-file | ||
[isLoading]="isDownloadfileLoading" | ||
[showDownloadLink]="showDownloadLink" | ||
[isStepCompleted]="isDownloadStepCompleted" | ||
[isCompanyPathInvalid]="isCompanyPathInvalid" | ||
(nextStep)="proceedToConnection()" | ||
(downloadClick)="triggerDownload($event)" | ||
(retryClick)="retry()" | ||
(manualDownload)="triggerManualDownload()"></app-qbd-direct-download-file> | ||
</div> | ||
<div class="tw-py-24-px"> | ||
<app-qbd-direct-setup-connection | ||
[showSection]="isDownloadStepCompleted" | ||
[password]="password" | ||
[isLoading]="isConnectionLoading" | ||
[connectionStatus]="connectionStatus" | ||
[isStepCompleted]="isConnectionStepCompleted" | ||
[isCTAEnabled]="isConnectionCTAEnabled" | ||
(doneClick)="onConnectionDone($event)" | ||
(nextClick)="proceedToSyncData()"></app-qbd-direct-setup-connection> | ||
</div> | ||
<div class="tw-py-24-px"> | ||
<app-qbd-direct-data-sync | ||
[isLoading]="isDataSyncLoading" | ||
[qbdFields]="qbdFields" | ||
[isCTAEnabled]="isDataSyncCTADisabled" | ||
[showSection]="isConnectionStepCompleted" | ||
(continueClick)="proceedToExportSetting()"></app-qbd-direct-data-sync> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div *ngIf="isDialogVisible"> | ||
<app-configuration-confirmation-dialog | ||
(warningAccepted)="closeDialog($event)" | ||
[isWarningVisible]="isDialogVisible" | ||
[headerText]="'Connection failed'" | ||
[contextText]="warningDialogText" | ||
[confirmBtnText]="'Got it'" | ||
[appName]="appName" | ||
[showSecondaryCTA]="false"> | ||
</app-configuration-confirmation-dialog> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Maintain consistency by using dynamic branding
The content text should use dynamic branding (
brandingConfig.brandName
) to maintain consistency with other integration sections.Apply this change:
📝 Committable suggestion