feat(admin): print/save-as-PDF for transactions and clean print output
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> P0 user feedback asked for PDF export on orders and transactions. Orders already had Print invoice (window.print). Rather than invent a backend PDF endpoint, the browser's print-to-PDF is the export path: - Transactions list gains a Print button next to CSV export - Admin shell now hides sidebar/topbar/inspector under @media print, so printing any admin page (order invoice, transactions, analytics) produces a clean document instead of capturing navigation chrome
This commit is contained in:
@@ -498,3 +498,17 @@
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
}
|
||||
|
||||
/* Print: only the page content matters - hide navigation chrome so
|
||||
browser print / save-as-PDF produces a clean document (orders,
|
||||
transactions, analytics). */
|
||||
@media print {
|
||||
.admin-layout__sidebar,
|
||||
.admin-layout__topbar,
|
||||
.admin-layout__inspector {
|
||||
display: none !important;
|
||||
}
|
||||
.admin-layout {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
</select>
|
||||
</div>
|
||||
<app-button variant="secondary" (click)="exportCsv()">{{ 'adminOrders.export' | translate }}</app-button>
|
||||
<app-button variant="secondary" (click)="print()">{{ 'adminAnalytics.print' | translate }}</app-button>
|
||||
</div>
|
||||
|
||||
@if (facade.loading()) {
|
||||
|
||||
@@ -44,6 +44,10 @@ export class AdminTransactionsListPageComponent {
|
||||
this.auditTarget.set(null);
|
||||
}
|
||||
|
||||
print(): void {
|
||||
window.print();
|
||||
}
|
||||
|
||||
exportCsv(): void {
|
||||
const csv = this.facade.exportCsv();
|
||||
const blob = new Blob([csv], { type: 'text/csv' });
|
||||
|
||||
Reference in New Issue
Block a user