fix: frontend fixes batch - live search proxy, quick products 10 slots, categories emoji list, bell notifications with tabs, awaiting payment orders endpoint

This commit is contained in:
chattie
2026-08-24 17:22:08 +02:00
parent d9a57aaa05
commit 85ecee935b
17 changed files with 460 additions and 71 deletions

View File

@@ -91,11 +91,41 @@ const EMPTY_FORM: FormState = {
};
const EMOJI_OPTIONS = [
'🥬', '🥕', '🍎', '🥑', '🍞', '🧀', '🥛', '🍯', '🌾', '🥜',
'🍵', '', '🍫', '🧴', '🧼', '🌿', '🌱', '🌸', '🐝', '🐇',
'🧺', '♻️', '🏺', '🍶', '🥣', '🧊', '🍇', '🐔', '🐟', '🍊',
// Frutas y verduras
'🥬', '🥦', '🥕', '🍆', '🌶️', '🥑', '🥒', '🫑', '🧅', '🧄',
'🍅', '🥔', '🥐', '🍞', '🥖', '🫓', '🥗', '🥙', '🌽', '🍠',
// Frutas
'🍎', '🍏', '🍐', '🍊', '🍋', '🍌', '🍉', '🍇', '🍓', '🫐',
'🍒', '🍑', '🥭', '🍍', '🥥', '🥝', '🫒', '🍅', '🥑', '🍏',
// Lácteos y huevos
'🥛', '🧀', '🍶', '🥛', '🧈', '🧀', '🥚', '🍳', '🧀', '🧁',
// Aceites y condimentos
'🫒', '🫙', '🧂', '🌶️', '🧄', '🍯', '🫕', '🧂', '🥫', '🫗',
// Infusiones y bebidas
'🍵', '☕', '🫖', '🍺', '🍷', '🥂', '🍾', '🧃', '🥤', '🧋',
// Especias y semillas
'🌿', '🌱', '🌾', '🥜', '🌰', '🫘', '🫘', '🫘', '🍄', '🦴',
// Ecológico y naturaleza
'🌸', '🌻', '🌺', '🌹', '🪻', '🌾', '🌵', '🌲', '🪨', '🍃',
// Animales y eco
'🐝', '🐇', '🦆', '🐔', '🐟', '🦐', '🐚', '🦀', '🍯', '🐝',
// Diversos alimentación
'🍫', '🍬', '🍭', '🍦', '🧁', '🍩', '🍪', '🎂', '🍰', '🥧',
'🧇', '🧈', '🥓', '🥩', '🍖', '🌯', '🥙', '🥗', '🍜', '🍝',
'🍕', '🥪', '🥐', '🫓', '🥯', '🧇', '🥞', '🥞', '🍳', '🧃',
];
// Categorías populares predefinidas
const CATEGORY_EMOJI_SUGGESTIONS = [
'🥬 Hortalizas', '🍎 Frutas', '🧀 Lácteos', '🍯 Miel y Derivatives',
'🌿 Hierbas aromáticas', '🫒 Aceites', '☕ Café e infusiones',
'🍞 Panadería', '🥜 Frutos secos', '🍫 Chocolate',
'🧴 Cosmética natural', '🌱 Semillas y germinados', '🍄 Setas',
'🥦 Colesterol y salud', '🧺 Compra a granel', '♻️ Cero residuos',
];
const EMOJI_CODE_HINT = 'U+1F34E (🍎) — busca en emojipedia.org';
const CARD_PRESETS: Array<{ bg: string; text: string; label: string }> = [
{ bg: '#F1F8E9', text: '#2D6A4F', label: 'Verde' },
{ bg: '#FFF8E1', text: '#B07D2B', label: 'Miel' },
@@ -376,7 +406,7 @@ export default function CategoriesPage() {
className="text-xs text-gray-400 hover:text-red-500">Quitar</button>
)}
</div>
<div className="grid grid-cols-10 gap-1 border border-gray-200 rounded-xl p-2 max-h-28 overflow-y-auto">
<div className="grid grid-cols-10 gap-1 border border-gray-200 rounded-xl p-2 max-h-36 overflow-y-auto">
{EMOJI_OPTIONS.map((emoji) => (
<button key={emoji} type="button" onClick={() => setForm((f) => ({ ...f, emoji }))}
className={`text-xl p-1 rounded-lg transition-colors ${
@@ -386,7 +416,21 @@ export default function CategoriesPage() {
</button>
))}
</div>
<p className="text-xs text-gray-400 mt-1">Emoji identificativo que aparecerá en las tarjetas de categoría.</p>
<div className="mt-2 flex items-center gap-2">
<input
type="text"
value={form.emoji}
onChange={(e) => setForm((f) => ({ ...f, emoji: e.target.value.slice(0, 8) }))}
placeholder="😀 o U+1F600"
maxLength={8}
className="flex-1 px-3 py-2 border border-gray-300 rounded-xl text-sm text-2xl text-center"
title={EMOJI_CODE_HINT}
/>
<span className="text-xs text-gray-400 max-w-[160px] hidden sm:block">
Escribe emoji o U+XXXX
</span>
</div>
<p className="text-xs text-gray-400 mt-1">Emoji identificativo que aparecerá en las tarjetas de categoría. Escribe o pega cualquier emoji.</p>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-1">Color de tarjeta</label>

View File

@@ -93,7 +93,7 @@ export default function PosAdminPage() {
const [touchEnabled, setTouchEnabled] = useState(true);
const [discountsEnabled, setDiscountsEnabled] = useState(true);
const [quickSlots, setQuickSlots] = useState<Array<string | null>>(
Array.from({ length: 8 }, () => null),
Array.from({ length: 10 }, () => null),
);
const [savingTouch, setSavingTouch] = useState(false);
const [touchMessage, setTouchMessage] = useState('');
@@ -197,7 +197,7 @@ export default function PosAdminPage() {
setTouchEnabled(terminal.settings?.touchNavigationEnabled !== false);
setDiscountsEnabled(terminal.settings?.lineDiscountsEnabled !== false);
const configured = terminal.settings?.quickProductVariantIds ?? [];
setQuickSlots(Array.from({ length: 8 }, (_, slot) => configured[slot] ?? null));
setQuickSlots(Array.from({ length: 10 }, (_, slot) => configured[slot] ?? null));
setTouchMessage('');
setSelfpayMode(terminal.settings?.selfpayMode ?? false);
setClosePinRequired(terminal.settings?.closeSessionRequiresPin ?? false);