mirror of
https://github.com/R0m1k3/Priceflow.git
synced 2026-10-11 17:29:14 +02:00
Merge branch 'main' into antigravity
This commit is contained in:
3 files changed
+59
-2
No files matched your search
@@ -6,6 +6,8 @@ WORKDIR /app/frontend
|
||||
COPY frontend/package.json frontend/package-lock.json* ./
|
||||
RUN npm install
|
||||
|
||||
# Force cache invalidation for frontend source
|
||||
ARG CACHEBUST=1
|
||||
COPY frontend/ .
|
||||
RUN npm run build
|
||||
|
||||
|
||||
@@ -4,12 +4,17 @@ import { ExternalLink, Edit2, RefreshCw, Trash2, AlertTriangle, Clock, Tag, Hist
|
||||
import { Card, CardContent, CardFooter, CardHeader } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Marquee } from '@/components/ui/marquee';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
export function ItemCard({ item, onEdit, onDelete, onCheck, onZoom, onCategoryUpdate, categories, onViewHistory }) {
|
||||
const { t } = useTranslation();
|
||||
const [showCategorySelect, setShowCategorySelect] = useState(false);
|
||||
const [showNewCategoryDialog, setShowNewCategoryDialog] = useState(false);
|
||||
const [newCategoryName, setNewCategoryName] = useState('');
|
||||
|
||||
const getStockStatus = (inStock) => {
|
||||
if (inStock === true) return { label: t('dashboard.inStock'), color: 'bg-green-500/90 text-white border-green-400/50' };
|
||||
@@ -147,7 +152,13 @@ export function ItemCard({ item, onEdit, onDelete, onCheck, onZoom, onCategoryUp
|
||||
{onCategoryUpdate && (
|
||||
<Select
|
||||
value={item.category || '_none_'}
|
||||
onValueChange={(value) => onCategoryUpdate(item.id, value === '_none_' ? null : value)}
|
||||
onValueChange={(value) => {
|
||||
if (value === '__new__') {
|
||||
setShowNewCategoryDialog(true);
|
||||
} else {
|
||||
onCategoryUpdate(item.id, value === '_none_' ? null : value);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<SelectTrigger className="h-6 w-[120px] text-[10px]">
|
||||
<Tag className="h-2.5 w-2.5 mr-1" />
|
||||
@@ -164,6 +175,50 @@ export function ItemCard({ item, onEdit, onDelete, onCheck, onZoom, onCategoryUp
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* New Category Dialog */}
|
||||
<Dialog open={showNewCategoryDialog} onOpenChange={setShowNewCategoryDialog}>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>Nouvelle catégorie</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="space-y-4 py-4">
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="category-name">Nom de la catégorie</Label>
|
||||
<Input
|
||||
id="category-name"
|
||||
value={newCategoryName}
|
||||
onChange={(e) => setNewCategoryName(e.target.value)}
|
||||
placeholder="ex: Électronique"
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' && newCategoryName.trim()) {
|
||||
onCategoryUpdate(item.id, newCategoryName.trim());
|
||||
setNewCategoryName('');
|
||||
setShowNewCategoryDialog(false);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<Button variant="outline" onClick={() => {
|
||||
setNewCategoryName('');
|
||||
setShowNewCategoryDialog(false);
|
||||
}}>
|
||||
Annuler
|
||||
</Button>
|
||||
<Button onClick={() => {
|
||||
if (newCategoryName.trim()) {
|
||||
onCategoryUpdate(item.id, newCategoryName.trim());
|
||||
setNewCategoryName('');
|
||||
setShowNewCategoryDialog(false);
|
||||
}
|
||||
}} disabled={!newCategoryName.trim()}>
|
||||
Créer
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
{/* Description */}
|
||||
{item.description && (
|
||||
<p className="text-xs text-muted-foreground line-clamp-2 leading-relaxed">
|
||||
|
||||
@@ -680,7 +680,7 @@ export default function Settings() {
|
||||
{/* Notification Profiles */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle className="flex items-center gap-2"><Bell className="h-5 w-5" />Notification Profiles</CardTitle>
|
||||
<CardTitle className="flex items-center gap-2"><Bell className="h-5 w-5" />TEST 2025 - Notification Profiles</CardTitle>
|
||||
<CardDescription>Manage notification settings for different groups of items.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-8">
|
||||
|
||||
Reference in new issue
Block a user