fix(parcel-sync): fix ArcGIS 1000 server cap pagination + scan improvements

- eterra-client: detect server maxRecordCount cap in fetchAllLayerByWhere
  When server returns exactly 1000 (or other round cap) but we asked for 2000,
  recognize this as a server limit, adjust pageSize, and CONTINUE paginating.
  Previously: 1000 < 2000 -> break (lost all data beyond page 1).

- no-geom-sync: count layers first, pass total to fetchAllLayer
  Belt-and-suspenders: even if cap detection misses, known total prevents
  early termination. Also use pageSize 1000 to match typical server cap.
  Clădiri count uses countLayer instead of fetching all OBJECTIDs.

- UI: add include-no-geom checkbox in background sync section
  Users can toggle it independently of scan status.
  Shows '(scanare in curs)' hint when scan is still running.
This commit is contained in:
AI Assistant
2026-03-08 02:37:39 +02:00
parent d12f01fc02
commit 041bfd4138
3 changed files with 77 additions and 14 deletions
@@ -3068,6 +3068,30 @@ export function ParcelSyncModule() {
</span>
</div>
{/* Include no-geom toggle (works independently of scan) */}
{session.connected && (
<label className="flex items-center gap-2 cursor-pointer select-none ml-6">
<input
type="checkbox"
checked={includeNoGeom}
onChange={(e) => setIncludeNoGeom(e.target.checked)}
disabled={
exporting ||
(!!bgJobId && bgProgress?.status === "running")
}
className="h-4 w-4 rounded border-muted-foreground/30 accent-amber-600"
/>
<span className="text-xs">
Include și parcelele fără geometrie
</span>
{noGeomScanning && (
<span className="text-[10px] text-muted-foreground">
(scanare în curs)
</span>
)}
</label>
)}
{/* Row 2: Background sync buttons */}
{session.connected && (
<div className="grid gap-2 sm:grid-cols-2">