fix(web): simplify printed cut reports
Build CutList image / build-and-push (push) Successful in 19s
Build CutList image / build-and-push (push) Successful in 19s
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
</div>
|
||||
|
||||
<main>
|
||||
<header class="workspace-header">
|
||||
<header class="workspace-header print-screen-only">
|
||||
<div class="workspace-context"><span class="workspace-eyebrow">Cut planning workspace</span></div>
|
||||
<div class="workspace-status"><span class="status-dot"></span>Ready to plan</div>
|
||||
</header>
|
||||
|
||||
@@ -144,11 +144,18 @@
|
||||
/* Print styles - Compact layout to save paper */
|
||||
@media print {
|
||||
body {
|
||||
-webkit-print-color-adjust: exact;
|
||||
print-color-adjust: exact;
|
||||
-webkit-print-color-adjust: economy;
|
||||
print-color-adjust: economy;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.print-screen-only,
|
||||
.sidebar,
|
||||
.top-row,
|
||||
|
||||
@@ -7,6 +7,7 @@ from pathlib import Path
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
JOB_EDITOR = REPO_ROOT / "CutList.Web/Components/Pages/Jobs/Edit.razor"
|
||||
MAIN_LAYOUT = REPO_ROOT / "CutList.Web/Components/Layout/MainLayout.razor"
|
||||
|
||||
|
||||
class JobResultsActionsTests(unittest.TestCase):
|
||||
@@ -29,6 +30,21 @@ class JobResultsActionsTests(unittest.TestCase):
|
||||
self.assertIn(".print-screen-only", report_css)
|
||||
self.assertIn("display: none !important;", report_css)
|
||||
|
||||
def test_print_report_hides_workspace_header_and_ready_status(self) -> None:
|
||||
markup = MAIN_LAYOUT.read_text()
|
||||
|
||||
self.assertIn('class="workspace-header print-screen-only"', markup)
|
||||
self.assertIn("Cut planning workspace", markup)
|
||||
self.assertIn("Ready to plan", markup)
|
||||
|
||||
def test_print_report_forces_backgrounds_to_plain_white(self) -> None:
|
||||
report_css = (REPO_ROOT / "CutList.Web/wwwroot/css/report.css").read_text()
|
||||
print_styles = report_css[report_css.index("@media print {"):]
|
||||
|
||||
self.assertIn("*::before", print_styles)
|
||||
self.assertIn("background: transparent !important;", print_styles)
|
||||
self.assertIn("box-shadow: none !important;", print_styles)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user