From d061f21d79ea5edb5b8dfeb97a6e920c3dddc825 Mon Sep 17 00:00:00 2001 From: printcalc-ci Date: Thu, 5 Mar 2026 14:07:58 +0000 Subject: [PATCH] style: apply prettier formatting --- frontend/src/app/core/services/seo.service.ts | 28 ++++++++++++------- .../calculator/calculator-page.component.ts | 14 +++++++--- .../upload-form/upload-form.component.ts | 3 +- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/frontend/src/app/core/services/seo.service.ts b/frontend/src/app/core/services/seo.service.ts index 70505ad..ef26bde 100644 --- a/frontend/src/app/core/services/seo.service.ts +++ b/frontend/src/app/core/services/seo.service.ts @@ -1,11 +1,7 @@ import { DOCUMENT } from '@angular/common'; import { Inject, Injectable } from '@angular/core'; import { Title, Meta } from '@angular/platform-browser'; -import { - ActivatedRouteSnapshot, - NavigationEnd, - Router, -} from '@angular/router'; +import { ActivatedRouteSnapshot, NavigationEnd, Router } from '@angular/router'; import { filter } from 'rxjs/operators'; @Injectable({ @@ -25,7 +21,11 @@ export class SeoService { ) { this.applyRouteSeo(this.router.routerState.snapshot.root); this.router.events - .pipe(filter((event): event is NavigationEnd => event instanceof NavigationEnd)) + .pipe( + filter( + (event): event is NavigationEnd => event instanceof NavigationEnd, + ), + ) .subscribe(() => { this.applyRouteSeo(this.router.routerState.snapshot.root); }); @@ -56,7 +56,9 @@ export class SeoService { this.updateLangAndAlternates(cleanPath); } - private getMergedRouteData(snapshot: ActivatedRouteSnapshot): Record { + private getMergedRouteData( + snapshot: ActivatedRouteSnapshot, + ): Record { const merged: Record = {}; let cursor: ActivatedRouteSnapshot | null = snapshot; while (cursor) { @@ -90,10 +92,13 @@ export class SeoService { private updateLangAndAlternates(path: string): void { const segments = path.split('/').filter(Boolean); const firstSegment = segments[0]?.toLowerCase(); - const hasLang = Boolean(firstSegment && this.supportedLangs.has(firstSegment)); + const hasLang = Boolean( + firstSegment && this.supportedLangs.has(firstSegment), + ); const lang = hasLang ? firstSegment : 'it'; const suffixSegments = hasLang ? segments.slice(1) : segments; - const suffix = suffixSegments.length > 0 ? `/${suffixSegments.join('/')}` : ''; + const suffix = + suffixSegments.length > 0 ? `/${suffixSegments.join('/')}` : ''; this.document.documentElement.lang = lang; @@ -102,7 +107,10 @@ export class SeoService { .forEach((node) => node.remove()); for (const alt of ['it', 'en', 'de', 'fr']) { - this.appendAlternateLink(alt, `${this.document.location.origin}/${alt}${suffix}`); + this.appendAlternateLink( + alt, + `${this.document.location.origin}/${alt}${suffix}`, + ); } this.appendAlternateLink( 'x-default', diff --git a/frontend/src/app/features/calculator/calculator-page.component.ts b/frontend/src/app/features/calculator/calculator-page.component.ts index 3941639..10b2aea 100644 --- a/frontend/src/app/features/calculator/calculator-page.component.ts +++ b/frontend/src/app/features/calculator/calculator-page.component.ts @@ -571,16 +571,22 @@ export class CalculatorPageComponent implements OnInit { a.mode === b.mode && a.material === this.normalizeString(b.material) && a.quality === this.normalizeString(b.quality) && - Math.abs(a.nozzleDiameter - this.normalizeNumber(b.nozzleDiameter, 0.4, 2)) < 0.0001 && - Math.abs(a.layerHeight - this.normalizeNumber(b.layerHeight, 0.2, 3)) < 0.0001 && - Math.abs(a.infillDensity - this.normalizeNumber(b.infillDensity, 20, 2)) < 0.0001 && + Math.abs( + a.nozzleDiameter - this.normalizeNumber(b.nozzleDiameter, 0.4, 2), + ) < 0.0001 && + Math.abs(a.layerHeight - this.normalizeNumber(b.layerHeight, 0.2, 3)) < + 0.0001 && + Math.abs(a.infillDensity - this.normalizeNumber(b.infillDensity, 20, 2)) < + 0.0001 && a.infillPattern === this.normalizeString(b.infillPattern) && a.supportEnabled === Boolean(b.supportEnabled) ); } private normalizeString(value: string): string { - return String(value || '').trim().toLowerCase(); + return String(value || '') + .trim() + .toLowerCase(); } private normalizeNumber( diff --git a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts index a75300f..6b9d46c 100644 --- a/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts +++ b/frontend/src/app/features/calculator/components/upload-form/upload-form.component.ts @@ -286,7 +286,8 @@ export class UploadFormComponent implements OnInit { ); const anyPla = this.materials().find( (m) => - typeof m.value === 'string' && m.value.toUpperCase().startsWith('PLA'), + typeof m.value === 'string' && + m.value.toUpperCase().startsWith('PLA'), ); const preferredMaterial = exactPla ?? anyPla ?? this.materials()[0]; this.form.get('material')?.setValue(preferredMaterial.value);