Align catalog with Bambu Lab product line, add conditional filters and admin sidebar
All checks were successful
Deploy / deploy (push) Successful in 2m24s

- Add master catalog (bambuLabCatalog.ts) as single source of truth for materials, finishes, colors, and refill/spool availability
- Fix incorrect finish-per-material mappings (remove PLA: 85A/90A/95A HF/FR/GF/HF, add ASA: Basic/CF/Aero, fix PETG/PC)
- Implement cascading filters on public site: material restricts finish, finish restricts color
- Add AdminSidebar component across all admin pages
- Redirect /upadaj to /dashboard when already authenticated
- Update color hex mappings and tests to match official Bambu Lab names
This commit is contained in:
DaX
2026-03-05 01:04:06 +01:00
parent ff6abdeef0
commit 65ae493d54
15 changed files with 817 additions and 467 deletions

View File

@@ -15,15 +15,15 @@ describe('Bambu Lab Colors Complete Data', () => {
});
it('should have matte colors', () => {
expect(bambuLabColors).toHaveProperty('Matte Black');
expect(bambuLabColors).toHaveProperty('Matte White');
expect(bambuLabColors).toHaveProperty('Matte Red');
expect(bambuLabColors).toHaveProperty('Matte Ivory White');
expect(bambuLabColors).toHaveProperty('Matte Charcoal');
expect(bambuLabColors).toHaveProperty('Matte Scarlet Red');
});
it('should have silk colors', () => {
expect(bambuLabColors).toHaveProperty('Silk White');
expect(bambuLabColors).toHaveProperty('Silk Black');
expect(bambuLabColors).toHaveProperty('Silk Gold');
expect(bambuLabColors).toHaveProperty('Silk Aurora Purple');
expect(bambuLabColors).toHaveProperty('Silk Phantom Blue');
expect(bambuLabColors).toHaveProperty('Silk Mystic Magenta');
});
it('should have valid hex colors', () => {
@@ -40,12 +40,12 @@ describe('Bambu Lab Colors Complete Data', () => {
it('should have finish categories', () => {
expect(colorsByFinish).toHaveProperty('Basic');
expect(colorsByFinish).toHaveProperty('Matte');
expect(colorsByFinish).toHaveProperty('Silk');
expect(colorsByFinish).toHaveProperty('Silk+');
expect(colorsByFinish).toHaveProperty('Metal');
expect(colorsByFinish).toHaveProperty('Sparkle');
expect(colorsByFinish).toHaveProperty('Glow');
expect(colorsByFinish).toHaveProperty('Transparent');
expect(colorsByFinish).toHaveProperty('Support');
expect(colorsByFinish).toHaveProperty('Translucent');
expect(colorsByFinish).toHaveProperty('CF');
});
it('should return valid hex for getColorHex', () => {

View File

@@ -46,21 +46,18 @@ describe('UI Features Tests', () => {
it('should have predefined material options', () => {
const adminDashboardPath = join(process.cwd(), 'app', 'dashboard', 'page.tsx');
const adminContent = readFileSync(adminDashboardPath, 'utf-8');
// Check for material select dropdown
expect(adminContent).toContain('<option value="PLA">PLA</option>');
expect(adminContent).toContain('<option value="PETG">PETG</option>');
expect(adminContent).toContain('<option value="ABS">ABS</option>');
// Check for material select dropdown (now generated from catalog)
expect(adminContent).toContain('getMaterialOptions()');
expect(adminContent).toContain('Izaberi tip');
});
it('should have admin header with navigation', () => {
it('should have admin sidebar and header', () => {
const adminDashboardPath = join(process.cwd(), 'app', 'dashboard', 'page.tsx');
const dashboardContent = readFileSync(adminDashboardPath, 'utf-8');
// Check for admin header
expect(dashboardContent).toContain('Admin');
expect(dashboardContent).toContain('Nazad na sajt');
// Check for admin sidebar and header
expect(dashboardContent).toContain('AdminSidebar');
expect(dashboardContent).toContain('Odjava');
});