Skip to content
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

chore:removing bulkfyle from mobile-app #3241

Merged
merged 5 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions src/app/fyle/my-expenses/my-expenses.page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ describe('MyExpensesPage', () => {
inputElement = component.simpleSearchInput.nativeElement;
});

it('should set isNewReportsFlowEnabled, isInstaFyleEnabled, isBulkFyleEnabled, isMileageEnabled and isPerDiemEnabled to true if orgSettings and orgUserSettings properties are enabled', fakeAsync(() => {
it('should set isNewReportsFlowEnabled, isInstaFyleEnabled, isMileageEnabled and isPerDiemEnabled to true if orgSettings and orgUserSettings properties are enabled', fakeAsync(() => {
component.ionViewWillEnter();
tick(500);
expect(component.expensesTaskCount).toBe(10);
Expand All @@ -526,9 +526,6 @@ describe('MyExpensesPage', () => {
component.isInstaFyleEnabled$.subscribe((isInstaFyleEnabled) => {
expect(isInstaFyleEnabled).toBeTrue();
});
component.isBulkFyleEnabled$.subscribe((isBulkFyleEnabled) => {
expect(isBulkFyleEnabled).toBeTrue();
});
component.isMileageEnabled$.subscribe((isMileageEnabled) => {
expect(isMileageEnabled).toBeTrue();
});
Expand All @@ -537,7 +534,7 @@ describe('MyExpensesPage', () => {
});
}));

it('should set isNewReportsFlowEnabled, isInstaFyleEnabled, isBulkFyleEnabled, isMileageEnabled and isPerDiemEnabled to false if orgSettings and orgUserSettings properties are disabled', fakeAsync(() => {
it('should set isNewReportsFlowEnabled, isInstaFyleEnabled, isMileageEnabled and isPerDiemEnabled to false if orgSettings and orgUserSettings properties are disabled', fakeAsync(() => {
const mockOrgUserSettingsData = cloneDeep(orgUserSettingsData);
const mockOrgSettingsData = cloneDeep(orgSettingsRes);
mockOrgUserSettingsData.insta_fyle_settings.enabled = false;
Expand All @@ -557,9 +554,6 @@ describe('MyExpensesPage', () => {
component.isInstaFyleEnabled$.subscribe((isInstaFyleEnabled) => {
expect(isInstaFyleEnabled).toBeFalse();
});
component.isBulkFyleEnabled$.subscribe((isBulkFyleEnabled) => {
expect(isBulkFyleEnabled).toBeFalse();
});
component.isMileageEnabled$.subscribe((isMileageEnabled) => {
expect(isMileageEnabled).toBeFalse();
});
Expand All @@ -568,7 +562,7 @@ describe('MyExpensesPage', () => {
});
}));

it('should set isNewReportsFlowEnabled, isInstaFyleEnabled, isBulkFyleEnabled, isMileageEnabled and isPerDiemEnabled to false if orgSettings and orgUserSettings properties are not allowed', fakeAsync(() => {
it('should set isNewReportsFlowEnabled, isInstaFyleEnabled, isMileageEnabled and isPerDiemEnabled to false if orgSettings and orgUserSettings properties are not allowed', fakeAsync(() => {
const mockOrgUserSettingsData = cloneDeep(orgUserSettingsData);
mockOrgUserSettingsData.insta_fyle_settings.allowed = false;
mockOrgUserSettingsData.bulk_fyle_settings.allowed = false;
Expand All @@ -584,9 +578,6 @@ describe('MyExpensesPage', () => {
component.isInstaFyleEnabled$.subscribe((isInstaFyleEnabled) => {
expect(isInstaFyleEnabled).toBeFalse();
});
component.isBulkFyleEnabled$.subscribe((isBulkFyleEnabled) => {
expect(isBulkFyleEnabled).toBeTrue();
});
component.isMileageEnabled$.subscribe((isMileageEnabled) => {
expect(isMileageEnabled).toBeTrue();
});
Expand All @@ -595,7 +586,7 @@ describe('MyExpensesPage', () => {
});
}));

it('should set isInstaFyleEnabled, isBulkFyleEnabled, isMileageEnabled and isPerDiemEnabled to undefined if orgUserSettings and orgSettings are undefined', fakeAsync(() => {
it('should set isInstaFyleEnabled, isMileageEnabled and isPerDiemEnabled to undefined if orgUserSettings and orgSettings are undefined', fakeAsync(() => {
orgUserSettingsService.get.and.returnValue(of(undefined));
orgSettingsService.get.and.returnValue(of(undefined));

Expand All @@ -609,9 +600,6 @@ describe('MyExpensesPage', () => {
component.isInstaFyleEnabled$.subscribe((isInstaFyleEnabled) => {
expect(isInstaFyleEnabled).toBeUndefined();
});
component.isBulkFyleEnabled$.subscribe((isBulkFyleEnabled) => {
expect(isBulkFyleEnabled).toBeUndefined();
});
component.isMileageEnabled$.subscribe((isMileageEnabled) => {
expect(isMileageEnabled).toBeUndefined();
});
Expand Down
6 changes: 0 additions & 6 deletions src/app/fyle/my-expenses/my-expenses.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ export class MyExpensesPage implements OnInit {

isInstaFyleEnabled$: Observable<boolean>;

isBulkFyleEnabled$: Observable<boolean>;

isMileageEnabled$: Observable<boolean>;

isPerDiemEnabled$: Observable<boolean>;
Expand Down Expand Up @@ -465,10 +463,6 @@ export class MyExpensesPage implements OnInit {
)
);

this.isBulkFyleEnabled$ = getOrgUserSettingsService$.pipe(
map((orgUserSettings) => orgUserSettings?.bulk_fyle_settings?.enabled)
);

this.orgSettings$ = this.orgSettingsService.get().pipe(shareReplay(1));
this.specialCategories$ = this.categoriesService.getMileageOrPerDiemCategories().pipe(shareReplay(1));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
{{ isBulkMode ? 'Bulk Mode' : 'Single Mode' }}
</div>
</div>
<div *ngIf="allowBulkFyle" class="camera-preview__bottom-container__icon-block text-center">
<div class="camera-preview__bottom-container__icon-block text-center">
<ng-container *ngIf="noOfReceipts === 0; else receiptPreviewIcon">
<div (click)="onSwitchMode()">
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

@Input() allowGalleryUploads = true;

@Input() allowBulkFyle = true;

@Input() lastCapturedReceipt: string;

@Input() noOfReceipts = 0;
Expand Down Expand Up @@ -54,11 +52,11 @@
private cameraPreviewService: CameraPreviewService
) {}

get CameraState() {

Check failure on line 55 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function

Check failure on line 55 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function
return CameraState;
}

setUpAndStartCamera() {

Check failure on line 59 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function

Check failure on line 59 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function
this.isIos = this.devicePlatform === 'ios';
if (this.devicePlatform === 'web') {
this.startCameraPreview();
Expand All @@ -79,7 +77,7 @@
}
}

startCameraPreview() {

Check failure on line 80 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function

Check failure on line 80 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function
if (![CameraState.STARTING, CameraState.RUNNING].includes(this.cameraState)) {
this.cameraState = CameraState.STARTING;
const cameraPreviewOptions: CameraPreviewOptions = {
Expand All @@ -91,22 +89,22 @@
disableAudio: true,
};

from(this.cameraPreviewService.start(cameraPreviewOptions)).subscribe((_) => {

Check failure on line 92 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

'_' is defined but never used

Check failure on line 92 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

'_' is defined but never used
this.cameraState = CameraState.RUNNING;
this.getFlashModes();
});
}
}

stopCamera() {

Check failure on line 99 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function

Check failure on line 99 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function
//Stop camera only if it is in RUNNING state
if (this.cameraState === CameraState.RUNNING) {
this.cameraState = CameraState.STOPPING;
from(this.cameraPreviewService.stop()).subscribe((_) => (this.cameraState = CameraState.STOPPED));

Check failure on line 103 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

'_' is defined but never used

Check failure on line 103 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

'_' is defined but never used
}
}

getFlashModes() {

Check failure on line 107 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function

Check failure on line 107 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function
if (this.devicePlatform !== 'web') {
from(this.cameraPreviewService.getSupportedFlashModes()).subscribe((flashModes) => {
const requiredFlashModesPresent = flashModes.result?.includes('on') && flashModes.result?.includes('off');
Expand All @@ -118,7 +116,7 @@
}
}

onToggleFlashMode() {

Check failure on line 119 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function

Check failure on line 119 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function
if (this.devicePlatform !== 'web') {
let nextActiveFlashMode: 'on' | 'off' = 'on';
if (this.flashMode === 'on') {
Expand All @@ -131,12 +129,12 @@
}
}

onGalleryUpload() {

Check failure on line 132 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function

Check failure on line 132 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function
this.stopCamera();
this.galleryUpload.emit();
}

onSwitchMode() {

Check failure on line 137 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function

Check failure on line 137 in src/app/shared/components/capture-receipt/camera-preview/camera-preview.component.ts

View workflow job for this annotation

GitHub Actions / Run linters

Missing return type on function
this.switchMode.emit();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[isBulkMode]="isBulkMode"
[isOffline]="isOffline$ | async"
[allowGalleryUploads]="allowGalleryUploads"
[allowBulkFyle]="allowBulkFyle"
[lastCapturedReceipt]="lastCapturedReceipt"
[noOfReceipts]="noOfReceipts"
[isBulkModePromptShown]="isBulkModePromptShown"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export class CaptureReceiptComponent implements OnInit, OnDestroy, AfterViewInit

@Input() allowGalleryUploads = true;

@Input() allowBulkFyle = true;

isBulkMode: boolean;

noOfReceipts = 0;
Expand Down
Loading