From 3004790ad28e53d7b6f7bb44bb0d429c0c12a280 Mon Sep 17 00:00:00 2001
From: Claude VM
Date: Wed, 20 May 2026 07:36:01 +0300
Subject: [PATCH] =?UTF-8?q?feat(geoportal-v2):=20cladire=20characteristics?=
=?UTF-8?q?=20+=20eterra.live=20link=20+=20collapsible=20=C3=8Enscriere?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Per Marius's iteration on the panel:
1. AUTO-ENRICH DISABLED — the panel no longer fires /parcel/enrich on
sparse-data load. Refresh only via the explicit "Actualizează"
button in the Date eTerra header. Keeps the eTerra account pool
safe from browse-spam (was draining 500/h on rapid clicks).
2. eterra.live link button — sits beside "Actualizează" in the Date
eTerra header. Opens https://eterra.live/harta?siruta=...&cad=...
in a new tab so the user can cross-check the full eterra.live
panel.
3. ÎNSCRIERE collapsible — Tip înscriere / Data cererii / Act
proprietate now hide inside a closed by default (per
the highlighted-block screenshot). Keeps the "above the fold"
info trimmed to what matters at a glance.
4. CARACTERISTICI CORP — new section, only rendered for
CLADIRI_ACTIVE clicks. Shows the cladire-specific enrichment
fields the orchestrator populates after a deep-enrich:
- Chip row: tip / destinație / subtype (chips) + Condominium
chip with unit count + Cu/Fără acte status pill
- 3-col metric strip: Regim înălțime / Niveluri / An construire
- Suprafață CF, CF IE, Clasă energetică, Părți comune (rows)
- Observații (multi-line InfoBlock)
Fields wired: CLADIRE_TYPE, CLADIRE_DESTINATIE, CLADIRE_SUBTYPE,
CLADIRE_REGIM, CLADIRE_NIVELURI, CLADIRE_AN_CONSTRUIRE,
CLADIRE_AREA_CF, CLADIRE_OBSERVATII, CLADIRE_LANDBOOK_IE,
CLADIRE_COMMON_PARTS, CLADIRE_UNITS_NO_ANCPI,
CLADIRE_ENERGETIC_CLASS, IS_LEGAL_BUILDING, IS_CONDOMINIUM.
All show only when populated (no empty "-" rows). LABEL map
extended with Romanian translations.
Co-Authored-By: Claude Opus 4.7 (1M context)
---
.../geoportal/v2/feature-info-panel.tsx | 248 ++++++++++++++----
1 file changed, 198 insertions(+), 50 deletions(-)
diff --git a/src/modules/geoportal/v2/feature-info-panel.tsx b/src/modules/geoportal/v2/feature-info-panel.tsx
index 009a634..31903bf 100644
--- a/src/modules/geoportal/v2/feature-info-panel.tsx
+++ b/src/modules/geoportal/v2/feature-info-panel.tsx
@@ -6,7 +6,7 @@ import {
X, RefreshCw, Loader2, FileText, Download, AlertCircle,
Home, Building, Building2, MapPin, ChevronRight, Users,
Sparkles, User, ShieldCheck, AlertTriangle, HelpCircle,
- Factory, Warehouse,
+ Factory, Warehouse, ExternalLink, Hash, Layers, CalendarDays,
} from "lucide-react";
import { cn } from "@/shared/lib/utils";
@@ -98,6 +98,23 @@ const LABEL: Record = {
UAT: "UAT",
UAT_SIRUTA: "SIRUTA",
PARCEL_TECH_ENRICHED_AT: "Actualizat tehnic",
+ // Cladire-specific (CLADIRI_ACTIVE)
+ CLADIRE_TYPE: "Tip clădire",
+ CLADIRE_DESTINATIE: "Destinație",
+ CLADIRE_DESTINATIE_CODE: "Cod destinație",
+ CLADIRE_SUBTYPE: "Subtip",
+ CLADIRE_REGIM: "Regim înălțime",
+ CLADIRE_NIVELURI: "Niveluri",
+ CLADIRE_AN_CONSTRUIRE: "An construire",
+ CLADIRE_AREA_CF: "Suprafață CF",
+ CLADIRE_LANDBOOK_IE: "Carte funciară IE",
+ CLADIRE_COMMON_PARTS: "Părți comune",
+ CLADIRE_OBSERVATII: "Observații",
+ CLADIRE_UNITS_NO_ANCPI: "Nr. unități ANCPI",
+ CLADIRE_ENERGETIC_CLASS: "Clasă energetică",
+ IS_LEGAL_BUILDING: "Clădire legală",
+ IS_CONDOMINIUM: "Condominium",
+ ENRICHED_AT: "Actualizat",
};
// ────────────────────────────────────────────────────────── formatters
@@ -657,29 +674,10 @@ export function FeatureInfoPanel({ feature, onClose, onSelectFeature, basic = fa
],
);
- // Auto-enrich on sparse data
- useEffect(() => {
- if (basic || !detail || refreshing) return;
- const e = (detail.enrichment ?? {}) as Record;
- const richPresent = Boolean(e.NR_CF || e.ADRESA || e.PROPRIETARI);
- if (richPresent) return;
- const parcelKey =
- String(detail.id ?? "") ||
- `${feature.siruta}:${feature.cadastralRef}:${feature.layerId}`;
- const ssKey = `gis_auto_enrich_${parcelKey}`;
- if (typeof sessionStorage === "undefined") return;
- if (sessionStorage.getItem(ssKey)) return;
- sessionStorage.setItem(ssKey, "1");
- void refreshFromAncpi();
- }, [
- basic,
- detail,
- refreshing,
- feature.siruta,
- feature.cadastralRef,
- feature.layerId,
- refreshFromAncpi,
- ]);
+ // Auto-enrich on sparse data — DISABLED per Marius. Refresh fires
+ // only when the user explicitly hits the "Actualizează" button in
+ // the Date eTerra header. Keeps the eTerra account pool out of
+ // browse-spam territory.
const handleBuildingSelect = (b: BuildingItem) => {
if (!onSelectFeature) return;
@@ -746,6 +744,40 @@ export function FeatureInfoPanel({ feature, onClose, onSelectFeature, basic = fa
? buildings.length
: hasBuildingFlag;
+ // Cladire-specific (only meaningful for CLADIRI_ACTIVE)
+ const cladireType = String(enrichment.CLADIRE_TYPE ?? "").trim();
+ const cladireDestinatie = String(enrichment.CLADIRE_DESTINATIE ?? "").trim();
+ const cladireSubtype = String(enrichment.CLADIRE_SUBTYPE ?? "").trim();
+ const cladireRegim = String(enrichment.CLADIRE_REGIM ?? "").trim();
+ const cladireNiveluri = enrichment.CLADIRE_NIVELURI;
+ const cladireAn = String(enrichment.CLADIRE_AN_CONSTRUIRE ?? "").trim();
+ const cladireAreaCf = formatArea(enrichment.CLADIRE_AREA_CF);
+ const cladireObservatii = String(enrichment.CLADIRE_OBSERVATII ?? "").trim();
+ const cladireLandbookIe = String(enrichment.CLADIRE_LANDBOOK_IE ?? "").trim();
+ const cladireCommonParts = String(enrichment.CLADIRE_COMMON_PARTS ?? "").trim();
+ const cladireUnitsNo = enrichment.CLADIRE_UNITS_NO_ANCPI;
+ const cladireEnergetic = String(enrichment.CLADIRE_ENERGETIC_CLASS ?? "").trim();
+ const isLegalBuilding = enrichment.IS_LEGAL_BUILDING;
+ const isCondominium = Number(enrichment.IS_CONDOMINIUM ?? 0) === 1;
+
+ const hasCladireData =
+ isCladiri &&
+ Boolean(
+ cladireType ||
+ cladireDestinatie ||
+ cladireSubtype ||
+ cladireRegim ||
+ cladireAn ||
+ cladireAreaCf ||
+ cladireObservatii ||
+ cladireLandbookIe ||
+ cladireEnergetic ||
+ cladireNiveluri != null ||
+ cladireUnitsNo != null ||
+ isLegalBuilding != null ||
+ isCondominium,
+ );
+
const isActive = detail?.isActive !== false;
const cadrefHeader = feature.cadastralRef || feature.objectId || "—";
@@ -882,27 +914,39 @@ export function FeatureInfoPanel({ feature, onClose, onSelectFeature, basic = fa
Date eTerra
-
+
+
+
+
+ eterra.live
+
+
@@ -964,11 +1008,19 @@ export function FeatureInfoPanel({ feature, onClose, onSelectFeature, basic = fa
)}
{(tipInscriere || dataCererii || actProp) && (
-
- {tipInscriere && }
- {dataCererii && }
- {actProp && }
-
+
+
+
+
+ Înscriere
+
+
+
+ {tipInscriere && }
+ {dataCererii && }
+ {actProp && }
+
+
)}
@@ -992,6 +1044,102 @@ export function FeatureInfoPanel({ feature, onClose, onSelectFeature, basic = fa
)}
+ {/* Caracteristici corp (cladiri only) */}
+ {!loading && isCladiri && hasCladireData && (
+
+
+
+
+ Caracteristici corp
+
+
+
+ {/* Tip + destinatie + subtype as chips */}
+
+ {cladireType && {cladireType}}
+ {cladireDestinatie && (
+ {cladireDestinatie}
+ )}
+ {cladireSubtype && cladireSubtype !== cladireDestinatie && (
+ {cladireSubtype}
+ )}
+ {isCondominium && (
+ }
+ >
+ Condominium{cladireUnitsNo != null && ` · ${cladireUnitsNo} u.`}
+
+ )}
+ {Number(isLegalBuilding) === 1 && (
+ }
+ >
+ Cu acte
+
+ )}
+ {Number(isLegalBuilding) === 0 && (
+ }
+ >
+ Fără acte
+
+ )}
+
+
+ {/* Grid 3-col metrics: regim / niveluri / an */}
+ {(cladireRegim || cladireNiveluri != null || cladireAn) && (
+
+
+
+ Regim
+
+
+ {cladireRegim || "—"}
+
+
+
+
+ Niveluri
+
+
+ {cladireNiveluri != null && cladireNiveluri !== ""
+ ? String(cladireNiveluri)
+ : "—"}
+
+
+
+
+ An
+
+
+ {cladireAn || "—"}
+
+
+
+ )}
+
+ {cladireAreaCf && (
+
+ )}
+ {cladireLandbookIe && (
+
+ )}
+ {cladireEnergetic && (
+
+ )}
+ {cladireCommonParts && (
+
+ )}
+ {cladireObservatii && (
+
+ )}
+
+
+ )}
+
{/* Apartamente (cladiri only) */}
{!loading && isCladiri && (condoLoading || (condoOwners && condoOwners.length > 0)) && (