mirror of
https://github.com/Xevion/paperless-mobile.git
synced 2025-12-10 06:07:57 -06:00
BUGFIX add MATCH_NONE to tag matching options
This commit is contained in:
@@ -19,6 +19,8 @@ String translateMatchingAlgorithmDescription(
|
||||
return S.of(context)!.documentContainsAWordSimilarToThisWord;
|
||||
case MatchingAlgorithm.auto:
|
||||
return S.of(context)!.learnMatchingAutomatically;
|
||||
case MatchingAlgorithm.none:
|
||||
return S.of(context)!.disableMatching;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,5 +41,7 @@ String translateMatchingAlgorithmName(
|
||||
return S.of(context)!.fuzzy;
|
||||
case MatchingAlgorithm.auto:
|
||||
return S.of(context)!.auto;
|
||||
case MatchingAlgorithm.none:
|
||||
return S.of(context)!.none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,8 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
|
||||
onChanged: (val) {
|
||||
setState(() {
|
||||
_errors = {};
|
||||
_enableMatchFormField = val != MatchingAlgorithm.auto.value;
|
||||
_enableMatchFormField = val != MatchingAlgorithm.auto.value &&
|
||||
val != MatchingAlgorithm.none.value;
|
||||
});
|
||||
},
|
||||
items: MatchingAlgorithm.values
|
||||
@@ -147,7 +148,9 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
|
||||
..._formKey.currentState!.value
|
||||
};
|
||||
if (mergedJson[Label.matchingAlgorithmKey] ==
|
||||
MatchingAlgorithm.auto.value) {
|
||||
MatchingAlgorithm.auto.value ||
|
||||
mergedJson[Label.matchingAlgorithmKey] ==
|
||||
MatchingAlgorithm.none.value) {
|
||||
// If auto is selected, the match will be removed.
|
||||
mergedJson[Label.matchKey] = '';
|
||||
}
|
||||
|
||||
@@ -574,6 +574,10 @@
|
||||
"@documentMatchesThisRegularExpression": {},
|
||||
"regularExpression": "Regular Expression",
|
||||
"@regularExpression": {},
|
||||
"disableMatching": "Do not tag documents automatically",
|
||||
"@disableMatching": {},
|
||||
"none": "None",
|
||||
"@none": {},
|
||||
"anInternetConnectionCouldNotBeEstablished": "An internet connection could not be established.",
|
||||
"@anInternetConnectionCouldNotBeEstablished": {},
|
||||
"done": "Done",
|
||||
|
||||
@@ -13,7 +13,7 @@ dependencies:
|
||||
logging: ^1.1.1
|
||||
flutter:
|
||||
sdk: flutter
|
||||
http: ^1.0.0
|
||||
http: ^0.13.4
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
@JsonEnum(valueField: 'value')
|
||||
enum MatchingAlgorithm {
|
||||
none(0, "None: Disable matching"),
|
||||
anyWord(1, "Any: Match one of the following words"),
|
||||
allWords(2, "All: Match all of the following words"),
|
||||
exactMatch(3, "Exact: Match the following string"),
|
||||
|
||||
Reference in New Issue
Block a user