|
- Caricamento dettaglio...
-
+
+ Caricamento dettaglio...
+
+
- Elementi: {{ detail.items.length }}
- Totale articoli: {{ detail.itemsTotalChf | currency:'CHF' }}
- Spedizione: {{ detail.shippingCostChf | currency:'CHF' }}
- Totale sessione: {{ detail.grandTotalChf | currency:'CHF' }}
+
+ Elementi: {{ detail.items.length }}
+
+
+ Totale articoli:
+ {{ detail.itemsTotalChf | currency: "CHF" }}
+
+
+ Spedizione:
+ {{ detail.shippingCostChf | currency: "CHF" }}
+
+
+ Totale sessione:
+ {{ detail.grandTotalChf | currency: "CHF" }}
+
- 0; else noItemsTpl">
+ 0; else noItemsTpl"
+ >
| File |
@@ -76,9 +115,15 @@
{{ item.originalFilename }} |
{{ item.quantity }} |
{{ formatPrintTime(item.printTimeSeconds) }} |
- {{ item.materialGrams ? (item.materialGrams | number:'1.0-2') + ' g' : '-' }} |
+
+ {{
+ item.materialGrams
+ ? (item.materialGrams | number: "1.0-2") + " g"
+ : "-"
+ }}
+ |
{{ item.status }} |
- {{ item.unitPriceChf | currency:'CHF' }} |
+ {{ item.unitPriceChf | currency: "CHF" }} |
diff --git a/frontend/src/app/features/admin/pages/admin-sessions.component.ts b/frontend/src/app/features/admin/pages/admin-sessions.component.ts
index 236f741..d99b9fa 100644
--- a/frontend/src/app/features/admin/pages/admin-sessions.component.ts
+++ b/frontend/src/app/features/admin/pages/admin-sessions.component.ts
@@ -3,7 +3,7 @@ import { Component, inject, OnInit } from '@angular/core';
import {
AdminOperationsService,
AdminQuoteSession,
- AdminQuoteSessionDetail
+ AdminQuoteSessionDetail,
} from '../services/admin-operations.service';
@Component({
@@ -11,7 +11,7 @@ import {
standalone: true,
imports: [CommonModule],
templateUrl: './admin-sessions.component.html',
- styleUrl: './admin-sessions.component.scss'
+ styleUrl: './admin-sessions.component.scss',
})
export class AdminSessionsComponent implements OnInit {
private readonly adminOperationsService = inject(AdminOperationsService);
@@ -41,7 +41,7 @@ export class AdminSessionsComponent implements OnInit {
error: () => {
this.loading = false;
this.errorMessage = 'Impossibile caricare le sessioni.';
- }
+ },
});
}
@@ -51,7 +51,7 @@ export class AdminSessionsComponent implements OnInit {
}
const confirmed = window.confirm(
- `Vuoi eliminare la sessione ${session.id}? Questa azione non si puo annullare.`
+ `Vuoi eliminare la sessione ${session.id}? Questa azione non si puo annullare.`,
);
if (!confirmed) {
return;
@@ -69,8 +69,11 @@ export class AdminSessionsComponent implements OnInit {
},
error: (err) => {
this.deletingSessionIds.delete(session.id);
- this.errorMessage = this.extractErrorMessage(err, 'Impossibile eliminare la sessione.');
- }
+ this.errorMessage = this.extractErrorMessage(
+ err,
+ 'Impossibile eliminare la sessione.',
+ );
+ },
});
}
@@ -85,7 +88,10 @@ export class AdminSessionsComponent implements OnInit {
}
this.expandedSessionId = session.id;
- if (this.sessionDetailsById[session.id] || this.loadingDetailSessionIds.has(session.id)) {
+ if (
+ this.sessionDetailsById[session.id] ||
+ this.loadingDetailSessionIds.has(session.id)
+ ) {
return;
}
@@ -94,14 +100,17 @@ export class AdminSessionsComponent implements OnInit {
next: (detail) => {
this.sessionDetailsById = {
...this.sessionDetailsById,
- [session.id]: detail
+ [session.id]: detail,
};
this.loadingDetailSessionIds.delete(session.id);
},
error: (err) => {
this.loadingDetailSessionIds.delete(session.id);
- this.errorMessage = this.extractErrorMessage(err, 'Impossibile caricare il dettaglio sessione.');
- }
+ this.errorMessage = this.extractErrorMessage(
+ err,
+ 'Impossibile caricare il dettaglio sessione.',
+ );
+ },
});
}
diff --git a/frontend/src/app/features/admin/pages/admin-shell.component.html b/frontend/src/app/features/admin/pages/admin-shell.component.html
index 8e39e15..d6c71b7 100644
--- a/frontend/src/app/features/admin/pages/admin-shell.component.html
+++ b/frontend/src/app/features/admin/pages/admin-shell.component.html
@@ -9,8 +9,12 @@
diff --git a/frontend/src/app/features/admin/pages/admin-shell.component.scss b/frontend/src/app/features/admin/pages/admin-shell.component.scss
index 5cf0645..8b5fda9 100644
--- a/frontend/src/app/features/admin/pages/admin-shell.component.scss
+++ b/frontend/src/app/features/admin/pages/admin-shell.component.scss
@@ -54,7 +54,10 @@
font-weight: 600;
border: 1px solid var(--color-border);
background: var(--color-bg-card);
- transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
+ transition:
+ border-color 0.2s ease,
+ background-color 0.2s ease,
+ color 0.2s ease;
white-space: nowrap;
}
@@ -78,7 +81,9 @@
padding: var(--space-3) var(--space-4);
font-weight: 600;
cursor: pointer;
- transition: border-color 0.2s ease, background-color 0.2s ease;
+ transition:
+ border-color 0.2s ease,
+ background-color 0.2s ease;
}
.logout:hover {
diff --git a/frontend/src/app/features/admin/pages/admin-shell.component.ts b/frontend/src/app/features/admin/pages/admin-shell.component.ts
index 7617b0c..405154e 100644
--- a/frontend/src/app/features/admin/pages/admin-shell.component.ts
+++ b/frontend/src/app/features/admin/pages/admin-shell.component.ts
@@ -1,6 +1,12 @@
import { CommonModule } from '@angular/common';
import { Component, inject } from '@angular/core';
-import { ActivatedRoute, Router, RouterLink, RouterLinkActive, RouterOutlet } from '@angular/router';
+import {
+ ActivatedRoute,
+ Router,
+ RouterLink,
+ RouterLinkActive,
+ RouterOutlet,
+} from '@angular/router';
import { AdminAuthService } from '../services/admin-auth.service';
const SUPPORTED_LANGS = new Set(['it', 'en', 'de', 'fr']);
@@ -10,7 +16,7 @@ const SUPPORTED_LANGS = new Set(['it', 'en', 'de', 'fr']);
standalone: true,
imports: [CommonModule, RouterOutlet, RouterLink, RouterLinkActive],
templateUrl: './admin-shell.component.html',
- styleUrl: './admin-shell.component.scss'
+ styleUrl: './admin-shell.component.scss',
})
export class AdminShellComponent {
private readonly adminAuthService = inject(AdminAuthService);
@@ -24,7 +30,7 @@ export class AdminShellComponent {
},
error: () => {
void this.router.navigate(['/', this.resolveLang(), 'admin', 'login']);
- }
+ },
});
}
diff --git a/frontend/src/app/features/admin/services/admin-auth.service.ts b/frontend/src/app/features/admin/services/admin-auth.service.ts
index 0eb7491..99d00bb 100644
--- a/frontend/src/app/features/admin/services/admin-auth.service.ts
+++ b/frontend/src/app/features/admin/services/admin-auth.service.ts
@@ -11,23 +11,31 @@ export interface AdminAuthResponse {
}
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class AdminAuthService {
private readonly http = inject(HttpClient);
private readonly baseUrl = `${environment.apiUrl}/api/admin/auth`;
login(password: string): Observable {
- return this.http.post(`${this.baseUrl}/login`, { password }, { withCredentials: true });
+ return this.http.post(
+ `${this.baseUrl}/login`,
+ { password },
+ { withCredentials: true },
+ );
}
logout(): Observable {
- return this.http.post(`${this.baseUrl}/logout`, {}, { withCredentials: true });
+ return this.http.post(
+ `${this.baseUrl}/logout`,
+ {},
+ { withCredentials: true },
+ );
}
me(): Observable {
- return this.http.get(`${this.baseUrl}/me`, { withCredentials: true }).pipe(
- map((response) => Boolean(response?.authenticated))
- );
+ return this.http
+ .get(`${this.baseUrl}/me`, { withCredentials: true })
+ .pipe(map((response) => Boolean(response?.authenticated)));
}
}
diff --git a/frontend/src/app/features/admin/services/admin-operations.service.ts b/frontend/src/app/features/admin/services/admin-operations.service.ts
index de517c9..f6cc51b 100644
--- a/frontend/src/app/features/admin/services/admin-operations.service.ts
+++ b/frontend/src/app/features/admin/services/admin-operations.service.ts
@@ -145,82 +145,138 @@ export interface AdminQuoteSessionDetail {
}
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class AdminOperationsService {
private readonly http = inject(HttpClient);
private readonly baseUrl = `${environment.apiUrl}/api/admin`;
getFilamentStock(): Observable {
- return this.http.get(`${this.baseUrl}/filament-stock`, { withCredentials: true });
+ return this.http.get(
+ `${this.baseUrl}/filament-stock`,
+ { withCredentials: true },
+ );
}
getFilamentMaterials(): Observable {
- return this.http.get(`${this.baseUrl}/filaments/materials`, { withCredentials: true });
+ return this.http.get(
+ `${this.baseUrl}/filaments/materials`,
+ { withCredentials: true },
+ );
}
getFilamentVariants(): Observable {
- return this.http.get(`${this.baseUrl}/filaments/variants`, { withCredentials: true });
+ return this.http.get(
+ `${this.baseUrl}/filaments/variants`,
+ { withCredentials: true },
+ );
}
- createFilamentMaterial(payload: AdminUpsertFilamentMaterialTypePayload): Observable {
- return this.http.post(`${this.baseUrl}/filaments/materials`, payload, { withCredentials: true });
+ createFilamentMaterial(
+ payload: AdminUpsertFilamentMaterialTypePayload,
+ ): Observable {
+ return this.http.post(
+ `${this.baseUrl}/filaments/materials`,
+ payload,
+ { withCredentials: true },
+ );
}
- updateFilamentMaterial(materialId: number, payload: AdminUpsertFilamentMaterialTypePayload): Observable {
- return this.http.put(`${this.baseUrl}/filaments/materials/${materialId}`, payload, { withCredentials: true });
+ updateFilamentMaterial(
+ materialId: number,
+ payload: AdminUpsertFilamentMaterialTypePayload,
+ ): Observable {
+ return this.http.put(
+ `${this.baseUrl}/filaments/materials/${materialId}`,
+ payload,
+ { withCredentials: true },
+ );
}
- createFilamentVariant(payload: AdminUpsertFilamentVariantPayload): Observable {
- return this.http.post(`${this.baseUrl}/filaments/variants`, payload, { withCredentials: true });
+ createFilamentVariant(
+ payload: AdminUpsertFilamentVariantPayload,
+ ): Observable {
+ return this.http.post(
+ `${this.baseUrl}/filaments/variants`,
+ payload,
+ { withCredentials: true },
+ );
}
- updateFilamentVariant(variantId: number, payload: AdminUpsertFilamentVariantPayload): Observable {
- return this.http.put(`${this.baseUrl}/filaments/variants/${variantId}`, payload, { withCredentials: true });
+ updateFilamentVariant(
+ variantId: number,
+ payload: AdminUpsertFilamentVariantPayload,
+ ): Observable {
+ return this.http.put(
+ `${this.baseUrl}/filaments/variants/${variantId}`,
+ payload,
+ { withCredentials: true },
+ );
}
deleteFilamentVariant(variantId: number): Observable {
- return this.http.delete(`${this.baseUrl}/filaments/variants/${variantId}`, { withCredentials: true });
+ return this.http.delete(
+ `${this.baseUrl}/filaments/variants/${variantId}`,
+ { withCredentials: true },
+ );
}
getContactRequests(): Observable {
- return this.http.get(`${this.baseUrl}/contact-requests`, { withCredentials: true });
+ return this.http.get(
+ `${this.baseUrl}/contact-requests`,
+ { withCredentials: true },
+ );
}
- getContactRequestDetail(requestId: string): Observable {
- return this.http.get(`${this.baseUrl}/contact-requests/${requestId}`, { withCredentials: true });
+ getContactRequestDetail(
+ requestId: string,
+ ): Observable {
+ return this.http.get(
+ `${this.baseUrl}/contact-requests/${requestId}`,
+ { withCredentials: true },
+ );
}
updateContactRequestStatus(
requestId: string,
- payload: AdminUpdateContactRequestStatusPayload
+ payload: AdminUpdateContactRequestStatusPayload,
): Observable {
return this.http.patch(
`${this.baseUrl}/contact-requests/${requestId}/status`,
payload,
- { withCredentials: true }
+ { withCredentials: true },
);
}
- downloadContactRequestAttachment(requestId: string, attachmentId: string): Observable {
- return this.http.get(`${this.baseUrl}/contact-requests/${requestId}/attachments/${attachmentId}/file`, {
- withCredentials: true,
- responseType: 'blob'
- });
+ downloadContactRequestAttachment(
+ requestId: string,
+ attachmentId: string,
+ ): Observable {
+ return this.http.get(
+ `${this.baseUrl}/contact-requests/${requestId}/attachments/${attachmentId}/file`,
+ {
+ withCredentials: true,
+ responseType: 'blob',
+ },
+ );
}
getSessions(): Observable {
- return this.http.get(`${this.baseUrl}/sessions`, { withCredentials: true });
+ return this.http.get(`${this.baseUrl}/sessions`, {
+ withCredentials: true,
+ });
}
deleteSession(sessionId: string): Observable {
- return this.http.delete(`${this.baseUrl}/sessions/${sessionId}`, { withCredentials: true });
+ return this.http.delete(`${this.baseUrl}/sessions/${sessionId}`, {
+ withCredentials: true,
+ });
}
getSessionDetail(sessionId: string): Observable {
return this.http.get(
`${environment.apiUrl}/api/quote-sessions/${sessionId}`,
- { withCredentials: true }
+ { withCredentials: true },
);
}
}
diff --git a/frontend/src/app/features/admin/services/admin-orders.service.ts b/frontend/src/app/features/admin/services/admin-orders.service.ts
index 392f10f..c9b7822 100644
--- a/frontend/src/app/features/admin/services/admin-orders.service.ts
+++ b/frontend/src/app/features/admin/services/admin-orders.service.ts
@@ -38,7 +38,7 @@ export interface AdminUpdateOrderStatusPayload {
}
@Injectable({
- providedIn: 'root'
+ providedIn: 'root',
})
export class AdminOrdersService {
private readonly http = inject(HttpClient);
@@ -49,35 +49,54 @@ export class AdminOrdersService {
}
getOrder(orderId: string): Observable {
- return this.http.get(`${this.baseUrl}/${orderId}`, { withCredentials: true });
+ return this.http.get(`${this.baseUrl}/${orderId}`, {
+ withCredentials: true,
+ });
}
confirmPayment(orderId: string, method: string): Observable {
- return this.http.post(`${this.baseUrl}/${orderId}/payments/confirm`, { method }, { withCredentials: true });
+ return this.http.post(
+ `${this.baseUrl}/${orderId}/payments/confirm`,
+ { method },
+ { withCredentials: true },
+ );
}
- updateOrderStatus(orderId: string, payload: AdminUpdateOrderStatusPayload): Observable {
- return this.http.post(`${this.baseUrl}/${orderId}/status`, payload, { withCredentials: true });
+ updateOrderStatus(
+ orderId: string,
+ payload: AdminUpdateOrderStatusPayload,
+ ): Observable {
+ return this.http.post(
+ `${this.baseUrl}/${orderId}/status`,
+ payload,
+ { withCredentials: true },
+ );
}
- downloadOrderItemFile(orderId: string, orderItemId: string): Observable {
- return this.http.get(`${this.baseUrl}/${orderId}/items/${orderItemId}/file`, {
- withCredentials: true,
- responseType: 'blob'
- });
+ downloadOrderItemFile(
+ orderId: string,
+ orderItemId: string,
+ ): Observable {
+ return this.http.get(
+ `${this.baseUrl}/${orderId}/items/${orderItemId}/file`,
+ {
+ withCredentials: true,
+ responseType: 'blob',
+ },
+ );
}
downloadOrderConfirmation(orderId: string): Observable {
return this.http.get(`${this.baseUrl}/${orderId}/documents/confirmation`, {
withCredentials: true,
- responseType: 'blob'
+ responseType: 'blob',
});
}
downloadOrderInvoice(orderId: string): Observable {
return this.http.get(`${this.baseUrl}/${orderId}/documents/invoice`, {
withCredentials: true,
- responseType: 'blob'
+ responseType: 'blob',
});
}
}
diff --git a/frontend/src/app/features/calculator/calculator-page.component.html b/frontend/src/app/features/calculator/calculator-page.component.html
index 07b1912..ab7ae3a 100644
--- a/frontend/src/app/features/calculator/calculator-page.component.html
+++ b/frontend/src/app/features/calculator/calculator-page.component.html
@@ -1,72 +1,80 @@
- {{ 'CALC.TITLE' | translate }}
- {{ 'CALC.SUBTITLE' | translate }}
+ {{ "CALC.TITLE" | translate }}
+ {{ "CALC.SUBTITLE" | translate }}
@if (error()) {
{{ errorKey() | translate }}
}
-@if (step() === 'success') {
-
+@if (step() === "success") {
+
} @else {
- |