From bbce6cbb28c2c753399bf8cbed19f95480afac97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=BEe=20Fortun?= Date: Thu, 25 Jan 2024 16:05:17 +0100 Subject: [PATCH] Remove fuzzy match and sounds like dedup modifiers --- .../components/Admin/Module/UniqueValues.vue | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/client/web/compose/src/components/Admin/Module/UniqueValues.vue b/client/web/compose/src/components/Admin/Module/UniqueValues.vue index 6eaa421e0..13c503269 100644 --- a/client/web/compose/src/components/Admin/Module/UniqueValues.vue +++ b/client/web/compose/src/components/Admin/Module/UniqueValues.vue @@ -187,12 +187,26 @@ export default { }, modifierOptions () { + const ruleModifiers = this.rules.reduce((acc, { constraints }) => { + if (!constraints) { + return acc + } + + constraints.forEach(({ modifier }) => { + if (!acc.includes(modifier)) { + acc.push(modifier) + } + }) + + return acc + }, []) + return [ { value: 'ignore-case', text: this.$t('ignoreCase') }, - { value: 'fuzzy-match', text: this.$t('fuzzyMatch') }, - { value: 'sounds-like', text: this.$t('soundsLike') }, + { value: 'fuzzy-match', text: this.$t('fuzzyMatch'), legacy: true }, + { value: 'sounds-like', text: this.$t('soundsLike'), legacy: true }, { value: 'case-sensitive', text: this.$t('caseSensitive') }, - ] + ].filter(({ value, legacy }) => !legacy || ruleModifiers.includes(value)) }, multiValueOptions () {