feat: hromadny import produktov zo ZIP-u s podkladmi (xlsx + fotky)

Tabulka z Databazy produktov sa precita bez mapovania stlpcov, fotky
<EAN>/web/*.png sa zmensia na 1000 px a nahraju. Cenovka sa hlada podla
Zlava graficka | Farba cenovky | Povod. Importovane produkty preberu
rozlozenie karty z prveho produktu v sekcii.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub_HostacnyandClaude Opus 5.5 committed 2026-10-21 13:57:16 +02:00
1 parent 48fd82a77d
commit 9b1f7b60cf
3 files changed
+303 -6

No files matched your search

+14 -1
View File
@@ -357,11 +357,24 @@ export default function Home() {
return;
}
// Rozloženie karty (cenovka, štítky predajní, farba) prevezmú nové produkty z prvého produktu v sekcii
const first: ProductItem | undefined = target.data.products?.[0];
const layoutKeys = [
'badgeWidth', 'badgeAlign', 'badgeLayout', 'badgePaddingTop', 'badgePaddingBottom',
'storesOffsetX', 'storesOffsetY', 'storesSize', 'cardBgColor'
] as const;
const withLayout = imported.map((p) => {
if (!first) return p;
const inherited: Partial<ProductItem> = {};
for (const k of layoutKeys) if (p[k] === undefined && first[k] !== undefined) Object.assign(inherited, { [k]: first[k] });
return { ...inherited, ...p };
});
const updated = {
...target,
data: {
...target.data,
products: [...(target.data.products || []), ...imported]
products: [...(target.data.products || []), ...withLayout]
}
};
handleUpdateModule(updated);