From 36158609f099d5c41e8ec263912997bd8d939121 Mon Sep 17 00:00:00 2001 From: Nico Fricke Date: Mon, 1 Aug 2022 09:22:13 +0200 Subject: [PATCH] change default matching algo to auto and move to constant --- .../correspondent-edit-dialog.component.ts | 3 ++- .../document-type-edit-dialog.component.ts | 3 ++- .../storage-path-edit-dialog.component.ts | 3 ++- .../edit-dialog/tag-edit-dialog/tag-edit-dialog.component.ts | 3 ++- src-ui/src/app/data/matching-model.ts | 1 + 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src-ui/src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.ts b/src-ui/src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.ts index cba0a922a..86be7414d 100644 --- a/src-ui/src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.ts +++ b/src-ui/src/app/components/common/edit-dialog/correspondent-edit-dialog/correspondent-edit-dialog.component.ts @@ -2,6 +2,7 @@ import { Component } from '@angular/core' import { FormControl, FormGroup } from '@angular/forms' import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' import { EditDialogComponent } from 'src/app/components/common/edit-dialog/edit-dialog.component' +import { DEFAULT_MATCHING_ALGORITHM } from 'src/app/data/matching-model' import { PaperlessCorrespondent } from 'src/app/data/paperless-correspondent' import { CorrespondentService } from 'src/app/services/rest/correspondent.service' import { ToastService } from 'src/app/services/toast.service' @@ -31,7 +32,7 @@ export class CorrespondentEditDialogComponent extends EditDialogComponent { name: new FormControl(''), color: new FormControl(randomColor()), is_inbox_tag: new FormControl(false), - matching_algorithm: new FormControl(1), + matching_algorithm: new FormControl(DEFAULT_MATCHING_ALGORITHM), match: new FormControl(''), is_insensitive: new FormControl(true), }) diff --git a/src-ui/src/app/data/matching-model.ts b/src-ui/src/app/data/matching-model.ts index e228893d6..8ce05528e 100644 --- a/src-ui/src/app/data/matching-model.ts +++ b/src-ui/src/app/data/matching-model.ts @@ -6,6 +6,7 @@ export const MATCH_LITERAL = 3 export const MATCH_REGEX = 4 export const MATCH_FUZZY = 5 export const MATCH_AUTO = 6 +export const DEFAULT_MATCHING_ALGORITHM = MATCH_AUTO export const MATCHING_ALGORITHMS = [ {