feat(web): update quality print advanced and base
All checks were successful
Build, Test and Deploy / test-backend (push) Successful in 22s
Build, Test and Deploy / build-and-push (push) Successful in 21s
Build, Test and Deploy / deploy (push) Successful in 5s

This commit is contained in:
2026-02-06 13:58:23 +01:00
parent f3d271ded2
commit debf153f58
5 changed files with 48 additions and 16 deletions

View File

@@ -83,11 +83,19 @@
[options]="materials"
></app-select>
<app-select
formControlName="quality"
[label]="'CALC.QUALITY' | translate"
[options]="qualities"
></app-select>
@if (mode() === 'easy') {
<app-select
formControlName="quality"
[label]="'CALC.QUALITY' | translate"
[options]="qualities"
></app-select>
} @else {
<app-select
formControlName="printSpeed"
[label]="'CALC.PRINT_SPEED' | translate"
[options]="printSpeeds"
></app-select>
}
</div>
<!-- Global quantity removed, now per item -->
@@ -99,6 +107,12 @@
[label]="'CALC.PATTERN' | translate"
[options]="infillPatterns"
></app-select>
<app-select
formControlName="layerHeight"
[label]="'CALC.LAYER_HEIGHT' | translate"
[options]="layerHeights"
></app-select>
</div>
<div class="grid">

View File

@@ -47,6 +47,12 @@ export class UploadFormComponent {
{ label: 'Alta definizione', value: 'High' }
];
printSpeeds = [
{ label: 'Slow (High Quality)', value: 'Slow' },
{ label: 'Standard', value: 'Standard' },
{ label: 'Fast (Draft)', value: 'Fast' }
];
infillPatterns = [
{ label: 'Grid', value: 'grid' },
{ label: 'Gyroid', value: 'gyroid' },
@@ -54,6 +60,15 @@ export class UploadFormComponent {
{ label: 'Triangles', value: 'triangles' }
];
layerHeights = [
{ label: '0.08 mm', value: 0.08 },
{ label: '0.12 mm (High Quality - Slow)', value: 0.12 },
{ label: '0.16 mm', value: 0.16 },
{ label: '0.20 mm (Standard)', value: 0.20 },
{ label: '0.24 mm', value: 0.24 },
{ label: '0.28 mm (Draft - Fast)', value: 0.28 }
];
acceptedFormats = '.stl,.3mf,.step,.stp,.obj,.amf,.ply,.igs,.iges';
constructor(private fb: FormBuilder) {
@@ -61,10 +76,12 @@ export class UploadFormComponent {
itemsTouched: [false], // Hack to track touched state for custom items list
material: ['PLA', Validators.required],
quality: ['Standard', Validators.required],
printSpeed: ['Standard', Validators.required],
notes: [''],
// Advanced fields
// Color removed from global form
infillDensity: [20, [Validators.min(0), Validators.max(100)]],
layerHeight: [0.2, [Validators.min(0.05), Validators.max(1.0)]],
infillPattern: ['grid'],
supportEnabled: [false]
});

View File

@@ -2,14 +2,14 @@
@if (label()) { <label [for]="id()">{{ label() }}</label> }
<select
[id]="id()"
[value]="value"
(change)="onSelect($event)"
[ngModel]="value"
(ngModelChange)="onModelChange($event)"
(blur)="onTouched()"
[disabled]="disabled"
class="form-control"
>
@for (opt of options(); track opt.value) {
<option [value]="opt.value">{{ opt.label }}</option>
@for (opt of options(); track opt.label) {
<option [ngValue]="opt.value">{{ opt.label }}</option>
}
</select>
@if (error()) { <span class="error-text">{{ error() }}</span> }

View File

@@ -1,11 +1,11 @@
import { Component, input, output, forwardRef } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-select',
standalone: true,
imports: [CommonModule, ReactiveFormsModule],
imports: [CommonModule, ReactiveFormsModule, FormsModule],
providers: [
{
provide: NG_VALUE_ACCESSOR,
@@ -33,9 +33,8 @@ export class AppSelectComponent implements ControlValueAccessor {
registerOnTouched(fn: any): void { this.onTouched = fn; }
setDisabledState(isDisabled: boolean): void { this.disabled = isDisabled; }
onSelect(event: Event) {
const val = (event.target as HTMLSelectElement).value;
this.value = val;
this.onChange(val);
onModelChange(val: any) {
this.value = val;
this.onChange(val);
}
}

View File

@@ -17,17 +17,19 @@
"CTA_START": "Inizia Ora",
"BUSINESS": "Aziende",
"PRIVATE": "Privati",
"MODE_EASY": "Rapida",
"MODE_EASY": "Base",
"MODE_ADVANCED": "Avanzata",
"UPLOAD_LABEL": "Trascina il tuo file 3D qui",
"UPLOAD_SUB": "Supportiamo STL, 3MF, STEP, OBJ fino a 50MB",
"MATERIAL": "Materiale",
"QUALITY": "Qualità",
"PRINT_SPEED": "Velocità di Stampa",
"QUANTITY": "Quantità",
"NOTES": "Note aggiuntive",
"COLOR": "Colore",
"INFILL": "Riempimento (%)",
"PATTERN": "Pattern di riempimento",
"LAYER_HEIGHT": "Altezza Layer",
"SUPPORT": "Supporti",
"SUPPORT_DESC": "Abilita supporti per sporgenze",
"CALCULATE": "Calcola Preventivo",