This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Clone Settings complete reimbursable export settings #285
Merged
Merged
Changes from 16 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
59620b1
Employee Mapping and Import settings reimbursable
NileshPant1999 e0d34df
add support
NileshPant1999 84a44a2
add support
NileshPant1999 18ccfe3
add support
NileshPant1999 5f91d35
[CodeFactor] Apply fixes
code-factor 0a6f17a
test fix
NileshPant1999 e5d19b2
Merge branch 'clone-settings-qbo' of https://github.com/fylein/fyle-q…
NileshPant1999 1ab311f
use legecy mat dialog
NileshPant1999 21a6914
foix
NileshPant1999 57f954b
export settings
NileshPant1999 375a1bc
test fix and minor updates
NileshPant1999 7206491
[CodeFactor] Apply fixes
code-factor 5b569bf
lint fix
NileshPant1999 cacb30e
merge master;
NileshPant1999 f831fc8
lint test fix
NileshPant1999 c2d35d4
f
NileshPant1999 3c88a38
ccc export settings changes
NileshPant1999 c8335f9
fix comments
NileshPant1999 62f4809
[CodeFactor] Apply fixes
code-factor fdc9bc9
asd
NileshPant1999 e0f66fd
lint fix
NileshPant1999 34e7c03
Merge branch 'clone-settings-qbo-2' of https://github.com/fylein/fyle…
NileshPant1999 236296a
df
NileshPant1999 3ca82d8
add fix
NileshPant1999 7d394fa
fix
NileshPant1999 e592677
[CodeFactor] Apply fixes
code-factor 4b31663
minor change
NileshPant1999 9367240
Merge branch 'clone-settings-ccc' of https://github.com/fylein/fyle-q…
NileshPant1999 e05a557
lint fix
NileshPant1999 5294818
initial draft
NileshPant1999 d9881cc
addition
NileshPant1999 01770a1
fix test
NileshPant1999 5f36a0c
lint fix
NileshPant1999 494b432
lint fix
NileshPant1999 c204612
Merge branch 'clone-settings-ccc' of https://github.com/fylein/fyle-q…
NileshPant1999 bfef99b
merged master
NileshPant1999 dd99f61
sad
NileshPant1999 495e575
asd
NileshPant1999 2f8f483
lint fix and add tests
NileshPant1999 b437e33
as
NileshPant1999 e3f7a31
asd
NileshPant1999 0776472
add more test
NileshPant1999 1bc3e80
add
NileshPant1999 4f4b75d
merged master
NileshPant1999 0fddde6
asd
NileshPant1999 9f93625
add more tests
NileshPant1999 1bf7548
add fix
NileshPant1999 dd1287c
comments resolved
NileshPant1999 7495e8d
oioi
NileshPant1999 3cfc3ef
comments relolved
NileshPant1999 fcc4898
comment resolved
NileshPant1999 a970033
clone settings corporate credit card export settings (#286)
NileshPant1999 8cbc9e9
merged master
NileshPant1999 f7acd13
conflicts fix
NileshPant1999 5d6e417
merged imported settings
NileshPant1999 b2a6b11
merged master
NileshPant1999 00ad64d
clone settings Advance Settings (#298)
NileshPant1999 e471be4
Bug fixes and increase test coverage for clone settings changes (#299)
NileshPant1999 d65fcd8
QA fixes for clone setting flow of QBO App (#300)
NileshPant1999 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 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 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 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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { MatLegacyDialogModule as MatDialogModule } from '@angular/material/legacy-dialog'; | ||
|
||
|
||
@NgModule({ | ||
declarations: [], | ||
imports: [ | ||
CommonModule | ||
CommonModule, | ||
MatDialogModule | ||
] | ||
}) | ||
export class CoreModule { } |
This file contains 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { FormGroup } from "@angular/forms"; | ||
import { AdvancedSettingGet, AdvancedSettingModel, AdvancedSettingPost } from "./advanced-setting.model"; | ||
import { ExportSettingGet, ExportSettingModel, ExportSettingPost } from "./export-setting.model"; | ||
import { ImportSettingGet, ImportSettingModel, ImportSettingPost } from "./import-setting.model"; | ||
import { MappingSetting } from "../db/mapping-setting.model"; | ||
import { EmployeeSettingGet, EmployeeSettingModel, EmployeeSettingPost } from "./employee-setting.model"; | ||
|
||
export type CloneSetting = { | ||
workspace_id: number, | ||
export_settings: ExportSettingGet, | ||
import_settings: ImportSettingGet, | ||
advanced_settings: AdvancedSettingGet, | ||
employee_mappings: EmployeeSettingGet | ||
} | ||
|
||
export type CloneSettingPost = { | ||
export_settings: ExportSettingPost, | ||
Import_settings: ImportSettingPost, | ||
Advanced_settings: AdvancedSettingPost, | ||
employee_mappings: EmployeeSettingPost | ||
} | ||
|
||
export type CloneSettingExist = { | ||
is_available: boolean, | ||
workspace_name: string | ||
} | ||
|
||
export class CloneSettingModel { | ||
static constructPayload(cloneSettingsForm: FormGroup, customMappingSettings: MappingSetting[]): CloneSettingPost { | ||
|
||
const exportSettingPayload = ExportSettingModel.constructPayload(cloneSettingsForm); | ||
const importSettingPayload = ImportSettingModel.constructPayload(cloneSettingsForm, customMappingSettings); | ||
const advancedSettingPayload = AdvancedSettingModel.constructPayload(cloneSettingsForm); | ||
const employeeMappingPayload = EmployeeSettingModel.constructPayload(cloneSettingsForm); | ||
|
||
const cloneSettingPayload: CloneSettingPost = { | ||
export_settings: exportSettingPayload, | ||
Import_settings: importSettingPayload, | ||
Advanced_settings: advancedSettingPayload, | ||
employee_mappings: employeeMappingPayload | ||
}; | ||
|
||
return cloneSettingPayload; | ||
} | ||
} |
This file contains 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 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 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 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
41 changes: 41 additions & 0 deletions
41
src/app/core/services/configuration/clone-setting.service.spec.ts
This file contains 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { TestBed, getTestBed } from '@angular/core/testing'; | ||
|
||
import { CloneSettingService } from './clone-setting.service'; | ||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; | ||
import { mockCloneSettingsGet } from 'src/app/integration/onboarding/clone-settings/clone-settings.fixture'; | ||
import { environment } from 'src/environments/environment'; | ||
import { WorkspaceService } from '../workspace/workspace.service'; | ||
|
||
describe('CloneSettingService', () => { | ||
let service: CloneSettingService; | ||
let injector: TestBed; | ||
let httpMock: HttpTestingController; | ||
const API_BASE_URL = environment.api_url; | ||
const workspace_id = environment.tests.workspaceId; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [ | ||
HttpClientTestingModule | ||
] | ||
}); | ||
injector = getTestBed(); | ||
service = TestBed.inject(CloneSettingService); | ||
httpMock = injector.inject(HttpTestingController); | ||
}); | ||
|
||
it('should be created', () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
|
||
it('should get Clone Settings', () => { | ||
service.getCloneSettings().subscribe(value => { | ||
expect(value).toEqual(mockCloneSettingsGet); | ||
}); | ||
const req = httpMock.expectOne({ | ||
method: 'GET', | ||
url: `${API_BASE_URL}/v2/workspaces/${workspace_id}/clone_settings/` | ||
}); | ||
req.flush(mockCloneSettingsGet); | ||
}); | ||
}); |
31 changes: 31 additions & 0 deletions
31
src/app/core/services/configuration/clone-setting.service.ts
This file contains 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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
import { CloneSetting, CloneSettingExist, CloneSettingPost } from '../../models/configuration/clone-setting.model'; | ||
import { ApiService } from '../core/api.service'; | ||
import { WorkspaceService } from '../workspace/workspace.service'; | ||
|
||
@Injectable({ | ||
providedIn: 'root' | ||
}) | ||
|
||
export class CloneSettingService { | ||
|
||
workspaceId = this.workspaceService.getWorkspaceId(); | ||
|
||
constructor( | ||
private apiService: ApiService, | ||
private workspaceService: WorkspaceService | ||
) { } | ||
|
||
checkCloneSettingsExists(): Observable<CloneSettingExist> { | ||
return this.apiService.get(`/user/clone_settings/exists/`, {}); | ||
} | ||
|
||
getCloneSettings(): Observable<CloneSetting> { | ||
return this.apiService.get(`/v2/workspaces/${this.workspaceId}/clone_settings/`, {}); | ||
} | ||
|
||
saveCloneSettings(cloneSettingsPayload: CloneSettingPost): Observable<CloneSetting> { | ||
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. postClone... |
||
return this.apiService.put(`/v2/workspaces/${this.workspaceId}/clone_settings/`, cloneSettingsPayload); | ||
} | ||
} |
This file contains 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
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.
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.
why do we need
AutoMapEmployee
orEmployeeFieldMapping
as a part of export setting?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.
@ashwin1111 this was an initial change, will remove it added it earlier forget to remove.