From f72366169619be0877eae144f45f01c2899650de Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Thu, 5 Feb 2026 00:18:56 -0500 Subject: [PATCH] feat: Convert part form to modal dialog and improve material ordering - Replace inline part form with Bootstrap modal dialog for better UX - Add SortOrder to material dropdown ordering in Parts and Stock tabs Co-Authored-By: Claude Opus 4.5 --- CutList.Web/Components/Pages/Jobs/Edit.razor | 116 ++++++++++--------- 1 file changed, 64 insertions(+), 52 deletions(-) diff --git a/CutList.Web/Components/Pages/Jobs/Edit.razor b/CutList.Web/Components/Pages/Jobs/Edit.razor index 16b35a5..f77fab9 100644 --- a/CutList.Web/Components/Pages/Jobs/Edit.razor +++ b/CutList.Web/Components/Pages/Jobs/Edit.razor @@ -82,6 +82,67 @@ else } +@* Part Modal Dialog *@ +@if (showPartForm) +{ + +} + @code { private enum Tab { Details, Parts, Stock } @@ -119,7 +180,7 @@ else private IEnumerable DistinctShapes => materials.Select(m => m.Shape).Distinct().OrderBy(s => s); private IEnumerable FilteredMaterials => !selectedShape.HasValue ? Enumerable.Empty() - : materials.Where(m => m.Shape == selectedShape.Value).OrderBy(m => m.Size); + : materials.Where(m => m.Shape == selectedShape.Value).OrderBy(m => m.SortOrder).ThenBy(m => m.Size); private bool IsNew => !Id.HasValue; @@ -221,55 +282,6 @@ else
- @if (showPartForm) - { -
-
@(editingPart == null ? "Add Part" : "Edit Part")
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- @if (!string.IsNullOrEmpty(partErrorMessage)) - { -
@partErrorMessage
- } -
- - -
-
- } - @if (job.Parts.Count == 0) {
@@ -482,7 +494,7 @@ else - @foreach (var material in materials.Where(m => stockSelectedShape.HasValue && m.Shape == stockSelectedShape.Value).OrderBy(m => m.Size)) + @foreach (var material in materials.Where(m => stockSelectedShape.HasValue && m.Shape == stockSelectedShape.Value).OrderBy(m => m.SortOrder).ThenBy(m => m.Size)) { }