diff --git a/backend/src/models/analytics/performance_analysis.py b/backend/src/models/analytics/performance_analysis.py index 5f18a51e..5404fa65 100644 --- a/backend/src/models/analytics/performance_analysis.py +++ b/backend/src/models/analytics/performance_analysis.py @@ -396,7 +396,7 @@ def calculate_entity_summary(regular_cases: List[OneWeekRegularCasePerformanceSu case_summaries = [calculate_case_metrics(case, by_case_hours.get(case.id, 0), by_case_month_hours.get(case.id, 0)) for case in cases - if (case.weekly_approved_hours and case.weekly_approved_hours > 0) or + if (case.is_active and case.weekly_approved_hours and case.weekly_approved_hours > 0) or (by_case_hours.get(case.id, 0) > 0)] regular_cases = [case for case in case_summaries if isinstance(case, OneWeekRegularCasePerformanceSummary)] diff --git a/frontend/src/app/components/OmniCommands.tsx b/frontend/src/app/components/OmniCommands.tsx index 38554983..51cf937a 100644 --- a/frontend/src/app/components/OmniCommands.tsx +++ b/frontend/src/app/components/OmniCommands.tsx @@ -18,7 +18,7 @@ import { import { Button } from "@/components/ui/button" import { MagnifyingGlassIcon } from "@radix-ui/react-icons" import { useQuery, gql } from "@apollo/client" -import { UserIcon, BriefcaseIcon, UsersIcon, HandshakeIcon } from "lucide-react" +import { UserIcon, BriefcaseIcon, UsersIcon, HandshakeIcon, TrophyIcon } from "lucide-react" const GET_CONSULTANTS = gql` query GetConsultants { @@ -38,6 +38,13 @@ const GET_CONSULTANTS = gql` slug name } + cases(onlyActives: true) { + slug + title + tracker { + name + } + } } ` @@ -176,6 +183,28 @@ export function OmniCommands({ open, setOpen }: OmniCommandsProps) { ))} + + + {data?.cases.map((caseItem: { slug: string, title: string, tracker: { name: string }[] }) => ( + + runCommand(() => router.push(`/about-us/cases/${caseItem.slug}`))} + > + + {caseItem.title} + + {caseItem.tracker?.map((tracker, index) => ( + runCommand(() => router.push(`/about-us/cases/${caseItem.slug}`))} + > + + {tracker.name} + + ))} + + ))} + )