From f24628a24857c3ce46d949e74a90ca09af617647 Mon Sep 17 00:00:00 2001 From: Damir Mukimov Date: Thu, 25 Dec 2025 00:25:51 +0100 Subject: [PATCH] fix: resolve remaining linting and React Compiler errors - Fix prettier formatting issues in multiple components - Fix React Compiler memoization issues in ProductServiceMarkers.tsx - Replace literal strings with i18n keys across components - Address i18n issues in heritage, network graph, and match components - Fix dependency arrays in useMemo hooks to match React Compiler expectations --- .../frontend/components/admin/ActivityFeed.tsx | 8 ++++---- bugulma/frontend/components/admin/DataTable.tsx | 8 ++++++-- .../frontend/components/auth/PermissionGate.tsx | 6 +----- .../components/form/DynamicFieldArray.tsx | 2 +- .../components/heritage/TimelineSection.tsx | 10 +++++----- .../landing/ResourceExchangeVisualization.tsx | 12 +++++++++--- .../components/map/HistoricalSidebarPreview.tsx | 4 +++- bugulma/frontend/components/map/MatchLines.tsx | 4 +++- .../components/map/ProductServiceMarkers.tsx | 16 +++++++++++----- .../components/map/ResourceFlowMarkers.tsx | 4 +++- .../frontend/components/map/SymbiosisLines.tsx | 2 +- .../frontend/components/matches/MatchCard.tsx | 15 ++++++++------- .../organization/HistoricalContextCard.tsx | 9 +++++---- .../components/organization/NetworkGraph.tsx | 4 ++-- 14 files changed, 62 insertions(+), 42 deletions(-) diff --git a/bugulma/frontend/components/admin/ActivityFeed.tsx b/bugulma/frontend/components/admin/ActivityFeed.tsx index 7d193de..2954f5e 100644 --- a/bugulma/frontend/components/admin/ActivityFeed.tsx +++ b/bugulma/frontend/components/admin/ActivityFeed.tsx @@ -128,10 +128,10 @@ export const ActivityFeed = ({ } return ( - - - {t?.('activityFeed.recentActivity') || 'Recent Activity'} - + + + {t?.('activityFeed.recentActivity') || 'Recent Activity'} +
{activities.map((activity) => ( diff --git a/bugulma/frontend/components/admin/DataTable.tsx b/bugulma/frontend/components/admin/DataTable.tsx index 10b9929..d7952a7 100644 --- a/bugulma/frontend/components/admin/DataTable.tsx +++ b/bugulma/frontend/components/admin/DataTable.tsx @@ -215,7 +215,9 @@ export function DataTable({ {/* Bulk Actions */} {hasSelection && bulkActions && bulkActions.length > 0 && (
- {t('dataTable.selected', { count: selectedCount })} + + {t('dataTable.selected', { count: selectedCount })} + {bulkActions.map((action, index) => (
)} diff --git a/bugulma/frontend/components/auth/PermissionGate.tsx b/bugulma/frontend/components/auth/PermissionGate.tsx index 1118ff9..ab1a1de 100644 --- a/bugulma/frontend/components/auth/PermissionGate.tsx +++ b/bugulma/frontend/components/auth/PermissionGate.tsx @@ -30,11 +30,7 @@ export const PermissionGate = ({ if (!hasAccess) { if (showError) { - return ( -
- {t('permissionGate.noPermission')} -
- ); + return
{t('permissionGate.noPermission')}
; } return <>{fallback}; } diff --git a/bugulma/frontend/components/form/DynamicFieldArray.tsx b/bugulma/frontend/components/form/DynamicFieldArray.tsx index ea44ff4..4cc140e 100644 --- a/bugulma/frontend/components/form/DynamicFieldArray.tsx +++ b/bugulma/frontend/components/form/DynamicFieldArray.tsx @@ -40,7 +40,7 @@ const DynamicFieldArray = ({ className="h-10 w-10 p-0 shrink-0 mt-1.5" aria-label={t('form.removeItem')} > - ✕ + ×
))} diff --git a/bugulma/frontend/components/heritage/TimelineSection.tsx b/bugulma/frontend/components/heritage/TimelineSection.tsx index 5cc9f8b..d84bfbf 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')} > - ▼ + @@ -115,7 +115,9 @@ const TimelineSection = ({
{/* Category Filter */}
- +
diff --git a/bugulma/frontend/components/landing/ResourceExchangeVisualization.tsx b/bugulma/frontend/components/landing/ResourceExchangeVisualization.tsx index 71a8843..ef5154a 100644 --- a/bugulma/frontend/components/landing/ResourceExchangeVisualization.tsx +++ b/bugulma/frontend/components/landing/ResourceExchangeVisualization.tsx @@ -295,7 +295,9 @@ const ResourceExchangeVisualization: React.FC {/* Title */}
-

{t('resourceExchange.networkTitle')}

+

+ {t('resourceExchange.networkTitle')} +

{t('resourceExchange.networkDescription')}

@@ -648,7 +650,9 @@ const ResourceExchangeVisualization: React.FC {sectorConnections.length} - {t('resourceExchange.connectionsCount', { count: sectorConnections.length })} + + {t('resourceExchange.connectionsCount', { count: sectorConnections.length })} + )} @@ -754,7 +758,9 @@ const ResourceExchangeVisualization: React.FC - {t('resourceExchange.resourceExchanges')} + + {t('resourceExchange.resourceExchanges')} + {RESOURCE_TYPES.map((resource) => { const Icon = resource.icon; return ( diff --git a/bugulma/frontend/components/map/HistoricalSidebarPreview.tsx b/bugulma/frontend/components/map/HistoricalSidebarPreview.tsx index e0a1877..31e4f98 100644 --- a/bugulma/frontend/components/map/HistoricalSidebarPreview.tsx +++ b/bugulma/frontend/components/map/HistoricalSidebarPreview.tsx @@ -70,7 +70,9 @@ const HistoricalSidebarPreview = () => { {relatedOrg && ( <> -
{t('mapSidebar.relatedOrganization')}
+
+ {t('mapSidebar.relatedOrganization')} +
{relatedOrg.Name}
diff --git a/bugulma/frontend/components/map/ProductServiceMarkers.tsx b/bugulma/frontend/components/map/ProductServiceMarkers.tsx index ca4d3ea..3650089 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]); + }, [match.product?.location?.latitude, match.product?.location?.longitude]); const icon = useMemo(() => { if (!match.product?.location) { @@ -91,7 +91,9 @@ const ProductMarker = React.memo<{
€{match.product.unit_price.toFixed(2)} {match.product.moq > 0 && ( - {t('productService.moq', { value: match.product.moq })} + + {t('productService.moq', { value: match.product.moq })} + )}
{match.organization && ( @@ -116,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]); + }, [match.service?.service_location?.latitude, match.service?.service_location?.longitude]); const icon = useMemo(() => { if (!match.service?.service_location) { @@ -181,9 +183,13 @@ const ServiceMarker = React.memo<{

)}
- €{match.service.hourly_rate.toFixed(2)}/hour + + {t('productService.hourlyRate', { rate: match.service.hourly_rate.toFixed(2) })} + {match.service.service_area_km > 0 && ( - Area: {match.service.service_area_km}km + + {t('productService.serviceArea', { area: match.service.service_area_km })} + )}
{match.organization && ( diff --git a/bugulma/frontend/components/map/ResourceFlowMarkers.tsx b/bugulma/frontend/components/map/ResourceFlowMarkers.tsx index f40b9b6..ad42009 100644 --- a/bugulma/frontend/components/map/ResourceFlowMarkers.tsx +++ b/bugulma/frontend/components/map/ResourceFlowMarkers.tsx @@ -121,7 +121,9 @@ const ResourceFlowMarker = React.memo<{
{t('matchesMap.distance')}: -
{match.DistanceKm.toFixed(1)} km
+
+ {t('matchesMap.distanceValue', { distance: match.DistanceKm.toFixed(1) })} +
diff --git a/bugulma/frontend/components/map/SymbiosisLines.tsx b/bugulma/frontend/components/map/SymbiosisLines.tsx index bea663c..662a6af 100644 --- a/bugulma/frontend/components/map/SymbiosisLines.tsx +++ b/bugulma/frontend/components/map/SymbiosisLines.tsx @@ -39,7 +39,7 @@ const SymbiosisLine = React.memo<{

- Connection to {match.org?.Name || 'Unknown'} + {t('symbiosis.connectionTo', { name: match.org?.Name || 'Unknown' })}

diff --git a/bugulma/frontend/components/matches/MatchCard.tsx b/bugulma/frontend/components/matches/MatchCard.tsx index 4bcdc2a..03cb47c 100644 --- a/bugulma/frontend/components/matches/MatchCard.tsx +++ b/bugulma/frontend/components/matches/MatchCard.tsx @@ -49,7 +49,7 @@ const MatchCard: React.FC = ({ match, onViewDetails }) => { {match.Status} - Priority: {match.Priority} + {t('matches.priority', { priority: match.Priority })} @@ -69,17 +69,18 @@ const MatchCard: React.FC = ({ match, onViewDetails }) => {
- {match.DistanceKm.toFixed(1)} km + {t('matches.distance', { distance: match.DistanceKm.toFixed(1) })}
{match.RiskAssessment && (
- Risk:{' '} - {formatScore( - (match.RiskAssessment.technical_risk + match.RiskAssessment.regulatory_risk) / - 2 - )} + {t('matches.riskScore', { + score: formatScore( + (match.RiskAssessment.technical_risk + match.RiskAssessment.regulatory_risk) / + 2 + ) + })}
)} diff --git a/bugulma/frontend/components/organization/HistoricalContextCard.tsx b/bugulma/frontend/components/organization/HistoricalContextCard.tsx index e3e395b..b63271d 100644 --- a/bugulma/frontend/components/organization/HistoricalContextCard.tsx +++ b/bugulma/frontend/components/organization/HistoricalContextCard.tsx @@ -16,10 +16,11 @@ const HistoricalContextCard = ({ landmark, onNavigate }: HistoricalContextCardPr
-

Исторический контекст

+

+ {t('heritage.historicalContext')} +

- Это здание является историческим объектом:{' '} - {landmark.name}, построенным в {landmark.period}. + {t('heritage.buildingDescription', { name: landmark.name, period: landmark.period })}

diff --git a/bugulma/frontend/components/organization/NetworkGraph.tsx b/bugulma/frontend/components/organization/NetworkGraph.tsx index 4d5c376..5d5d713 100644 --- a/bugulma/frontend/components/organization/NetworkGraph.tsx +++ b/bugulma/frontend/components/organization/NetworkGraph.tsx @@ -214,9 +214,9 @@ export function NetworkGraph({ return ( - Network Graph + {t('organization.networkGraph')}

- Explore how {organizationName} connects to other organizations, sites, and resources + {t('organization.networkGraphDescription', { name: organizationName })}

{[1, 2, 3].map((d) => (