fix: polish unified add-stock modal (Edit.razor)
Build CutList image / build-and-push (push) Successful in 24s
Build CutList image / build-and-push (push) Successful in 24s
Apply four low-risk fixes from final code review of the consolidated add-stock modal: reset newStock on modal close, dedupe stock-item loading through the existing helper, correct stale empty-state copy about inventory fallback, and remove a stray blank line left from the old form deletion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -882,7 +882,7 @@ else
|
|||||||
<div class="text-center py-4 text-muted">
|
<div class="text-center py-4 text-muted">
|
||||||
<p class="mb-2">No stock configured for this job.</p>
|
<p class="mb-2">No stock configured for this job.</p>
|
||||||
<p class="small">Add stock from your inventory or define custom lengths.</p>
|
<p class="small">Add stock from your inventory or define custom lengths.</p>
|
||||||
<p class="small">If no stock is selected, the optimizer will use all available stock for the materials in your parts list.</p>
|
<p class="small">Stock must be explicitly added here before you can optimize — there is no automatic fallback to inventory.</p>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -893,7 +893,6 @@ else
|
|||||||
</div>
|
</div>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private RenderFragment RenderStockTable() => __builder =>
|
private RenderFragment RenderStockTable() => __builder =>
|
||||||
{
|
{
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
@@ -1251,6 +1250,7 @@ else
|
|||||||
{
|
{
|
||||||
showStockModal = false;
|
showStockModal = false;
|
||||||
editingStock = null;
|
editingStock = null;
|
||||||
|
newStock = new();
|
||||||
importCandidates.Clear();
|
importCandidates.Clear();
|
||||||
stockErrorMessage = null;
|
stockErrorMessage = null;
|
||||||
importErrorMessage = null;
|
importErrorMessage = null;
|
||||||
@@ -1268,14 +1268,7 @@ else
|
|||||||
{
|
{
|
||||||
newStock.MaterialId = stockSelectedMaterialId;
|
newStock.MaterialId = stockSelectedMaterialId;
|
||||||
newStock.StockItemId = null;
|
newStock.StockItemId = null;
|
||||||
if (stockSelectedMaterialId > 0)
|
await LoadAvailableStockItemsAsync(stockSelectedMaterialId);
|
||||||
{
|
|
||||||
availableStockItems = await JobService.GetAvailableStockForMaterialAsync(stockSelectedMaterialId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
availableStockItems.Clear();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task EditStock(JobStock stock)
|
private async Task EditStock(JobStock stock)
|
||||||
|
|||||||
Reference in New Issue
Block a user