aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/lists
diff options
context:
space:
mode:
authorMohamed Bassem <me@mbassem.com>2025-04-27 00:02:20 +0100
committerGitHub <noreply@github.com>2025-04-27 00:02:20 +0100
commit136f126296af65f50da598d084d1485c0e40437a (patch)
tree2725c7932ebbcb9b48b5af98eb9b72329a400260 /apps/web/components/dashboard/lists
parentca47be7fe7be128f459c37614a04902a873fe289 (diff)
downloadkarakeep-136f126296af65f50da598d084d1485c0e40437a.tar.zst
feat: Implement generic rule engine (#1318)
* Add schema for the new rule engine * Add rule engine backend logic * Implement the worker logic and event firing * Implement the UI changesfor the rule engine * Ensure that when a referenced list or tag are deleted, the corresponding event/action is * Dont show smart lists in rule engine events * Add privacy validations for attached tag and list ids * Move the rules logic into a models
Diffstat (limited to 'apps/web/components/dashboard/lists')
-rw-r--r--apps/web/components/dashboard/lists/BookmarkListSelector.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/web/components/dashboard/lists/BookmarkListSelector.tsx b/apps/web/components/dashboard/lists/BookmarkListSelector.tsx
index db37efc0..9ce56031 100644
--- a/apps/web/components/dashboard/lists/BookmarkListSelector.tsx
+++ b/apps/web/components/dashboard/lists/BookmarkListSelector.tsx
@@ -7,8 +7,10 @@ import {
SelectValue,
} from "@/components/ui/select";
import LoadingSpinner from "@/components/ui/spinner";
+import { cn } from "@/lib/utils";
import { useBookmarkLists } from "@karakeep/shared-react/hooks/lists";
+import { ZBookmarkList } from "@karakeep/shared/types/lists";
export function BookmarkListSelector({
value,
@@ -16,12 +18,16 @@ export function BookmarkListSelector({
hideSubtreeOf,
hideBookmarkIds = [],
placeholder = "Select a list",
+ className,
+ listTypes = ["manual", "smart"],
}: {
+ className?: string;
value?: string | null;
onChange: (value: string) => void;
placeholder?: string;
hideSubtreeOf?: string;
hideBookmarkIds?: string[];
+ listTypes?: ZBookmarkList["type"][];
}) {
const { data, isPending: isFetchingListsPending } = useBookmarkLists();
let { allPaths } = data ?? {};
@@ -34,6 +40,9 @@ export function BookmarkListSelector({
if (hideBookmarkIds.includes(path[path.length - 1].id)) {
return false;
}
+ if (!listTypes.includes(path[path.length - 1].type)) {
+ return false;
+ }
if (!hideSubtreeOf) {
return true;
}
@@ -42,7 +51,7 @@ export function BookmarkListSelector({
return (
<Select onValueChange={onChange} value={value ?? ""}>
- <SelectTrigger className="w-full">
+ <SelectTrigger className={cn("w-full", className)}>
<SelectValue placeholder={placeholder} />
</SelectTrigger>
<SelectContent>