-
Notifications
You must be signed in to change notification settings - Fork 0
feat: move employee settings to export settings #1115
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
f007f82
feat: move employee settings to export settings
0d98a6c
qbo export settings
107f24d
lint fix
6f3bfa1
Merge branch 'master' into move-emp-settings-to-export-settings
eb73fbf
html
0498ad3
Merge branch 'master' into move-emp-settings-to-export-settings
bc64554
removed employee settings component
4c694f7
fix lint
ed460a1
fix tests
e34e15e
fix onboarding
35712f1
lint fix
244ac58
pr comments
a14dcde
lint fix
7890ba2
pr comments
fbfbfce
pr comment / 2
7c13382
Merge branch 'master' into move-emp-settings-to-export-settings
ff7e00d
Merge branch 'master' into move-emp-settings-to-export-settings
fc0c373
Merge branch 'master' into move-emp-settings-to-export-settings
cca8b61
pr comments
f51b05c
lint fix
1cc3a13
pr comment
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,6 +146,53 @@ | |
| this.windowReference = this.windowService.nativeWindow; | ||
| } | ||
|
|
||
| isEmployeeMappingDisabled(): boolean { | ||
| const exportType = this.exportSettingForm.get('reimbursableExportType')?.value; | ||
| return exportType === QBOReimbursableExpensesObject.BILL || | ||
| exportType === QBOReimbursableExpensesObject.CHECK || | ||
| exportType === QBOReimbursableExpensesObject.EXPENSE; | ||
| } | ||
|
|
||
| setupExportTypeWatcher(): void { | ||
| this.exportSettingForm.get('reimbursableExportType')?.valueChanges.subscribe((exportType) => { | ||
| const employeeMappingControl = this.employeeSettingForm.get('employeeMapping'); | ||
|
|
||
| if (exportType === QBOReimbursableExpensesObject.BILL) { | ||
| employeeMappingControl?.patchValue(EmployeeFieldMapping.VENDOR); | ||
| employeeMappingControl?.disable(); | ||
| } else if (exportType === QBOReimbursableExpensesObject.CHECK) { | ||
| employeeMappingControl?.patchValue(EmployeeFieldMapping.EMPLOYEE); | ||
| employeeMappingControl?.disable(); | ||
| } else if (exportType === QBOReimbursableExpensesObject.EXPENSE) { | ||
| employeeMappingControl?.patchValue(EmployeeFieldMapping.EMPLOYEE); | ||
anishfyle marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| employeeMappingControl?.enable(); | ||
| } else if (exportType === QBOReimbursableExpensesObject.JOURNAL_ENTRY) { | ||
| employeeMappingControl?.enable(); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| getAllReimbursableExportTypeOptions(): SelectFormOption[] { | ||
| return [ | ||
| { | ||
| label: 'Check', | ||
| value: QBOReimbursableExpensesObject.CHECK | ||
| }, | ||
| { | ||
| label: 'Bill', | ||
| value: QBOReimbursableExpensesObject.BILL | ||
| }, | ||
| { | ||
| label: 'Expense', | ||
| value: QBOReimbursableExpensesObject.EXPENSE | ||
| }, | ||
| { | ||
| label: 'Journal Entry', | ||
| value: QBOReimbursableExpensesObject.JOURNAL_ENTRY | ||
| } | ||
| ]; | ||
| } | ||
|
Comment on lines
+173
to
+192
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 Move export type options to model class The export type options should be moved to the Consider moving this logic to the model: -getAllReimbursableExportTypeOptions(): SelectFormOption[] {
- return [
- {
- label: 'Check',
- value: QBOReimbursableExpensesObject.CHECK
- },
- {
- label: 'Bill',
- value: QBOReimbursableExpensesObject.BILL
- },
- {
- label: 'Expense',
- value: QBOReimbursableExpensesObject.EXPENSE
- },
- {
- label: 'Journal Entry',
- value: QBOReimbursableExpensesObject.JOURNAL_ENTRY
- }
- ];
-}And in static getAllReimbursableExportTypeOptions(): SelectFormOption[] {
return Object.values(QBOReimbursableExpensesObject).map(value => ({
label: value.replace(/_/g, ' ').toLowerCase()
.replace(/\b\w/g, l => l.toUpperCase()),
value
}));
} |
||
|
|
||
| constructPayloadAndSave(data: ConfigurationWarningOut): void { | ||
| this.isConfirmationDialogVisible = false; | ||
| if (data.hasAccepted) { | ||
|
|
@@ -484,10 +531,9 @@ | |
|
|
||
| this.isMultilineOption = brandingConfig.brandId !== 'co' ? true : false; | ||
|
|
||
| this.setupExportTypeWatcher(); | ||
| this.setupCustomWatchers(); | ||
|
|
||
| this.setupCustomDateOptionWatchers(); | ||
|
|
||
| this.optionSearchWatcher(); | ||
|
|
||
| this.exportSettingService.setExportTypeValidatorsAndWatchers(exportModuleRule, this.exportSettingForm); | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.