From 9c460c6db7e6a4e7f8ed3e8d93032c7ef070efee Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Thu, 20 Feb 2025 13:40:40 +0100 Subject: Add filter for association counts This will replace the old 'empty' filter on comic associations and introduce a generic way of matching against association counts, along with support for different operators like 'greater than' or 'lower than'. Models that did not previously have a way of matching against their associates (like filtering for Artists that have N comics associated with them) now gain that functionality. For now the frontend keeps the simpler approach of allowing the user to only filter for empty associations, but we nonetheless need to adjust the 'empty' field to instead be linked to the new 'count' field. --- frontend/src/lib/Enums.ts | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'frontend/src/lib/Enums.ts') diff --git a/frontend/src/lib/Enums.ts b/frontend/src/lib/Enums.ts index 3264de4..db9fb86 100644 --- a/frontend/src/lib/Enums.ts +++ b/frontend/src/lib/Enums.ts @@ -10,6 +10,7 @@ import { Language, Layout, NamespaceSort, + Operator, Rating, TagSort, UpdateMode, @@ -125,6 +126,12 @@ export const UpdateModeLabel: Record = { [UpdateMode.Replace]: 'Replace' }; +export const OperatorLabel: Record = { + [Operator.Equal]: 'Equal', + [Operator.GreaterThan]: 'Greater than', + [Operator.LowerThan]: 'Lower than,' +}; + export const LanguageLabel: Record = { [Language.Ab]: 'Abkhazian', [Language.Aa]: 'Afar', -- cgit v1.2.3-2-gb3c3