fix(parcel-sync): add intravilan to primary layers + tooltip on stale badge
- LIMITE_INTRAV_DYNAMIC added to primary layers checked for freshness - Auto-refresh scheduler and weekend sync now also sync intravilan - "X vechi" badge shows tooltip with exact layer names and dates - "Proaspete" badge also shows tooltip with layer details Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -143,9 +143,8 @@ export function ExportTab({
|
||||
|
||||
const dbTotalFeatures = dbLayersSummary.reduce((sum, l) => sum + l.count, 0);
|
||||
|
||||
// Only check primary layers (terenuri + cladiri) for freshness —
|
||||
// secondary layers (intravilan, limite UAT) don't affect export readiness
|
||||
const PRIMARY_LAYERS = ["TERENURI_ACTIVE", "CLADIRI_ACTIVE"];
|
||||
// Primary layers synced by background jobs — these determine freshness
|
||||
const PRIMARY_LAYERS = ["TERENURI_ACTIVE", "CLADIRI_ACTIVE", "LIMITE_INTRAV_DYNAMIC"];
|
||||
const primaryLayers = dbLayersSummary.filter((l) =>
|
||||
PRIMARY_LAYERS.includes(l.id),
|
||||
);
|
||||
@@ -626,11 +625,8 @@ export function ExportTab({
|
||||
layere
|
||||
</span>
|
||||
{(() => {
|
||||
// Check freshness only for primary layers (terenuri + cladiri)
|
||||
const freshCount = primaryLayers.filter(
|
||||
(l) => l.isFresh,
|
||||
).length;
|
||||
const staleCount = primaryLayers.length - freshCount;
|
||||
const staleLayers = primaryLayers.filter((l) => !l.isFresh);
|
||||
const freshLayers = primaryLayers.filter((l) => l.isFresh);
|
||||
const newestSync = primaryLayers.reduce(
|
||||
(newest, l) => {
|
||||
if (!l.lastSynced) return newest;
|
||||
@@ -639,25 +635,35 @@ export function ExportTab({
|
||||
},
|
||||
null as Date | null,
|
||||
);
|
||||
// Tooltip: list which layers are stale/fresh with dates
|
||||
const staleTooltip = staleLayers.length > 0
|
||||
? `Vechi: ${staleLayers.map((l) => `${l.label} (${l.lastSynced ? relativeTime(l.lastSynced) : "nesincronizat"})`).join(", ")}`
|
||||
: "";
|
||||
const freshTooltip = freshLayers.length > 0
|
||||
? `Proaspete: ${freshLayers.map((l) => `${l.label} (${l.lastSynced ? relativeTime(l.lastSynced) : ""})`).join(", ")}`
|
||||
: "";
|
||||
const fullTooltip = [staleTooltip, freshTooltip].filter(Boolean).join("\n");
|
||||
return (
|
||||
<>
|
||||
{staleCount === 0 && primaryLayers.length > 0 ? (
|
||||
{staleLayers.length === 0 && primaryLayers.length > 0 ? (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="text-emerald-600 border-emerald-200 dark:text-emerald-400 dark:border-emerald-800"
|
||||
className="text-emerald-600 border-emerald-200 dark:text-emerald-400 dark:border-emerald-800 cursor-default"
|
||||
title={fullTooltip}
|
||||
>
|
||||
<CheckCircle2 className="h-3 w-3 mr-1" />
|
||||
Proaspete
|
||||
</Badge>
|
||||
) : (
|
||||
) : staleLayers.length > 0 ? (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="text-amber-600 border-amber-200 dark:text-amber-400 dark:border-amber-800"
|
||||
className="text-amber-600 border-amber-200 dark:text-amber-400 dark:border-amber-800 cursor-default"
|
||||
title={fullTooltip}
|
||||
>
|
||||
<Clock className="h-3 w-3 mr-1" />
|
||||
{staleCount} vechi
|
||||
{staleLayers.length} vechi
|
||||
</Badge>
|
||||
)}
|
||||
) : null}
|
||||
{newestSync && (
|
||||
<span className="text-xs text-muted-foreground">
|
||||
Ultima sincronizare: {relativeTime(newestSync)}
|
||||
|
||||
Reference in New Issue
Block a user