From 233509db67cd938125731ae897b5f53312af268b Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sun, 14 Jun 2026 21:40:48 +0200 Subject: [PATCH] fix(links): update all maps and tiles to use standorte pages as single source of truth --- app/[locale]/referenzen/page.tsx | 3 ++- components/blocks/InteractiveGermanyMap.tsx | 3 ++- components/blocks/SubCompanyTiles.tsx | 10 ++++--- content/de/home.mdx | 4 ++- content/de/ueber-uns.mdx | 5 ++-- content/en/home.mdx | 4 ++- content/en/ueber-uns.mdx | 5 ++-- lib/map-data.ts | 30 --------------------- tests/task-12-links.test.ts | 8 +++--- 9 files changed, 26 insertions(+), 46 deletions(-) diff --git a/app/[locale]/referenzen/page.tsx b/app/[locale]/referenzen/page.tsx index 61daf29c5..90d249daa 100644 --- a/app/[locale]/referenzen/page.tsx +++ b/app/[locale]/referenzen/page.tsx @@ -9,6 +9,7 @@ import { SITE_URL } from '@/lib/schema'; import Image from 'next/image'; import { InteractiveGermanyMap } from '@/components/blocks/InteractiveGermanyMap'; import { defaultLocations, minorLocations } from '@/lib/map-data'; +import { standorteLocations } from '@/lib/standorte-data'; interface PageProps { params: Promise<{ @@ -52,7 +53,7 @@ export default async function ReferenzenOverview(props: { params: Promise<{ loca const references = await getAllReferences(locale); - const allLocations = [...defaultLocations, ...minorLocations]; + const allLocations = [...standorteLocations, ...defaultLocations, ...minorLocations]; const enrichedLocations = allLocations.map(loc => { if (loc.type === 'project') { const ref = references.find(r => r.slug === loc.id); diff --git a/components/blocks/InteractiveGermanyMap.tsx b/components/blocks/InteractiveGermanyMap.tsx index e6e2711bd..49575dea0 100644 --- a/components/blocks/InteractiveGermanyMap.tsx +++ b/components/blocks/InteractiveGermanyMap.tsx @@ -8,9 +8,10 @@ import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { AnimatedGlossyBorder } from '@/components/ui/AnimatedGlossyBorder'; import { Location, defaultLocations, minorLocations } from '@/lib/map-data'; +import { standorteLocations } from '@/lib/standorte-data'; import { useLocale, useTranslations } from 'next-intl'; -const allLocations = [...defaultLocations, ...minorLocations]; +const allLocations = [...standorteLocations, ...defaultLocations, ...minorLocations]; interface Stat { value: string; diff --git a/components/blocks/SubCompanyTiles.tsx b/components/blocks/SubCompanyTiles.tsx index f2e8fa79c..5131b549e 100644 --- a/components/blocks/SubCompanyTiles.tsx +++ b/components/blocks/SubCompanyTiles.tsx @@ -3,6 +3,7 @@ import * as React from 'react'; import { motion, Variants } from 'framer-motion'; import Image from 'next/image'; +import Link from 'next/link'; import { HoverShineOverlay } from '@/components/ui/HoverShineOverlay'; import { AnimatedGlossyBorder } from '@/components/ui/AnimatedGlossyBorder'; @@ -87,8 +88,9 @@ export function SubCompanyTiles(props: SubCompanyTilesProps) { {companiesData.map((company: any, index: number) => { const isCurrent = company.title.toUpperCase() === 'E-TIB GMBH'; const hasUrl = !!company.url; - const CardWrapper = hasUrl ? 'a' : 'div'; - const wrapperProps = hasUrl ? { href: company.url, target: "_blank", rel: "noopener noreferrer" } : {}; + const isExternal = hasUrl && company.url.startsWith('http'); + const CardWrapper = hasUrl ? (isExternal ? 'a' : Link) : 'div'; + const wrapperProps = hasUrl ? (isExternal ? { href: company.url, target: "_blank", rel: "noopener noreferrer" } : { href: company.url }) : {}; // Generate logo representation based on title const isEtib = company.title.includes('E-TIB'); @@ -122,7 +124,7 @@ export function SubCompanyTiles(props: SubCompanyTilesProps) { {...wrapperProps} className={`group relative overflow-hidden aspect-[4/3] flex flex-col justify-center items-center shadow-xl transition-all duration-500 bg-neutral-dark block w-full h-full sm:rounded-xl select-none ${ isCurrent - ? 'border-2 border-primary shadow-[0_0_30px_rgba(17,124,97,0.15)] cursor-default' + ? 'border border-white/5 hover:shadow-2xl hover:-translate-y-1 hover:border-white/10 cursor-pointer' : 'border border-white/5 hover:shadow-2xl hover:-translate-y-1 hover:border-white/10 cursor-pointer' }`} > @@ -227,7 +229,7 @@ export function SubCompanyTiles(props: SubCompanyTilesProps) { {company.url && (
- Website Besuchen + {isExternal ? (isDe ? 'Website Besuchen' : 'Visit Website') : (isDe ? 'Zum Standort' : 'View Location')}
diff --git a/content/de/home.mdx b/content/de/home.mdx index a5d462cab..be1d767ed 100644 --- a/content/de/home.mdx +++ b/content/de/home.mdx @@ -20,6 +20,7 @@ description: "Die E-TIB GmbH ist Ihr zuverlässiger Partner für komplexe Kabelt title: "E-TIB GMBH", description: "Das komplette Leistungsspektrum zur Errichtung von Kabeltrassen aus einer Hand.", icon: "M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z", + url: "/de/standorte/guben", backgroundImage: "/assets/photos/DJI_0243.JPG" }, { @@ -33,13 +34,14 @@ description: "Die E-TIB GmbH ist Ihr zuverlässiger Partner für komplexe Kabelt title: "E-TIB Verwaltung GmbH", description: "Zentrale Dienste, Einkauf und Finanzen sowie Verwaltung von Immobilien, Grundstücken, Maschinen und Geräten.", icon: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4", + url: "/de/standorte/buelstedt", backgroundImage: "/assets/photos/DJI_0048.JPG" }, { title: "E-TIB Bohrtechnik GmbH", description: "Präzise Horizontalspülbohrungen in allen Bodenklassen für eine oberflächenschonende und grabenlose Leitungsverlegung.", icon: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z", - url: "/de/bohrtechnik", + url: "/de/standorte/kirchheilingen", backgroundImage: "/assets/photos/DSC08653.JPG" } ]} diff --git a/content/de/ueber-uns.mdx b/content/de/ueber-uns.mdx index ace92b358..8a46a07ee 100644 --- a/content/de/ueber-uns.mdx +++ b/content/de/ueber-uns.mdx @@ -65,7 +65,7 @@ layout: "fullBleed" title: "E-TIB GMBH", description: "Das komplette Leistungsspektrum zur Errichtung von Kabeltrassen aus einer Hand.", icon: "M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z", - url: "/de/kabeltiefbau", + url: "/de/standorte/guben", backgroundImage: "/assets/photos/DJI_0243.JPG" }, { @@ -79,13 +79,14 @@ layout: "fullBleed" title: "E-TIB Verwaltung GmbH", description: "Zentrale Dienste, Einkauf und Finanzen sowie Verwaltung von Immobilien, Grundstücken, Maschinen und Geräten.", icon: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4", + url: "/de/standorte/buelstedt", backgroundImage: "/assets/photos/DJI_0048.JPG" }, { title: "E-TIB Bohrtechnik GmbH", description: "Präzise Horizontalspülbohrungen in allen Bodenklassen für eine oberflächenschonende und grabenlose Leitungsverlegung.", icon: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z", - url: "/de/bohrtechnik", + url: "/de/standorte/kirchheilingen", backgroundImage: "/assets/photos/DSC08653.JPG" } ]} diff --git a/content/en/home.mdx b/content/en/home.mdx index b07d11c4d..e2c3ca1b1 100644 --- a/content/en/home.mdx +++ b/content/en/home.mdx @@ -20,6 +20,7 @@ description: "E-TIB GmbH is your reliable partner for complex cable routes, hori title: "E-TIB GMBH", description: "The complete range of services for the construction of cable routes from a single source.", icon: "M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z", + url: "/en/standorte/guben", backgroundImage: "/assets/photos/DJI_0243.JPG" }, { @@ -33,13 +34,14 @@ description: "E-TIB GmbH is your reliable partner for complex cable routes, hori title: "E-TIB Verwaltung GmbH", description: "Central services, purchasing, finance, and management of real estate, properties, machinery, and equipment.", icon: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4", + url: "/en/standorte/buelstedt", backgroundImage: "/assets/photos/DJI_0048.JPG" }, { title: "E-TIB Bohrtechnik GmbH", description: "Precise horizontal directional drilling in all soil classes for surface-friendly and trenchless pipe laying.", icon: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z", - url: "/en/drilling-technology", + url: "/en/standorte/kirchheilingen", backgroundImage: "/assets/photos/DSC08653.JPG" } ]} diff --git a/content/en/ueber-uns.mdx b/content/en/ueber-uns.mdx index 477e640cf..5b72992aa 100644 --- a/content/en/ueber-uns.mdx +++ b/content/en/ueber-uns.mdx @@ -65,7 +65,7 @@ layout: "fullBleed" title: "E-TIB GMBH", description: "The complete range of services for the construction of cable routes from a single source.", icon: "M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z", - url: "/en/cable-civil-engineering", + url: "/en/standorte/guben", backgroundImage: "/assets/photos/DJI_0243.JPG" }, { @@ -79,13 +79,14 @@ layout: "fullBleed" title: "E-TIB Verwaltung GmbH", description: "Central services, purchasing, finance, and management of real estate, properties, machinery, and equipment.", icon: "M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4", + url: "/en/standorte/buelstedt", backgroundImage: "/assets/photos/DJI_0048.JPG" }, { title: "E-TIB Bohrtechnik GmbH", description: "Precise horizontal directional drilling in all soil classes for surface-friendly and trenchless pipe laying.", icon: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z", - url: "/en/drilling-technology", + url: "/en/standorte/kirchheilingen", backgroundImage: "/assets/photos/DSC08653.JPG" } ]} diff --git a/lib/map-data.ts b/lib/map-data.ts index 844243d21..3b62aa2ba 100644 --- a/lib/map-data.ts +++ b/lib/map-data.ts @@ -11,36 +11,6 @@ export interface Location { } export const defaultLocations: Location[] = [ - { - id: 'guben', - name: 'Guben (Hauptsitz)', - type: 'hq', - x: 85, - y: 41.1, - description: 'E-TIB GmbH Holding & Bohrtechnik GmbH', - href: '/standorte/guben', - details: ['Zentrale Steuerung', 'Kabelleitungstiefbau', 'Maschinenpark'], - }, - { - id: 'kirchheilingen', - name: 'E-TIB Bohrtechnik GmbH', - type: 'branch', - x: 52, - y: 55, - description: 'Standort in Thüringen', - href: '/standorte/kirchheilingen', - details: ['Bahnhofstraße 180a', '99947 Kirchheilingen'], - }, - { - id: 'buelstedt', - name: 'Bülstedt (Ingenieurgesellschaft)', - type: 'branch', - x: 37, - y: 25.33, - description: 'E-TIB Ingenieurgesellschaft mbH', - href: '/standorte/buelstedt', - details: ['Planung & Projektierung', 'Vermessung', 'Dokumentation'], - }, { id: 'dettmannsdorf', name: 'Dettmannsdorf (PV)', diff --git a/tests/task-12-links.test.ts b/tests/task-12-links.test.ts index 25f36c50b..47354e6f0 100644 --- a/tests/task-12-links.test.ts +++ b/tests/task-12-links.test.ts @@ -18,12 +18,12 @@ describe('Task 12 TDD - Bohrtechnik and Reference Links', () => { const urlDeIndex = bohrtechnikDeBlock.indexOf('url:'); const nextItemDeIndex = bohrtechnikDeBlock.indexOf('title:', 10); - // Ensure "url:" exists within the E-TIB Bohrtechnik block and points to "/de/bohrtechnik" - expect(deContent).toMatch(/title:\s*"E-TIB Bohrtechnik GmbH"[\s\S]*?url:\s*["']\/de\/bohrtechnik["']/); + // Ensure "url:" exists within the E-TIB Bohrtechnik block and points to "/de/standorte/kirchheilingen" + expect(deContent).toMatch(/title:\s*"E-TIB Bohrtechnik GmbH"[\s\S]*?url:\s*["']\/de\/standorte\/kirchheilingen["']/); - // Assert that E-TIB Bohrtechnik GmbH has url: "/en/drilling-technology" in English content + // Assert that E-TIB Bohrtechnik GmbH has url: "/en/standorte/kirchheilingen" in English content expect(enContent).toContain('title: "E-TIB Bohrtechnik GmbH"'); - expect(enContent).toMatch(/title:\s*"E-TIB Bohrtechnik GmbH"[\s\S]*?url:\s*["']\/en\/drilling-technology["']/); + expect(enContent).toMatch(/title:\s*"E-TIB Bohrtechnik GmbH"[\s\S]*?url:\s*["']\/en\/standorte\/kirchheilingen["']/); }); it('should verify that all reference projects in map-data have no href links', () => {