fix: export buttons direct (no dropdown), compact mobile cards
Export fix: - Replaced DropdownMenu with direct DXF/GPKG buttons in SelectionToolbar. Radix dropdown portals don't work inside fixed z-[110] containers. Direct buttons work reliably on all platforms. Mobile RGI cards: - Single-row compact layout: icon + nr cerere + solicitant + termen + status - Smaller icons (3.5), tighter spacing, shorter status labels - No Card wrapper — lightweight border div for less visual weight Mobile filters: - Tighter spacing, smaller labels Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -788,10 +788,10 @@ function RgiContent() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Card>
|
<Card>
|
||||||
<CardContent className="pt-4 space-y-3">
|
<CardContent className="pt-3 sm:pt-4 space-y-2 sm:space-y-3">
|
||||||
<div className="flex items-end gap-3 flex-wrap">
|
<div className="flex items-end gap-2 sm:gap-3 flex-wrap">
|
||||||
<div className="space-y-1">
|
<div className="space-y-0.5 sm:space-y-1">
|
||||||
<Label className="text-xs">Judet</Label>
|
<Label className="text-[11px] sm:text-xs">Judet</Label>
|
||||||
<Select
|
<Select
|
||||||
value={String(countyId)}
|
value={String(countyId)}
|
||||||
onValueChange={(v) => setCountyId(parseInt(v, 10))}
|
onValueChange={(v) => setCountyId(parseInt(v, 10))}
|
||||||
@@ -920,56 +920,52 @@ function RgiContent() {
|
|||||||
|
|
||||||
{/* Mobile card view */}
|
{/* Mobile card view */}
|
||||||
{!loading && processed.length > 0 && (
|
{!loading && processed.length > 0 && (
|
||||||
<div className="space-y-2 sm:hidden">
|
<div className="space-y-1.5 sm:hidden">
|
||||||
{processed.map((app) => {
|
{processed.map((app) => {
|
||||||
const pk = app.applicationPk;
|
const pk = app.applicationPk;
|
||||||
const isExpanded = expandedPk === pk;
|
const isExpanded = expandedPk === pk;
|
||||||
const solved = app.hasSolution === 1;
|
const solved = app.hasSolution === 1;
|
||||||
return (
|
return (
|
||||||
<Card key={pk} className={cn(isExpanded && "ring-1 ring-foreground/10")}>
|
<div
|
||||||
<CardContent className="p-3">
|
key={pk}
|
||||||
<div className="flex items-start gap-2" onClick={() => setExpandedPk(isExpanded ? null : pk)}>
|
className={cn(
|
||||||
<button
|
"rounded-lg border px-2.5 py-1.5 transition-colors",
|
||||||
type="button"
|
isExpanded ? "bg-muted/20 ring-1 ring-foreground/10" : "hover:bg-muted/10",
|
||||||
className="mt-0.5 shrink-0"
|
)}
|
||||||
title={`Descarca arhiva ZIP cu toate documentele cererii ${app.appNo}`}
|
>
|
||||||
onClick={(e) => { e.stopPropagation(); void downloadAllForApp(app); }}
|
<div className="flex items-center gap-1.5" onClick={() => setExpandedPk(isExpanded ? null : pk)}>
|
||||||
disabled={downloadingAppPk === pk}
|
<button
|
||||||
>
|
type="button"
|
||||||
{downloadingAppPk === pk ? (
|
className="shrink-0"
|
||||||
<Loader2 className="h-4 w-4 animate-spin text-emerald-500" />
|
title={`Descarca ZIP cererea ${app.appNo}`}
|
||||||
) : solved ? (
|
onClick={(e) => { e.stopPropagation(); void downloadAllForApp(app); }}
|
||||||
<Download className="h-4 w-4 text-emerald-500" />
|
disabled={downloadingAppPk === pk}
|
||||||
) : (
|
>
|
||||||
<Clock className="h-4 w-4 text-muted-foreground" />
|
{downloadingAppPk === pk ? (
|
||||||
)}
|
<Loader2 className="h-3.5 w-3.5 animate-spin text-emerald-500" />
|
||||||
</button>
|
) : solved ? (
|
||||||
<div className="flex-1 min-w-0">
|
<Download className="h-3.5 w-3.5 text-emerald-500" />
|
||||||
<div className="flex items-center gap-2 justify-between">
|
) : (
|
||||||
<span className="font-mono font-bold text-sm">{app.appNo}</span>
|
<Clock className="h-3.5 w-3.5 text-muted-foreground" />
|
||||||
<Badge
|
)}
|
||||||
variant={solved ? "default" : "secondary"}
|
</button>
|
||||||
className={cn("text-[10px]", solved && "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400")}
|
<span className="font-mono font-bold text-[13px]">{app.appNo}</span>
|
||||||
>
|
<span className="text-[11px] text-muted-foreground truncate flex-1 min-w-0">{app.requester || app.deponent || "-"}</span>
|
||||||
{app.statusName || app.stateCode || "-"}
|
<span className="text-[10px] text-muted-foreground tabular-nums shrink-0">{fmtTs(app.dueDate)}</span>
|
||||||
</Badge>
|
<Badge
|
||||||
</div>
|
variant={solved ? "default" : "secondary"}
|
||||||
<p className="text-xs text-muted-foreground truncate">{app.requester || app.deponent || "-"}</p>
|
className={cn("text-[9px] h-4 px-1 shrink-0", solved && "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-400")}
|
||||||
<div className="flex items-center gap-3 text-[11px] text-muted-foreground mt-1">
|
>
|
||||||
<span>Termen: {fmtTs(app.dueDate)}</span>
|
{(app.statusName || "").length > 12 ? (app.resolutionName || "-") : (app.statusName || "-")}
|
||||||
<Badge variant="outline" className="text-[9px]">{app.resolutionName || "-"}</Badge>
|
</Badge>
|
||||||
{app.uat && <span>{app.uat}</span>}
|
{isExpanded ? <ChevronUp className="h-3 w-3 text-muted-foreground shrink-0" /> : <ChevronDown className="h-3 w-3 text-muted-foreground shrink-0" />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{isExpanded && (
|
||||||
{isExpanded ? <ChevronUp className="h-4 w-4 text-muted-foreground shrink-0" /> : <ChevronDown className="h-4 w-4 text-muted-foreground shrink-0" />}
|
<div className="mt-1.5 pt-1.5 border-t">
|
||||||
|
<IssuedDocsPanel applicationPk={pk} workspaceId={app.workspaceId} appNo={app.appNo} />
|
||||||
</div>
|
</div>
|
||||||
{isExpanded && (
|
)}
|
||||||
<div className="mt-2 pt-2 border-t">
|
</div>
|
||||||
<IssuedDocsPanel applicationPk={pk} workspaceId={app.workspaceId} appNo={app.appNo} />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</CardContent>
|
|
||||||
</Card>
|
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,12 +3,7 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Download, Trash2, MousePointerClick, Square, PenTool, Loader2, Sparkles } from "lucide-react";
|
import { Download, Trash2, MousePointerClick, Square, PenTool, Loader2, Sparkles } from "lucide-react";
|
||||||
import { Button } from "@/shared/components/ui/button";
|
import { Button } from "@/shared/components/ui/button";
|
||||||
import {
|
// Direct buttons instead of dropdown — works reliably on mobile + fixed containers
|
||||||
DropdownMenu,
|
|
||||||
DropdownMenuContent,
|
|
||||||
DropdownMenuItem,
|
|
||||||
DropdownMenuTrigger,
|
|
||||||
} from "@/shared/components/ui/dropdown-menu";
|
|
||||||
import { Badge } from "@/shared/components/ui/badge";
|
import { Badge } from "@/shared/components/ui/badge";
|
||||||
import { cn } from "@/shared/lib/utils";
|
import { cn } from "@/shared/lib/utils";
|
||||||
import type { SelectedFeature, ExportFormat } from "../types";
|
import type { SelectedFeature, ExportFormat } from "../types";
|
||||||
@@ -125,21 +120,20 @@ export function SelectionToolbar({
|
|||||||
{selectedFeatures.length} parcele
|
{selectedFeatures.length} parcele
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|
||||||
<DropdownMenu>
|
{EXPORT_FORMATS.map((fmt) => (
|
||||||
<DropdownMenuTrigger asChild>
|
<Button
|
||||||
<Button variant="ghost" size="sm" className="h-7 px-2 text-xs gap-1" disabled={exporting}>
|
key={fmt.id}
|
||||||
{exporting ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <Download className="h-3.5 w-3.5" />}
|
variant="ghost"
|
||||||
Export
|
size="sm"
|
||||||
</Button>
|
className="h-7 px-2 text-xs gap-1"
|
||||||
</DropdownMenuTrigger>
|
disabled={exporting}
|
||||||
<DropdownMenuContent align="start">
|
onClick={() => void handleExport(fmt.id)}
|
||||||
{EXPORT_FORMATS.map((fmt) => (
|
title={fmt.label}
|
||||||
<DropdownMenuItem key={fmt.id} onClick={() => handleExport(fmt.id)} className="text-xs">
|
>
|
||||||
{fmt.label}
|
{exporting ? <Loader2 className="h-3.5 w-3.5 animate-spin" /> : <Download className="h-3.5 w-3.5" />}
|
||||||
</DropdownMenuItem>
|
<span className="hidden sm:inline">{fmt.id.toUpperCase()}</span>
|
||||||
))}
|
</Button>
|
||||||
</DropdownMenuContent>
|
))}
|
||||||
</DropdownMenu>
|
|
||||||
|
|
||||||
{!hideEnrichment && <Button
|
{!hideEnrichment && <Button
|
||||||
variant="ghost" size="sm" className="h-7 px-2 text-xs gap-1"
|
variant="ghost" size="sm" className="h-7 px-2 text-xs gap-1"
|
||||||
|
|||||||
Reference in New Issue
Block a user