fixed sharing
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { type Component, createMemo } from "solid-js";
|
||||
import { type Task, toggleTask, calculateUrgencyFromDate, setActiveTaskId, store, copyTask } from "@/store";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { CheckCircle2, Circle, Clock, ArrowUpCircle, Copy } from "lucide-solid";
|
||||
import { CheckCircle2, Circle, Clock, ArrowUpCircle, Copy, Users2 } from "lucide-solid";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { For } from "solid-js";
|
||||
import { useTheme } from "./ThemeProvider";
|
||||
@@ -78,6 +78,31 @@ export const TaskCard: Component<{ task: Task }> = (props) => {
|
||||
<span class="text-[10px] font-medium">P{props.task.priority}</span>
|
||||
</div>
|
||||
|
||||
{/* Shared Indicator - shows for individual shares OR tag-based ShareRules */}
|
||||
{(() => {
|
||||
const hasIndividualShares = props.task.sharedWith && props.task.sharedWith.length > 0;
|
||||
// Check if any tag-based ShareRules match this task's tags (exclude 'all' type)
|
||||
const hasTagRuleShares = store.shareRules.some(rule =>
|
||||
rule.type === 'tag' &&
|
||||
rule.tagName &&
|
||||
props.task.tags?.includes(rule.tagName)
|
||||
);
|
||||
const isShared = hasIndividualShares || hasTagRuleShares;
|
||||
|
||||
if (!isShared) return null;
|
||||
|
||||
const shareCount = (props.task.sharedWith?.length || 0);
|
||||
const tooltip = hasIndividualShares
|
||||
? `Shared with ${shareCount} user${shareCount > 1 ? 's' : ''}`
|
||||
: 'Shared via tag rule';
|
||||
|
||||
return (
|
||||
<div class="flex items-center gap-1 shrink-0" title={tooltip}>
|
||||
<Users2 size={11} class="text-muted-foreground/50" />
|
||||
</div>
|
||||
);
|
||||
})()}
|
||||
|
||||
{/* Tags */}
|
||||
{props.task.tags && props.task.tags.length > 0 && (
|
||||
<div class="flex flex-wrap items-center gap-1 min-w-0">
|
||||
|
||||
Reference in New Issue
Block a user