diff --git a/bugulma/frontend/components/add-organization/steps/Step1.tsx b/bugulma/frontend/components/add-organization/steps/Step1.tsx index 7bfafb6..31bb53d 100644 --- a/bugulma/frontend/components/add-organization/steps/Step1.tsx +++ b/bugulma/frontend/components/add-organization/steps/Step1.tsx @@ -73,9 +73,7 @@ const Step1 = ({ /> )} /> -

- {t('organization.galleryImagesHint')} -

+

{t('organization.galleryImagesHint')}

); diff --git a/bugulma/frontend/components/heritage/TimelineSection.tsx b/bugulma/frontend/components/heritage/TimelineSection.tsx index d84bfbf..adef443 100644 --- a/bugulma/frontend/components/heritage/TimelineSection.tsx +++ b/bugulma/frontend/components/heritage/TimelineSection.tsx @@ -101,7 +101,7 @@ const TimelineSection = ({ transition={{ duration: 0.3 }} aria-label={t('heritage.toggleFilters')} > - + ▼ diff --git a/bugulma/frontend/components/map/ProductServiceMarkers.tsx b/bugulma/frontend/components/map/ProductServiceMarkers.tsx index 3650089..9381337 100644 --- a/bugulma/frontend/components/map/ProductServiceMarkers.tsx +++ b/bugulma/frontend/components/map/ProductServiceMarkers.tsx @@ -24,7 +24,7 @@ const ProductMarker = React.memo<{ const position: LatLngTuple = useMemo(() => { if (!match.product?.location) return [0, 0]; return [match.product.location.latitude, match.product.location.longitude]; - }, [match.product?.location?.latitude, match.product?.location?.longitude]); + }, [match.product?.location]); const icon = useMemo(() => { if (!match.product?.location) { @@ -118,7 +118,7 @@ const ServiceMarker = React.memo<{ const position: LatLngTuple = useMemo(() => { if (!match.service?.service_location) return [0, 0]; return [match.service.service_location.latitude, match.service.service_location.longitude]; - }, [match.service?.service_location?.latitude, match.service?.service_location?.longitude]); + }, [match.service?.service_location]); const icon = useMemo(() => { if (!match.service?.service_location) { diff --git a/bugulma/frontend/components/matches/MatchCard.tsx b/bugulma/frontend/components/matches/MatchCard.tsx index 03cb47c..3562e92 100644 --- a/bugulma/frontend/components/matches/MatchCard.tsx +++ b/bugulma/frontend/components/matches/MatchCard.tsx @@ -77,9 +77,10 @@ const MatchCard: React.FC = ({ match, onViewDetails }) => { {t('matches.riskScore', { score: formatScore( - (match.RiskAssessment.technical_risk + match.RiskAssessment.regulatory_risk) / + (match.RiskAssessment.technical_risk + + match.RiskAssessment.regulatory_risk) / 2 - ) + ), })} diff --git a/bugulma/frontend/components/organization/NetworkGraph.tsx b/bugulma/frontend/components/organization/NetworkGraph.tsx index 5d5d713..c5a956e 100644 --- a/bugulma/frontend/components/organization/NetworkGraph.tsx +++ b/bugulma/frontend/components/organization/NetworkGraph.tsx @@ -235,7 +235,7 @@ export function NetworkGraph({ {error && (
-

Error loading network graph

+

{t('organization.networkGraphError')}

{error}

)} @@ -244,7 +244,7 @@ export function NetworkGraph({
-

Loading network graph...

+

{t('organization.networkGraphLoading')}

)} @@ -257,21 +257,21 @@ export function NetworkGraph({ />
- {graphData.nodes.length} nodes - {graphData.edges.length} connections + {t('organization.nodesCount', { count: graphData.nodes.length })} + {t('organization.connectionsCount', { count: graphData.edges.length })}
- Organization + {t('organization.legend.organization')}
- Site + {t('organization.legend.site')}
- Resource + {t('organization.legend.resource')}
diff --git a/bugulma/frontend/hooks/features/useAdminDashboard.ts b/bugulma/frontend/hooks/features/useAdminDashboard.ts index b5d9add..d83a9a6 100644 --- a/bugulma/frontend/hooks/features/useAdminDashboard.ts +++ b/bugulma/frontend/hooks/features/useAdminDashboard.ts @@ -21,12 +21,14 @@ export const useAdminDashboard = () => { // Activity feed const { data: recentActivityData } = useRecentActivity(); - const recentActivity: ActivityItem[] = (recentActivityData || []).map((it: RecentActivityAPIResponse) => ({ - id: it.id, - type: (it.type as ActivityItem['type']) || 'other', - action: it.description, - timestamp: new Date(it.timestamp), - })); + const recentActivity: ActivityItem[] = (recentActivityData || []).map( + (it: RecentActivityAPIResponse) => ({ + id: it.id, + type: (it.type as ActivityItem['type']) || 'other', + action: it.description, + timestamp: new Date(it.timestamp), + }) + ); // Quick actions data from API const quickActions = { diff --git a/bugulma/frontend/lib/error-handling.ts b/bugulma/frontend/lib/error-handling.ts index d9a9426..90754a4 100644 --- a/bugulma/frontend/lib/error-handling.ts +++ b/bugulma/frontend/lib/error-handling.ts @@ -351,7 +351,11 @@ export class ErrorHandler { private sendToSentry(error: AppError): void { // Placeholder for Sentry integration if (typeof window !== 'undefined') { - const sentry = (window as Window & { Sentry?: { captureException: (error: Error, context?: Record) => void } }).Sentry; + const sentry = ( + window as Window & { + Sentry?: { captureException: (error: Error, context?: Record) => void }; + } + ).Sentry; if (sentry) { sentry.captureException(error.originalError || new Error(error.message), { tags: { @@ -373,7 +377,11 @@ export class ErrorHandler { private sendToAnalytics(error: AppError): void { // Placeholder for analytics integration if (typeof window !== 'undefined') { - const gtag = (window as Window & { gtag?: (event: string, name: string, params: Record) => void }).gtag; + const gtag = ( + window as Window & { + gtag?: (event: string, name: string, params: Record) => void; + } + ).gtag; if (gtag) { gtag('event', 'exception', { description: error.message, diff --git a/bugulma/frontend/pages/CommunityEventsPage.tsx b/bugulma/frontend/pages/CommunityEventsPage.tsx index 1010b5a..a8f2a61 100644 --- a/bugulma/frontend/pages/CommunityEventsPage.tsx +++ b/bugulma/frontend/pages/CommunityEventsPage.tsx @@ -6,9 +6,7 @@ const CommunityEventsPage = () => {

{t('community.events.title')}

-

- {t('community.events.description')} -

+

{t('community.events.description')}

); diff --git a/bugulma/frontend/pages/CommunityImpactPage.tsx b/bugulma/frontend/pages/CommunityImpactPage.tsx index f4feaa3..3c4b9e5 100644 --- a/bugulma/frontend/pages/CommunityImpactPage.tsx +++ b/bugulma/frontend/pages/CommunityImpactPage.tsx @@ -6,9 +6,7 @@ const CommunityImpactPage = () => {

{t('community.impact.title')}

-

- {t('community.impact.description')} -

+

{t('community.impact.description')}

); diff --git a/bugulma/frontend/pages/CommunityNewsPage.tsx b/bugulma/frontend/pages/CommunityNewsPage.tsx index 866742d..687c773 100644 --- a/bugulma/frontend/pages/CommunityNewsPage.tsx +++ b/bugulma/frontend/pages/CommunityNewsPage.tsx @@ -6,9 +6,7 @@ const CommunityNewsPage = () => {

{t('community.news.title')}

-

- {t('community.news.description')} -

+

{t('community.news.description')}

); diff --git a/bugulma/frontend/pages/CommunityStoriesPage.tsx b/bugulma/frontend/pages/CommunityStoriesPage.tsx index 5c110ee..0f13fdf 100644 --- a/bugulma/frontend/pages/CommunityStoriesPage.tsx +++ b/bugulma/frontend/pages/CommunityStoriesPage.tsx @@ -6,9 +6,7 @@ const CommunityStoriesPage = () => {

{t('community.stories.title')}

-

- {t('community.stories.description')} -

+

{t('community.stories.description')}

); diff --git a/bugulma/frontend/pages/DashboardPage.tsx b/bugulma/frontend/pages/DashboardPage.tsx index 33c088d..f6d2c39 100644 --- a/bugulma/frontend/pages/DashboardPage.tsx +++ b/bugulma/frontend/pages/DashboardPage.tsx @@ -46,22 +46,18 @@ const DashboardPage = () => { const { data: dashboardStats, isLoading: isLoadingDashboard, - error: dashboardError, } = useDashboardStatistics(); const { data: platformStats, isLoading: isLoadingPlatform, - error: platformError, } = usePlatformStatistics(); const { data: matchingStats, isLoading: isLoadingMatching, - error: matchingError, } = useMatchingStatistics(); const { data: impactMetrics, isLoading: isLoadingImpact, - error: impactError, } = useImpactMetrics(); // User-specific data diff --git a/bugulma/frontend/pages/HeritageBuildingPage.tsx b/bugulma/frontend/pages/HeritageBuildingPage.tsx index 95917e0..b8077fa 100644 --- a/bugulma/frontend/pages/HeritageBuildingPage.tsx +++ b/bugulma/frontend/pages/HeritageBuildingPage.tsx @@ -20,14 +20,13 @@ import { Heading, Text } from '@/components/ui/Typography.tsx'; import { LoadingState } from '@/components/ui/LoadingState.tsx'; import { useHeritageSites } from '@/hooks/api/useHeritageSitesAPI'; import { useTranslation } from '@/hooks/useI18n.tsx'; -import { BackendHeritageSite } from '@/schemas/backend/heritage-sites'; const HeritageBuildingPage = () => { const { id } = useParams<{ id: string }>(); const navigate = useNavigate(); const { data: heritageSites, isLoading } = useHeritageSites(); const { t } = useTranslation(); - + const building = useMemo(() => { if (heritageSites && id) { return heritageSites.find((site) => String(site.ID) === id) || null; diff --git a/bugulma/frontend/pages/ImpactMetrics.tsx b/bugulma/frontend/pages/ImpactMetrics.tsx index 5b3e31f..a2bd3e6 100644 --- a/bugulma/frontend/pages/ImpactMetrics.tsx +++ b/bugulma/frontend/pages/ImpactMetrics.tsx @@ -327,30 +327,36 @@ const ImpactMetrics = () => {
- {impact.topImpactingMatches.slice(0, 5).map((match: TopImpactingMatch, index: number) => ( -
-
-
- {index + 1} + {impact.topImpactingMatches + .slice(0, 5) + .map((match: TopImpactingMatch, index: number) => ( +
+
+
+ {index + 1} +
+
+

+ {match.description || `Match ${match.id || index}`} +

+

{match.resource_type}

+
-
-

{match.description || `Match ${match.id || index}`}

-

{match.resource_type}

+
+

+ {t('impactMetrics.co2Tonnes', { + value: formatNumber(match.co2_impact || 0), + })} +

+

+ {formatCurrency(match.economic_impact || 0)} +

-
-

- {t('impactMetrics.co2Tonnes', { value: formatNumber(match.co2_impact || 0) })} -

-

- {formatCurrency(match.economic_impact || 0)} -

-
-
- ))} + ))}
@@ -402,7 +408,9 @@ const ImpactMetrics = () => { {year}
- {t('impactMetrics.co2Tonnes', { value: formatNumber(projection.co2_projected || 0) })} + {t('impactMetrics.co2Tonnes', { + value: formatNumber(projection.co2_projected || 0), + })}
{formatCurrency(projection.economic_projected || 0)} diff --git a/bugulma/frontend/pages/LoginPage.tsx b/bugulma/frontend/pages/LoginPage.tsx index d35fc16..418953d 100644 --- a/bugulma/frontend/pages/LoginPage.tsx +++ b/bugulma/frontend/pages/LoginPage.tsx @@ -104,9 +104,7 @@ const LoginPage = () => { {isDevelopment && (
-

- {t('login.quickLogin')} -

+

{t('login.quickLogin')}

{TEST_USERS.map((testUser) => (
)} diff --git a/bugulma/frontend/pages/MatchNegotiationPage.tsx b/bugulma/frontend/pages/MatchNegotiationPage.tsx index a8081e5..1ec96b5 100644 --- a/bugulma/frontend/pages/MatchNegotiationPage.tsx +++ b/bugulma/frontend/pages/MatchNegotiationPage.tsx @@ -46,18 +46,21 @@ const MatchNegotiationPage = () => { const [showMessageModal, setShowMessageModal] = useState(false); const [messageText, setMessageText] = useState(''); - const getHistoryTitle = useCallback((action: string, value?: string) => { - switch (action) { - case 'status_changed': - return t('matchNegotiation.statusChanged'); - case 'comment': - return t('matchNegotiation.commentAdded'); - case 'update': - return t('matchNegotiation.matchUpdated'); - default: - return value || action; - } - }, [t]); + const getHistoryTitle = useCallback( + (action: string, value?: string) => { + switch (action) { + case 'status_changed': + return t('matchNegotiation.statusChanged'); + case 'comment': + return t('matchNegotiation.commentAdded'); + case 'update': + return t('matchNegotiation.matchUpdated'); + default: + return value || action; + } + }, + [t] + ); // Transform match history to timeline format const timelineEntries: TimelineEntry[] = useMemo(() => { @@ -325,7 +328,9 @@ const MatchNegotiationPage = () => { {t('matchNegotiation.co2Avoided')} - {t('matchNegotiation.co2TonnesPerYear', { value: match.EconomicImpact.co2_avoided_tonnes.toFixed(1) })} + {t('matchNegotiation.co2TonnesPerYear', { + value: match.EconomicImpact.co2_avoided_tonnes.toFixed(1), + })}
)} @@ -335,7 +340,9 @@ const MatchNegotiationPage = () => { {t('matchDetail.paybackPeriod')} - {t('matchDetail.paybackYears', { years: match.EconomicImpact.payback_years.toFixed(1) })} + {t('matchDetail.paybackYears', { + years: match.EconomicImpact.payback_years.toFixed(1), + })}
)} diff --git a/bugulma/frontend/pages/MatchesMapView.tsx b/bugulma/frontend/pages/MatchesMapView.tsx index 65001b8..2d6a31d 100644 --- a/bugulma/frontend/pages/MatchesMapView.tsx +++ b/bugulma/frontend/pages/MatchesMapView.tsx @@ -1,9 +1,8 @@ import React, { useState, useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; import { MainLayout } from '@/components/layout/MainLayout.tsx'; -import PageHeader from '@/components/layout/PageHeader.tsx'; import MatchCard from '@/components/matches/MatchCard.tsx'; -import { Container, Stack, Grid, Flex } from '@/components/ui/layout'; +import { Container, Stack, Flex } from '@/components/ui/layout'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/Card.tsx'; import Button from '@/components/ui/Button.tsx'; import Select from '@/components/ui/Select.tsx'; @@ -14,7 +13,7 @@ import { MapProvider, useMapUI } from '@/contexts/MapContexts.tsx'; import { useTranslation } from '@/hooks/useI18n.tsx'; import { useTopMatches } from '@/hooks/api/useMatchingAPI.ts'; import { useNavigation } from '@/hooks/useNavigation.tsx'; -import { ArrowLeft, Filter, MapPin, TrendingUp } from 'lucide-react'; +import { ArrowLeft, Filter, MapPin } from 'lucide-react'; // Import the extended map component const MatchesMap = React.lazy(() => import('../components/map/MatchesMap.tsx'));