feat(front-end): upload only supported file and add step warning message
All checks were successful
Build, Test and Deploy / test-backend (push) Successful in 40s
Build, Test and Deploy / build-and-push (push) Successful in 24s
Build, Test and Deploy / deploy (push) Successful in 9s

This commit is contained in:
2026-02-24 13:06:16 +01:00
parent 6463fac211
commit a6eae757c5
7 changed files with 43 additions and 17 deletions

View File

@@ -3,10 +3,16 @@
<div class="section">
@if (selectedFile()) {
<div class="viewer-wrapper">
<app-stl-viewer
[file]="selectedFile()"
[color]="getSelectedFileColor()">
</app-stl-viewer>
@if (isStepFile(selectedFile())) {
<div class="step-warning">
<p>{{ 'CALC.STEP_WARNING' | translate }}</p>
</div>
} @else {
<app-stl-viewer
[file]="selectedFile()"
[color]="getSelectedFileColor()">
</app-stl-viewer>
}
<!-- Close button removed as requested -->
</div>
}

View File

@@ -202,6 +202,18 @@
.progress-fill {
height: 100%;
background: var(--color-brand);
width: 0%;
transition: width 0.2s ease-out;
}
.step-warning {
display: flex;
justify-content: center;
align-items: center;
height: 300px;
background: var(--color-neutral-100);
border: 1px dashed var(--color-border);
border-radius: var(--radius-md);
padding: var(--space-4);
text-align: center;
color: var(--color-text-muted);
font-weight: 500;
}

View File

@@ -61,7 +61,13 @@ export class UploadFormComponent implements OnInit {
}
}
acceptedFormats = '.stl,.3mf,.step,.stp,.obj,.amf,.ply,.igs,.iges';
acceptedFormats = '.stl,.3mf,.step,.stp';
isStepFile(file: File | null): boolean {
if (!file) return false;
const name = file.name.toLowerCase();
return name.endsWith('.step') || name.endsWith('.stp');
}
constructor() {
this.form = this.fb.group({

View File

@@ -51,7 +51,7 @@
<div class="drop-zone" (click)="fileInput.click()"
(dragover)="onDragOver($event)" (drop)="onDrop($event)">
<input #fileInput type="file" multiple (change)="onFileSelected($event)" hidden
accept=".jpg,.jpeg,.png,.pdf,.stl,.step,.stp,.3mf,.obj">
accept=".jpg,.jpeg,.png,.pdf,.stl,.step,.stp,.3mf">
<p>{{ 'CONTACT.DROP_FILES' | translate }}</p>
</div>

View File

@@ -10,8 +10,8 @@ import { CommonModule } from '@angular/common';
})
export class AppDropzoneComponent {
label = input<string>('Drop files here or click to upload');
subtext = input<string>('Supports .stl, .obj');
accept = input<string>('.stl,.obj');
subtext = input<string>('Supports .stl, .3mf, .step');
accept = input<string>('.stl,.3mf,.step,.stp');
multiple = input<boolean>(true);
filesDropped = output<File[]>();

View File

@@ -43,7 +43,7 @@
"MODE_EASY": "Quick",
"MODE_ADVANCED": "Advanced",
"UPLOAD_LABEL": "Drag your 3D file here",
"UPLOAD_SUB": "Supports STL, 3MF, STEP, OBJ up to 50MB",
"UPLOAD_SUB": "Supports STL, 3MF, STEP up to 50MB",
"MATERIAL": "Material",
"QUALITY": "Quality",
"QUANTITY": "Quantity",
@@ -68,7 +68,8 @@
"BENEFITS_1": "Automatic quote with instant cost and time",
"BENEFITS_2": "Selected materials and quality control",
"BENEFITS_3": "CAD consultation if file needs modifications",
"ERR_FILE_REQUIRED": "File is required."
"ERR_FILE_REQUIRED": "File is required.",
"STEP_WARNING": "3D preview is not available for STEP files, but the calculator works perfectly. You can proceed with the quotation."
},
"SHOP": {
"TITLE": "Technical solutions",
@@ -140,7 +141,7 @@
"COMPANY_NAME": "Company Name",
"REF_PERSON": "Reference Person",
"UPLOAD_LABEL": "Attachments",
"UPLOAD_HINT": "Max 15 files. Supported: Images, PDF, STL, STEP, 3MF, OBJ",
"UPLOAD_HINT": "Max 15 files. Supported: Images, PDF, STL, STEP, 3MF",
"DROP_FILES": "Drop files here or click to upload",
"PLACEHOLDER_NAME": "Your Name",
"PLACEHOLDER_EMAIL": "your@email.com",

View File

@@ -58,14 +58,14 @@
},
"CALC": {
"TITLE": "Calcola Preventivo 3D",
"SUBTITLE": "Carica il tuo file 3D (STL, 3MF, STEP...) e ricevi una stima immediata di costi e tempi di stampa.",
"SUBTITLE": "Carica il tuo file 3D (STL, 3MF, STEP), imposta la qualtà, colore e calcola immediatamente prezzo e tempi.",
"CTA_START": "Inizia Ora",
"BUSINESS": "Aziende",
"PRIVATE": "Privati",
"MODE_EASY": "Base",
"MODE_ADVANCED": "Avanzata",
"UPLOAD_LABEL": "Trascina il tuo file 3D qui",
"UPLOAD_SUB": "Supportiamo STL, 3MF, STEP, OBJ fino a 50MB",
"UPLOAD_SUB": "Supportiamo STL, 3MF, STEP fino a 50MB",
"MATERIAL": "Materiale",
"QUALITY": "Qualità",
"PRINT_SPEED": "Velocità di Stampa",
@@ -101,7 +101,8 @@
"UPLOADING": "Caricamento...",
"PROCESSING": "Elaborazione...",
"NOTES_PLACEHOLDER": "Istruzioni specifiche...",
"SETUP_NOTE": "* Include {{cost}} Costo di Setup"
"SETUP_NOTE": "* Include {{cost}} Costo di Setup",
"STEP_WARNING": "La visualizzazione 3D non è compatibile con i file STEP, ma il calcolatore funziona."
},
"QUOTE": {
"PROCEED_ORDER": "Procedi con l'ordine",
@@ -203,7 +204,7 @@
"COMPANY_NAME": "Ragione Sociale",
"REF_PERSON": "Persona di Riferimento",
"UPLOAD_LABEL": "Allegati",
"UPLOAD_HINT": "Max 15 file. Supportati: Immagini, PDF, STL, STEP, 3MF, OBJ",
"UPLOAD_HINT": "Max 15 file. Supportati: Immagini, PDF, STL, STEP, 3MF",
"DROP_FILES": "Trascina qui i file o clicca per caricare",
"PLACEHOLDER_NAME": "Il tuo nome",
"PLACEHOLDER_EMAIL": "tuo@email.com",