Fix inventory icons and material badges display
- Add support for boja_hex field from database - Fix vakum/otvoreno detection to properly show inventory badges - Update all filaments in database with correct hex color codes - Remove duplicate text in material modifier badges - Fix storage condition detection for Da/Ne values - Exclude .claude directory from security checks
This commit is contained in:
@@ -16,6 +16,7 @@ const excludePatterns = [
|
|||||||
/node_modules/,
|
/node_modules/,
|
||||||
/\.git/,
|
/\.git/,
|
||||||
/\.next/,
|
/\.next/,
|
||||||
|
/\.claude/,
|
||||||
/dist/,
|
/dist/,
|
||||||
/build/,
|
/build/,
|
||||||
/out/,
|
/out/,
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ export const FilamentTableV2: React.FC<FilamentTableV2Props> = ({ filaments, loa
|
|||||||
modifier: legacy.finish !== 'Basic' ? legacy.finish : undefined
|
modifier: legacy.finish !== 'Basic' ? legacy.finish : undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
const storageCondition = legacy.vakum?.toLowerCase().includes('vakuum') ? 'vacuum' :
|
const storageCondition = (legacy.vakum === 'Da' || legacy.vakum?.toLowerCase().includes('vakuum')) ? 'vacuum' :
|
||||||
legacy.otvoreno?.toLowerCase().includes('otvorena') ? 'opened' : 'sealed';
|
(legacy.otvoreno === 'Da' || legacy.otvoreno?.toLowerCase().includes('otvorena')) ? 'opened' : 'sealed';
|
||||||
|
|
||||||
const totalQuantity = parseInt(legacy.kolicina) || 1;
|
const totalQuantity = parseInt(legacy.kolicina) || 1;
|
||||||
const availableQuantity = totalQuantity > 0 ? totalQuantity : 0;
|
const availableQuantity = totalQuantity > 0 ? totalQuantity : 0;
|
||||||
@@ -48,7 +48,7 @@ export const FilamentTableV2: React.FC<FilamentTableV2Props> = ({ filaments, loa
|
|||||||
brand: legacy.brand,
|
brand: legacy.brand,
|
||||||
type: legacy.tip as any || 'PLA',
|
type: legacy.tip as any || 'PLA',
|
||||||
material,
|
material,
|
||||||
color: { name: legacy.boja },
|
color: { name: legacy.boja, hex: legacy.bojaHex || legacy.boja_hex || '#000000' },
|
||||||
weight: { value: 1000, unit: 'g' as const },
|
weight: { value: 1000, unit: 'g' as const },
|
||||||
diameter: 1.75,
|
diameter: 1.75,
|
||||||
inventory: {
|
inventory: {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export const MaterialBadge: React.FC<MaterialBadgeProps> = ({ base, modifier, cl
|
|||||||
</span>
|
</span>
|
||||||
{modifier && (
|
{modifier && (
|
||||||
<span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200">
|
<span className="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200">
|
||||||
{getModifierIcon() && <span className="font-bold">{getModifierIcon()}</span>} {modifier}
|
{modifier}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export interface Filament {
|
|||||||
finish: string;
|
finish: string;
|
||||||
boja: string;
|
boja: string;
|
||||||
bojaHex?: string;
|
bojaHex?: string;
|
||||||
|
boja_hex?: string; // Alternative field name from import
|
||||||
refill: string;
|
refill: string;
|
||||||
vakum: string;
|
vakum: string;
|
||||||
otvoreno: string;
|
otvoreno: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user