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;
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;
}
}

View File

@@ -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] = '';
}

View File

@@ -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",

View File

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

View File

@@ -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"),