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({