diff --git a/apps/app/components/core/issues-view.tsx b/apps/app/components/core/issues-view.tsx index d3df6f43f..ad38a822b 100644 --- a/apps/app/components/core/issues-view.tsx +++ b/apps/app/components/core/issues-view.tsx @@ -630,10 +630,13 @@ export const IssuesView: React.FC = ({ if (!label) return null; return ( -
+
{label.name}
diff --git a/apps/app/components/core/sidebar/sidebar-progress-stats.tsx b/apps/app/components/core/sidebar/sidebar-progress-stats.tsx index fe4b2b832..4beb34963 100644 --- a/apps/app/components/core/sidebar/sidebar-progress-stats.tsx +++ b/apps/app/components/core/sidebar/sidebar-progress-stats.tsx @@ -12,6 +12,7 @@ import issuesServices from "services/issues.service"; import projectService from "services/project.service"; // hooks import useLocalStorage from "hooks/use-local-storage"; +import useIssuesView from "hooks/use-issues-view"; // components import { SingleProgressStats } from "components/core"; // ui @@ -49,6 +50,8 @@ export const SidebarProgressStats: React.FC = ({ const router = useRouter(); const { workspaceSlug, projectId } = router.query; + const { filters, setFilters } = useIssuesView(); + const { storedValue: tab, setValue: setTab } = useLocalStorage("tab", "Assignees"); const { data: issueLabels } = useSWR( @@ -111,7 +114,7 @@ export const SidebarProgressStats: React.FC = ({ - `w-full rounded px-3 py-1 text-gray-900 ${ + `w-full rounded px-3 py-1 text-gray-900 ${ selected ? " bg-theme text-white" : " hover:bg-hover-gray" }` } @@ -128,8 +131,8 @@ export const SidebarProgressStats: React.FC = ({ States - - + + {members?.map((member, index) => { const totalArray = issues?.filter((i) => i.assignees?.includes(member.member.id)); const completeArray = totalArray?.filter((i) => i.state_detail.group === "completed"); @@ -146,6 +149,15 @@ export const SidebarProgressStats: React.FC = ({ } completed={completeArray.length} total={totalArray.length} + onClick={() => { + if (filters.assignees?.includes(member.member.id)) + setFilters({ + assignees: filters.assignees?.filter((a) => a !== member.member.id), + }); + else + setFilters({ assignees: [...(filters?.assignees ?? []), member.member.id] }); + }} + selected={filters.assignees?.includes(member.member.id)} /> ); } @@ -177,7 +189,7 @@ export const SidebarProgressStats: React.FC = ({ "" )} - + {issueLabels?.map((label, index) => { const totalArray = issues?.filter((i) => i.labels?.includes(label.id)); const completeArray = totalArray?.filter((i) => i.state_detail.group === "completed"); @@ -189,7 +201,7 @@ export const SidebarProgressStats: React.FC = ({ title={
= ({ } completed={completeArray.length} total={totalArray.length} + onClick={() => { + if (filters.labels?.includes(label.id)) + setFilters({ + labels: filters.labels?.filter((l) => l !== label.id), + }); + else setFilters({ labels: [...(filters?.labels ?? []), label.id] }); + }} + selected={filters.labels?.includes(label.id)} /> ); } diff --git a/apps/app/components/core/sidebar/single-progress-stats.tsx b/apps/app/components/core/sidebar/single-progress-stats.tsx index 6066a3deb..5ea7206f0 100644 --- a/apps/app/components/core/sidebar/single-progress-stats.tsx +++ b/apps/app/components/core/sidebar/single-progress-stats.tsx @@ -18,14 +18,14 @@ export const SingleProgressStats: React.FC = ({ selected = false, }) => (
{title}
-
+
diff --git a/apps/app/components/views/form.tsx b/apps/app/components/views/form.tsx index 24764d33e..e30e34145 100644 --- a/apps/app/components/views/form.tsx +++ b/apps/app/components/views/form.tsx @@ -225,10 +225,13 @@ export const ViewForm: React.FC = ({ const label = issueLabels?.find((l) => l.id === labelId); if (!label) return null; return ( -
+
{label.name}