diff --git a/frontend/src/app/about-us/cases/CaseCard.tsx b/frontend/src/app/about-us/cases/CaseCard.tsx index 661b872c..28ca8b13 100644 --- a/frontend/src/app/about-us/cases/CaseCard.tsx +++ b/frontend/src/app/about-us/cases/CaseCard.tsx @@ -22,13 +22,13 @@ export const CaseCard: React.FC = ({ caseItem, caseData }) => { } }; - const getStatusColor = (status: string) => { - const statusColor: { [key: string]: string } = { - "Critical": "rose", - "Requires attention": "amber", - "All right": "lime" - }; - return statusColor[status] || "zinc"; + const getStatusColor = (status: string): "zinc" | "rose" | "amber" | "lime" => { + switch (status) { + case "Critical": return "rose"; + case "Requires attention": return "amber"; + case "All right": return "lime"; + default: return "zinc"; + } }; const formatDate = (dateString: string) => { @@ -121,12 +121,12 @@ export const CaseCard: React.FC = ({ caseItem, caseData }) => { date.setDate(date.getDate() - date.getDay() - 7 * (6 - i)); return date.toLocaleDateString('pt-BR', { day: '2-digit', month: '2-digit' }); }), 'AVG'].map((date, index) => { - const weekData = index < 6 ? caseData.byWeek.find(week => week.week.startsWith(date)) : null; + const weekData = index < 6 ? caseData.byWeek.find((week: { week: string; }) => week.week.startsWith(date)) : null; const averageData = index === 6 ? { - totalConsultingHours: caseData.byWeek.reduce((sum, week) => sum + week.totalConsultingHours, 0) / 6, - totalHandsOnHours: caseData.byWeek.reduce((sum, week) => sum + week.totalHandsOnHours, 0) / 6, - totalSquadHours: caseData.byWeek.reduce((sum, week) => sum + week.totalSquadHours, 0) / 6, - totalInternalHours: caseData.byWeek.reduce((sum, week) => sum + week.totalInternalHours, 0) / 6 + totalConsultingHours: caseData.byWeek.reduce((sum: any, week: { totalConsultingHours: any; }) => sum + week.totalConsultingHours, 0) / 6, + totalHandsOnHours: caseData.byWeek.reduce((sum: any, week: { totalHandsOnHours: any; }) => sum + week.totalHandsOnHours, 0) / 6, + totalSquadHours: caseData.byWeek.reduce((sum: any, week: { totalSquadHours: any; }) => sum + week.totalSquadHours, 0) / 6, + totalInternalHours: caseData.byWeek.reduce((sum: any, week: { totalInternalHours: any; }) => sum + week.totalInternalHours, 0) / 6 } : null; const data = index < 6 ? weekData : averageData; return ( diff --git a/frontend/src/app/about-us/products-or-services/page.tsx b/frontend/src/app/about-us/products-or-services/page.tsx index 496de93a..adb390a5 100644 --- a/frontend/src/app/about-us/products-or-services/page.tsx +++ b/frontend/src/app/about-us/products-or-services/page.tsx @@ -1,7 +1,7 @@ "use client"; import { Heading } from "@/components/catalyst/heading"; -import { gql, useQuery } from "@apollo/client"; +import { gql, HttpLink, useQuery } from "@apollo/client"; import Image from "next/image"; import Link from "next/link"; import { useState } from "react"; @@ -55,9 +55,8 @@ export default function ProductsOrServices() { if (loading) return

Loading...

; if (error) return

Error: {error.message}

; - const queryString = print(GET_OFFERS_AND_TIMESHEET); - const GRAPHQL_ENDPOINT = (client.link.options as any).uri; + const GRAPHQL_ENDPOINT = client.link instanceof HttpLink ? client.link.options.uri : undefined; const handleStatClick = (statName: string) => { setSelectedStat(statName); diff --git a/frontend/src/app/analytics/datasets/[[...slug]]/page.tsx b/frontend/src/app/analytics/datasets/[[...slug]]/page.tsx index c247e9d1..03be4aed 100644 --- a/frontend/src/app/analytics/datasets/[[...slug]]/page.tsx +++ b/frontend/src/app/analytics/datasets/[[...slug]]/page.tsx @@ -95,14 +95,16 @@ export default function Datasets() { const updateQueryString = (newSelectedValues: SelectValue[]) => { const params = new URLSearchParams(); const uniqueFilters: Record> = {}; - + newSelectedValues.forEach(value => { - if (typeof value.value === 'string') { + if (value && 'value' in value && typeof value.value === 'string') { const [field, fieldValue] = value.value.split(':'); - if (!uniqueFilters[field]) { - uniqueFilters[field] = new Set(); + if (field && fieldValue) { + if (!uniqueFilters[field]) { + uniqueFilters[field] = new Set(); + } + uniqueFilters[field].add(fieldValue); } - uniqueFilters[field].add(fieldValue); } }); @@ -140,19 +142,19 @@ export default function Datasets() {