fix(web): hide job lock status from printed reports
Build CutList image / build-and-push (push) Successful in 21s
Build CutList image / build-and-push (push) Successful in 21s
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
@if (!IsNew && job.IsLocked)
|
@if (!IsNew && job.IsLocked)
|
||||||
{
|
{
|
||||||
<div class="alert alert-warning d-flex justify-content-between align-items-center mb-3">
|
<div class="alert alert-warning d-flex justify-content-between align-items-center mb-3 print-screen-only">
|
||||||
<div>
|
<div>
|
||||||
<i class="bi bi-lock-fill me-2"></i>
|
<i class="bi bi-lock-fill me-2"></i>
|
||||||
<strong>This job is locked</strong> — locked on @job.LockedAt!.Value.ToLocalTime().ToString("g"). Unlock to make changes.
|
<strong>This job is locked</strong> — locked on @job.LockedAt!.Value.ToLocalTime().ToString("g"). Unlock to make changes.
|
||||||
@@ -1058,7 +1058,7 @@ else
|
|||||||
<h5 class="mb-0"><i class="bi bi-box-seam me-2"></i>Material List</h5>
|
<h5 class="mb-0"><i class="bi bi-box-seam me-2"></i>Material List</h5>
|
||||||
@if (job.IsLocked)
|
@if (job.IsLocked)
|
||||||
{
|
{
|
||||||
<span class="badge bg-success"><i class="bi bi-lock-fill me-1"></i>Job Locked</span>
|
<span class="badge bg-success print-screen-only"><i class="bi bi-lock-fill me-1"></i>Job Locked</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|||||||
@@ -149,6 +149,7 @@
|
|||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.print-screen-only,
|
||||||
.sidebar,
|
.sidebar,
|
||||||
.top-row,
|
.top-row,
|
||||||
.page > main > .top-row,
|
.page > main > .top-row,
|
||||||
|
|||||||
@@ -20,6 +20,15 @@ class JobResultsActionsTests(unittest.TestCase):
|
|||||||
self.assertIn('@onclick="LockJob"', action_row)
|
self.assertIn('@onclick="LockJob"', action_row)
|
||||||
self.assertIn("Lock Job", action_row)
|
self.assertIn("Lock Job", action_row)
|
||||||
|
|
||||||
|
def test_print_report_hides_job_lock_status(self) -> None:
|
||||||
|
markup = JOB_EDITOR.read_text()
|
||||||
|
report_css = (REPO_ROOT / "CutList.Web/wwwroot/css/report.css").read_text()
|
||||||
|
|
||||||
|
self.assertIn('class="alert alert-warning d-flex justify-content-between align-items-center mb-3 print-screen-only"', markup)
|
||||||
|
self.assertIn('<span class="badge bg-success print-screen-only">', markup)
|
||||||
|
self.assertIn(".print-screen-only", report_css)
|
||||||
|
self.assertIn("display: none !important;", report_css)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user