DM-360 - skip ocr filter

This commit is contained in:
Valentin Mihai 2023-07-28 16:55:55 +03:00
parent 59fa4cdbdb
commit 58949e0596

View File

@ -17,15 +17,20 @@ import {
sortTopLeftToBottomRight,
sortTopRightToBottomLeft,
} from '../utils/sort-by-page-rotation.utils';
import { getConfig } from '@iqser/common-ui';
import { UserPreferenceService } from '@users/user-preference.service';
@Injectable()
export class AnnotationProcessingService {
readonly #isDocumine = getConfig().IS_DOCUMINE;
readonly #devMode = this._userPreferenceService.areDevFeaturesEnabled;
constructor(
private readonly _viewedPagesMapService: ViewedPagesMapService,
private readonly _fileDataService: FileDataService,
private readonly _state: FilePreviewStateService,
private readonly _defaultColorsService: DefaultColorsService,
private readonly _pageRotationService: PageRotationService,
private readonly _userPreferenceService: UserPreferenceService,
) {}
get secondaryAnnotationFilters(): INestedFilter[] {
@ -71,6 +76,9 @@ export class AnnotationProcessingService {
const filters: INestedFilter[] = [];
this._fileDataService.all?.forEach(a => {
if (this.#isDocumine && !this.#devMode && a.isOCR) {
return;
}
const topLevelFilter = a.topLevelFilter;
const filter = filterMap.get(a.filterKey);
if (filter) {