diff --git a/apiserver/plane/api/views/importer.py b/apiserver/plane/api/views/importer.py index 63e2d38a1..4fc7ad483 100644 --- a/apiserver/plane/api/views/importer.py +++ b/apiserver/plane/api/views/importer.py @@ -332,7 +332,7 @@ class BulkImportIssuesEndpoint(BaseAPIView): # if there is no default state assign any random state if default_state is None: default_state = State.objects.filter( - ~Q(name="Triage"), sproject_id=project_id + ~Q(name="Triage"), project_id=project_id ).first() # Get the maximum sequence_id diff --git a/apiserver/plane/api/views/workspace.py b/apiserver/plane/api/views/workspace.py index b195cedb1..a862c0b4c 100644 --- a/apiserver/plane/api/views/workspace.py +++ b/apiserver/plane/api/views/workspace.py @@ -75,6 +75,7 @@ from plane.db.models import ( Label, WorkspaceMember, CycleIssue, + IssueReaction, ) from plane.api.permissions import ( WorkSpaceBasePermission, @@ -1321,6 +1322,12 @@ class WorkspaceUserProfileIssuesEndpoint(BaseAPIView): ) .select_related("project", "workspace", "state", "parent") .prefetch_related("assignees", "labels") + .prefetch_related( + Prefetch( + "issue_reactions", + queryset=IssueReaction.objects.select_related("actor"), + ) + ) .order_by("-created_at") .annotate( link_count=IssueLink.objects.filter(issue=OuterRef("id")) diff --git a/apps/app/components/command-palette/change-interface-theme.tsx b/apps/app/components/command-palette/change-interface-theme.tsx index b2b43c670..b34212b7f 100644 --- a/apps/app/components/command-palette/change-interface-theme.tsx +++ b/apps/app/components/command-palette/change-interface-theme.tsx @@ -5,6 +5,8 @@ import { Command } from "cmdk"; import { THEMES_OBJ } from "constants/themes"; import { useTheme } from "next-themes"; import { SettingIcon } from "components/icons"; +import userService from "services/user.service"; +import useUser from "hooks/use-user"; type Props = { setIsPaletteOpen: Dispatch>; @@ -12,24 +14,50 @@ type Props = { export const ChangeInterfaceTheme: React.FC = ({ setIsPaletteOpen }) => { const [mounted, setMounted] = useState(false); + const { setTheme } = useTheme(); + const { user, mutateUser } = useUser(); + + const updateUserTheme = (newTheme: string) => { + if (!user) return; + + setTheme(newTheme); + + mutateUser((prevData) => { + if (!prevData) return prevData; + + return { + ...prevData, + theme: { + ...prevData.theme, + theme: newTheme, + }, + }; + }, false); + + userService.updateUser({ + theme: { + ...user.theme, + theme: newTheme, + }, + }); + }; + // useEffect only runs on the client, so now we can safely show the UI useEffect(() => { setMounted(true); }, []); - if (!mounted) { - return null; - } + if (!mounted) return null; return ( <> - {THEMES_OBJ.map((theme) => ( + {THEMES_OBJ.filter((t) => t.value !== "custom").map((theme) => ( { - setTheme(theme.value); + updateUserTheme(theme.value); setIsPaletteOpen(false); }} className="focus:outline-none" diff --git a/apps/app/components/core/feeds.tsx b/apps/app/components/core/feeds.tsx deleted file mode 100644 index 2924ec456..000000000 --- a/apps/app/components/core/feeds.tsx +++ /dev/null @@ -1,342 +0,0 @@ -import React from "react"; - -import { useRouter } from "next/router"; - -import Link from "next/link"; - -// icons -import { - ArrowTopRightOnSquareIcon, - ChatBubbleLeftEllipsisIcon, - Squares2X2Icon, -} from "@heroicons/react/24/outline"; -import { BlockedIcon, BlockerIcon } from "components/icons"; -import { Icon } from "components/ui"; -// helpers -import { renderShortDateWithYearFormat, timeAgo } from "helpers/date-time.helper"; -import { addSpaceIfCamelCase } from "helpers/string.helper"; -// types -import RemirrorRichTextEditor from "components/rich-text-editor"; - -const activityDetails: { - [key: string]: { - message?: string; - icon: JSX.Element; - }; -} = { - assignee: { - message: "removed the assignee", - icon: