fix: hide enrichment in portal, CF disabled button, no UAT flash, fix overlaps

SelectionToolbar: new hideEnrichment prop hides the Enrichment button.
Portal uses it to show only Export + Clear in selection toolbar.

Portal feature panel: added disabled "Solicita extras CF" button with
tooltip "Sectiune platita — contacteaza administratorul".

Initial map zoom: starts at zoom 15 (close-up) instead of 7 (Romania
overview). Prevents the UAT boundaries flash before fitBounds runs.
Applied to both ParcelSync Harta tab and Portal.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-25 06:58:01 +02:00
parent 6f46a85ff3
commit 45d4d1bf40
3 changed files with 20 additions and 2 deletions
+14
View File
@@ -1502,6 +1502,7 @@ function HartaContent() {
ref={mapHandleRef}
className="h-full w-full"
basemap={basemap}
zoom={15}
selectionType={selectionMode}
onFeatureClick={handleFeatureClick}
onSelectionChange={setSelectedFeatures}
@@ -1579,6 +1580,18 @@ function HartaContent() {
</>
);
})()}
<div className="pt-1.5 mt-1.5 border-t">
<Button
size="sm"
variant="outline"
className="w-full h-7 text-[11px] gap-1 opacity-50 cursor-not-allowed"
disabled
title="Sectiune platita — contacteaza administratorul"
>
<FileText className="h-3 w-3" />
Solicita extras CF
</Button>
</div>
</div>
</div>
)}
@@ -1590,6 +1603,7 @@ function HartaContent() {
selectedFeatures={selectedFeatures}
selectionMode={selectionMode}
onSelectionModeChange={handleSelectionModeChange}
hideEnrichment
onClearSelection={() => {
mapHandleRef.current?.clearSelection();
setSelectedFeatures([]);
@@ -21,6 +21,8 @@ type SelectionToolbarProps = {
onSelectionModeChange: (mode: SelectionMode) => void;
onClearSelection: () => void;
className?: string;
/** Hide the enrichment button (e.g. in portal view) */
hideEnrichment?: boolean;
};
const EXPORT_FORMATS: { id: ExportFormat; label: string }[] = [
@@ -40,6 +42,7 @@ export function SelectionToolbar({
onSelectionModeChange,
onClearSelection,
className,
hideEnrichment,
}: SelectionToolbarProps) {
const [exporting, setExporting] = useState(false);
const [enriching, setEnriching] = useState(false);
@@ -138,7 +141,7 @@ export function SelectionToolbar({
</DropdownMenuContent>
</DropdownMenu>
<Button
{!hideEnrichment && <Button
variant="ghost" size="sm" className="h-7 px-2 text-xs gap-1"
disabled={enriching}
title="Enrichment pentru parcelele selectate. Datele se salveaza permanent in baza de date."
@@ -168,7 +171,7 @@ export function SelectionToolbar({
>
{enriching ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <Sparkles className="h-3.5 w-3.5" />}
Enrichment
</Button>
</Button>}
<Button variant="ghost" size="sm" className="h-7 w-7 p-0" onClick={onClearSelection} title="Sterge selectia">
<Trash2 className="h-3.5 w-3.5" />
@@ -606,6 +606,7 @@ export function MapTab({ siruta, sirutaValid, sessionConnected, syncLocalCount,
ref={mapHandleRef}
className="h-full w-full"
basemap={basemap}
zoom={15}
selectionType={selectionMode}
onFeatureClick={handleFeatureClick}
onSelectionChange={setSelectedFeatures}