From 8e9aa5f6286a15c818a47344fc80964f5288bb52 Mon Sep 17 00:00:00 2001
From: Wolfgang Müller
Date: Thu, 20 Feb 2025 15:24:42 +0100
Subject: frontend: Allow filtering for orphaned associations

With the association count filters in place we may now also allow the
user to filter for associations that do not have a matching counterparts
(artists without a comic, for example).
---
 frontend/src/routes/namespaces/+page.svelte | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'frontend/src/routes/namespaces/+page.svelte')

diff --git a/frontend/src/routes/namespaces/+page.svelte b/frontend/src/routes/namespaces/+page.svelte
index d8e728d..429432f 100644
--- a/frontend/src/routes/namespaces/+page.svelte
+++ b/frontend/src/routes/namespaces/+page.svelte
@@ -3,7 +3,7 @@
 	import { fetchNamespace, namespacesQuery } from '$gql/Queries';
 	import type { Namespace } from '$gql/graphql';
 	import { NamespaceSortLabel } from '$lib/Enums';
-	import { BasicFilterContext } from '$lib/Filter.svelte';
+	import { NamespaceFilterContext } from '$lib/Filter.svelte';
 	import { quickComicFilter } from '$lib/Navigation';
 	import { toastFinally } from '$lib/Toasts';
 	import AddButton from '$lib/components/AddButton.svelte';
@@ -20,6 +20,7 @@
 	import { initSelectionContext } from '$lib/selection/Selection.svelte';
 	import SelectionOverlay from '$lib/selection/SelectionOverlay.svelte';
 	import DeleteSelection from '$lib/toolbar/DeleteSelection.svelte';
+	import FilterOrphaned from '$lib/toolbar/FilterOrphaned.svelte';
 	import Search from '$lib/toolbar/Search.svelte';
 	import SelectItems from '$lib/toolbar/SelectItems.svelte';
 	import SelectSort from '$lib/toolbar/SelectSort.svelte';
@@ -44,9 +45,9 @@
 		}
 	});
 
-	let filter = $state(new BasicFilterContext(data.filter));
+	let filter = $state(new NamespaceFilterContext(data.filter));
 	$effect(() => {
-		filter = new BasicFilterContext(data.filter);
+		filter = new NamespaceFilterContext(data.filter);
 	});
 
 	const edit = (id: number) => {
@@ -69,6 +70,7 @@
 		{/snippet}
 		{#snippet center()}
 			<Search name="Namespaces" {filter} bind:field={filter.include.name.contains} />
+			<FilterOrphaned {filter} />
 			<SelectSort {sort} labels={NamespaceSortLabel} />
 			<SelectItems {pagination} />
 		{/snippet}
-- 
cgit v1.2.3-2-gb3c3

