fix(web): keep printed cut-list rows together
Build CutList image / build-and-push (push) Successful in 22s
Build CutList image / build-and-push (push) Successful in 22s
This commit is contained in:
@@ -24,4 +24,16 @@ public class ResultsLengthDisplayTests
|
||||
Assert.Contains("cut-part-badge-divider", markup);
|
||||
Assert.Contains("Show feet + inches", markup);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Printed_cut_list_rows_are_kept_together()
|
||||
{
|
||||
var sourcePath = Path.GetFullPath(
|
||||
Path.Combine(AppContext.BaseDirectory, "../../../../CutList.Web/wwwroot/css/report.css"));
|
||||
var css = File.ReadAllText(sourcePath);
|
||||
|
||||
Assert.Contains(".cutlist-material-card tbody tr", css);
|
||||
Assert.Contains("break-inside: avoid", css);
|
||||
Assert.Contains("page-break-inside: avoid", css);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,6 +373,12 @@
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
/* Keep each stock-bar result, its cuts, and its waste on one printed page. */
|
||||
.cutlist-material-card tbody tr {
|
||||
break-inside: avoid;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
/* Reduce spacing */
|
||||
.mb-4 {
|
||||
margin-bottom: 0.5rem !important;
|
||||
|
||||
@@ -22,7 +22,7 @@ class CutBadgeFormatTests(unittest.TestCase):
|
||||
self.assertIn('class="cut-part-badge-name"', cut_rows)
|
||||
self.assertIn('class="cut-part-badge-length"', cut_rows)
|
||||
self.assertIn('@item.Name', cut_rows)
|
||||
self.assertIn('@ArchUnits.FormatFromInches(item.Length)', cut_rows)
|
||||
self.assertIn('@FormatResultLength(item.Length)', cut_rows)
|
||||
self.assertNotIn('$"{item.Name} (', cut_rows)
|
||||
|
||||
def test_length_section_has_a_darker_background_than_the_part_number_section(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user