Skip to content

Commit

Permalink
feat: move employee settings to export settings (#1115)
Browse files Browse the repository at this point in the history
* feat: move employee settings to export settings

* qbo export settings

* lint fix

* html

* removed employee settings component

* fix lint

* fix tests

* fix onboarding

* lint fix

* pr comments

* lint fix

* pr comments

* pr comment / 2

* pr comments

* lint fix

* pr comment
  • Loading branch information
anishfyle authored Dec 19, 2024
1 parent 7e8db09 commit 97ff48f
Show file tree
Hide file tree
Showing 25 changed files with 220 additions and 706 deletions.
2 changes: 1 addition & 1 deletion src/app/core/models/common/advanced-settings.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class AdvancedSettingsModel {
if (cccExportType && ['netsuite', 'quickbooks online', 'sage intacct'].includes(appName.toLowerCase()) && brandingConfig.brandId === 'fyle') {
return defaultOptions;
}
return defaultOptions.filter(option => option !== 'card_number');
return defaultOptions.filter(option => option !== 'card_number');

}

Expand Down
1 change: 0 additions & 1 deletion src/app/core/models/enum/enum.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ export enum IntacctOnboardingState {

export enum QBOOnboardingState {
CONNECTION = 'CONNECTION',
MAP_EMPLOYEES = 'MAP_EMPLOYEES',
EXPORT_SETTINGS = 'EXPORT_SETTINGS',
IMPORT_SETTINGS = 'IMPORT_SETTINGS',
ADVANCED_CONFIGURATION = 'ADVANCED_CONFIGURATION',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,12 @@ export class QBOExportSettingModel extends ExportSettingModel {

return exportSettingPayload;
}

static createEmployeeSettingsForm(existingEmployeeFieldMapping: EmployeeFieldMapping, autoMapEmployees: boolean): FormGroup {
return new FormGroup({
employeeMapping: new FormControl(existingEmployeeFieldMapping, Validators.required),
autoMapEmployee: new FormControl(autoMapEmployees),
searchOption: new FormControl('')
});
}
}
20 changes: 5 additions & 15 deletions src/app/core/models/qbo/qbo-configuration/qbo-onboarding.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { OnboardingStepper } from "../../misc/onboarding-stepper.model";

type QBOOnboardingStepperMap = {
[QBOOnboardingState.CONNECTION]: number,
[QBOOnboardingState.MAP_EMPLOYEES]: number,
[QBOOnboardingState.EXPORT_SETTINGS]: number,
[QBOOnboardingState.IMPORT_SETTINGS]: number,
[QBOOnboardingState.ADVANCED_CONFIGURATION]: number,
Expand All @@ -24,14 +23,6 @@ export class QBOOnboardingModel {
route: '/integrations/qbo/onboarding/connector',
styleClasses: ['step-name-connector--text']
},
{
active: false,
completed: false,
step: brandingContent.configuration.employeeSetting.stepName,
icon: 'mapping-medium',
route: '/integrations/qbo/onboarding/employee_settings',
styleClasses: ['step-name-export--text']
},
{
active: false,
completed: false,
Expand Down Expand Up @@ -60,12 +51,11 @@ export class QBOOnboardingModel {

private readonly onboardingStateStepMap: QBOOnboardingStepperMap = {
[QBOOnboardingState.CONNECTION]: 1,
[QBOOnboardingState.MAP_EMPLOYEES]: 2,
[QBOOnboardingState.EXPORT_SETTINGS]: 3,
[QBOOnboardingState.IMPORT_SETTINGS]: 4,
[QBOOnboardingState.ADVANCED_CONFIGURATION]: 5,
[QBOOnboardingState.COMPLETE]: 6,
[QBOOnboardingState.CLONE_SETTINGS]: 7
[QBOOnboardingState.EXPORT_SETTINGS]: 2,
[QBOOnboardingState.IMPORT_SETTINGS]: 3,
[QBOOnboardingState.ADVANCED_CONFIGURATION]: 4,
[QBOOnboardingState.COMPLETE]: 5,
[QBOOnboardingState.CLONE_SETTINGS]: 6
};

getOnboardingSteps(currentStep: string, onboardingState: QBOOnboardingState): OnboardingStepper[] {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { QboConfigurationComponent } from './qbo-configuration.component';
import { QboEmployeeSettingsComponent } from '../../qbo-shared/qbo-employee-settings/qbo-employee-settings.component';
import { QboExportSettingsComponent } from '../../qbo-shared/qbo-export-settings/qbo-export-settings.component';
import { QboImportSettingsComponent } from '../../qbo-shared/qbo-import-settings/qbo-import-settings.component';
import { QboAdvancedSettingsComponent } from '../../qbo-shared/qbo-advanced-settings/qbo-advanced-settings.component';
Expand All @@ -11,10 +10,6 @@ const routes: Routes = [
path: '',
component: QboConfigurationComponent,
children: [
{
path: 'employee_settings',
component: QboEmployeeSettingsComponent
},
{
path: 'export_settings',
component: QboExportSettingsComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export class QboConfigurationComponent implements OnInit {
readonly brandingContent = brandingContent.configuration;

modules: MenuItem[] = [
{label: 'Map Employees', routerLink: '/integrations/qbo/main/configuration/employee_settings'},
{label: this.brandingContent.exportSetting.stepName, routerLink: '/integrations/qbo/main/configuration/export_settings'},
{label: this.brandingContent.importSetting.stepName, routerLink: '/integrations/qbo/main/configuration/import_settings'},
{label: this.brandingContent.advancedSettings.stepName, routerLink: '/integrations/qbo/main/configuration/advanced_settings'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class QboCloneSettingsComponent implements OnInit {
acceptWarning(data: ConfigurationWarningOut): void {
this.isWarningDialogVisible = false;
if (data.hasAccepted) {
this.router.navigate([`/integrations/qbo/onboarding/employee_settings`]);
this.router.navigate([`/integrations/qbo/onboarding/export_settings`]);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class QboOnboardingConnectorComponent implements OnInit, OnDestroy {
if (this.isContinueDisabled) {
return;
} else if (this.isCloneSettingsDisabled) {
this.router.navigate(['/integrations/qbo/onboarding/employee_settings']);
this.router.navigate(['/integrations/qbo/onboarding/export_settings']);
return;
}

Expand Down Expand Up @@ -145,7 +145,7 @@ export class QboOnboardingConnectorComponent implements OnInit, OnDestroy {
this.isContinueDisabled = false;
this.isCloneSettingsDisabled = true;
} else {
this.router.navigate(['/integrations/qbo/onboarding/employee_settings']);
this.router.navigate(['/integrations/qbo/onboarding/export_settings']);
}
});
}
Expand All @@ -167,11 +167,7 @@ export class QboOnboardingConnectorComponent implements OnInit, OnDestroy {
}

private handlePostQBOConnection(qboCredential: QBOCredential): void {
if (brandingFeatureConfig.featureFlags.mapEmployees) {
this.workspaceService.setOnboardingState(QBOOnboardingState.MAP_EMPLOYEES);
} else {
this.workspaceService.setOnboardingState(QBOOnboardingState.EXPORT_SETTINGS);
}
this.workspaceService.setOnboardingState(QBOOnboardingState.EXPORT_SETTINGS);

this.qboConnectionInProgress = false;
this.qboCompanyName = qboCredential.company_name;
Expand Down

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { RouterModule, Routes } from '@angular/router';
import { QboOnboardingComponent } from './qbo-onboarding.component';
import { QboOnboardingLandingComponent } from './qbo-onboarding-landing/qbo-onboarding-landing.component';
import { QboOnboardingConnectorComponent } from './qbo-onboarding-connector/qbo-onboarding-connector.component';
import { QboOnboardingEmployeeSettingsComponent } from './qbo-onboarding-employee-settings/qbo-onboarding-employee-settings.component';
import { QboOnboardingExportSettingsComponent } from './qbo-onboarding-export-settings/qbo-onboarding-export-settings.component';
import { QboOnboardingImportSettingsComponent } from './qbo-onboarding-import-settings/qbo-onboarding-import-settings.component';
import { QboOnboardingAdvancedSettingsComponent } from './qbo-onboarding-advanced-settings/qbo-onboarding-advanced-settings.component';
Expand All @@ -24,11 +23,6 @@ const routes: Routes = [
path: 'connector',
component: QboOnboardingConnectorComponent
},
{
path: 'employee_settings',
component: QboOnboardingEmployeeSettingsComponent,
canActivate: [QboTokenGuard]
},
{
path: 'export_settings',
component: QboOnboardingExportSettingsComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { QboOnboardingRoutingModule } from './qbo-onboarding-routing.module';
import { QboOnboardingComponent } from './qbo-onboarding.component';
import { QboOnboardingLandingComponent } from './qbo-onboarding-landing/qbo-onboarding-landing.component';
import { QboOnboardingConnectorComponent } from './qbo-onboarding-connector/qbo-onboarding-connector.component';
import { QboOnboardingEmployeeSettingsComponent } from './qbo-onboarding-employee-settings/qbo-onboarding-employee-settings.component';
import { QboOnboardingExportSettingsComponent } from './qbo-onboarding-export-settings/qbo-onboarding-export-settings.component';
import { QboOnboardingImportSettingsComponent } from './qbo-onboarding-import-settings/qbo-onboarding-import-settings.component';
import { QboOnboardingAdvancedSettingsComponent } from './qbo-onboarding-advanced-settings/qbo-onboarding-advanced-settings.component';
Expand All @@ -23,7 +22,6 @@ import { QboCloneSettingsComponent } from './qbo-clone-settings/qbo-clone-settin
QboOnboardingComponent,
QboOnboardingLandingComponent,
QboOnboardingConnectorComponent,
QboOnboardingEmployeeSettingsComponent,
QboOnboardingExportSettingsComponent,
QboOnboardingImportSettingsComponent,
QboOnboardingAdvancedSettingsComponent,
Expand Down

This file was deleted.

Empty file.
Loading

0 comments on commit 97ff48f

Please sign in to comment.