BUGFIX add MATCH_NONE to tag matching options

This commit is contained in:
konrad.lys@eu.equinix.com
2023-05-29 17:30:28 +02:00
parent f46ae73f49
commit 4f52778b23
5 changed files with 15 additions and 3 deletions

View File

@@ -19,6 +19,8 @@ String translateMatchingAlgorithmDescription(
return S.of(context)!.documentContainsAWordSimilarToThisWord; return S.of(context)!.documentContainsAWordSimilarToThisWord;
case MatchingAlgorithm.auto: case MatchingAlgorithm.auto:
return S.of(context)!.learnMatchingAutomatically; return S.of(context)!.learnMatchingAutomatically;
case MatchingAlgorithm.none:
return S.of(context)!.disableMatching;
} }
} }
@@ -39,5 +41,7 @@ String translateMatchingAlgorithmName(
return S.of(context)!.fuzzy; return S.of(context)!.fuzzy;
case MatchingAlgorithm.auto: case MatchingAlgorithm.auto:
return S.of(context)!.auto; return S.of(context)!.auto;
case MatchingAlgorithm.none:
return S.of(context)!.none;
} }
} }

View File

@@ -103,7 +103,8 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
onChanged: (val) { onChanged: (val) {
setState(() { setState(() {
_errors = {}; _errors = {};
_enableMatchFormField = val != MatchingAlgorithm.auto.value; _enableMatchFormField = val != MatchingAlgorithm.auto.value &&
val != MatchingAlgorithm.none.value;
}); });
}, },
items: MatchingAlgorithm.values items: MatchingAlgorithm.values
@@ -147,7 +148,9 @@ class _LabelFormState<T extends Label> extends State<LabelForm<T>> {
..._formKey.currentState!.value ..._formKey.currentState!.value
}; };
if (mergedJson[Label.matchingAlgorithmKey] == 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. // If auto is selected, the match will be removed.
mergedJson[Label.matchKey] = ''; mergedJson[Label.matchKey] = '';
} }

View File

@@ -574,6 +574,10 @@
"@documentMatchesThisRegularExpression": {}, "@documentMatchesThisRegularExpression": {},
"regularExpression": "Regular Expression", "regularExpression": "Regular Expression",
"@regularExpression": {}, "@regularExpression": {},
"disableMatching": "Do not tag documents automatically",
"@disableMatching": {},
"none": "None",
"@none": {},
"anInternetConnectionCouldNotBeEstablished": "An internet connection could not be established.", "anInternetConnectionCouldNotBeEstablished": "An internet connection could not be established.",
"@anInternetConnectionCouldNotBeEstablished": {}, "@anInternetConnectionCouldNotBeEstablished": {},
"done": "Done", "done": "Done",

View File

@@ -13,7 +13,7 @@ dependencies:
logging: ^1.1.1 logging: ^1.1.1
flutter: flutter:
sdk: flutter sdk: flutter
http: ^1.0.0 http: ^0.13.4
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

View File

@@ -2,6 +2,7 @@ import 'package:json_annotation/json_annotation.dart';
@JsonEnum(valueField: 'value') @JsonEnum(valueField: 'value')
enum MatchingAlgorithm { enum MatchingAlgorithm {
none(0, "None: Disable matching"),
anyWord(1, "Any: Match one of the following words"), anyWord(1, "Any: Match one of the following words"),
allWords(2, "All: Match all of the following words"), allWords(2, "All: Match all of the following words"),
exactMatch(3, "Exact: Match the following string"), exactMatch(3, "Exact: Match the following string"),