fix(web): place lock action in results toolbar
Build CutList image / build-and-push (push) Successful in 20s
Build CutList image / build-and-push (push) Successful in 20s
This commit is contained in:
@@ -987,6 +987,16 @@ else
|
|||||||
<button class="btn btn-outline-secondary ms-2" @onclick="PrintReport">
|
<button class="btn btn-outline-secondary ms-2" @onclick="PrintReport">
|
||||||
<i class="bi bi-printer me-1"></i> Print Report
|
<i class="bi bi-printer me-1"></i> Print Report
|
||||||
</button>
|
</button>
|
||||||
|
@if (!job.IsLocked)
|
||||||
|
{
|
||||||
|
<button class="btn btn-warning ms-2" @onclick="LockJob" disabled="@lockingJob">
|
||||||
|
@if (lockingJob)
|
||||||
|
{
|
||||||
|
<span class="spinner-border spinner-border-sm me-1"></span>
|
||||||
|
}
|
||||||
|
<i class="bi bi-lock me-1"></i>Lock Job
|
||||||
|
</button>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@if (job.OptimizedAt.HasValue)
|
@if (job.OptimizedAt.HasValue)
|
||||||
{
|
{
|
||||||
@@ -1050,16 +1060,6 @@ else
|
|||||||
{
|
{
|
||||||
<span class="badge bg-success"><i class="bi bi-lock-fill me-1"></i>Job Locked</span>
|
<span class="badge bg-success"><i class="bi bi-lock-fill me-1"></i>Job Locked</span>
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
<button class="btn btn-warning btn-sm" @onclick="LockJob" disabled="@lockingJob">
|
|
||||||
@if (lockingJob)
|
|
||||||
{
|
|
||||||
<span class="spinner-border spinner-border-sm me-1"></span>
|
|
||||||
}
|
|
||||||
<i class="bi bi-lock me-1"></i>Lock Job
|
|
||||||
</button>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
@if (summary.TotalToBePurchasedBins == 0)
|
@if (summary.TotalToBePurchasedBins == 0)
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
"""Focused regression checks for job-level actions on the Results tab."""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||||
|
JOB_EDITOR = REPO_ROOT / "CutList.Web/Components/Pages/Jobs/Edit.razor"
|
||||||
|
|
||||||
|
|
||||||
|
class JobResultsActionsTests(unittest.TestCase):
|
||||||
|
def test_lock_job_is_in_the_results_action_row_before_result_cards(self) -> None:
|
||||||
|
markup = JOB_EDITOR.read_text()
|
||||||
|
results_start = markup.index("private RenderFragment RenderResultsTab()")
|
||||||
|
result_cards_start = markup.index("@if (packResult != null && summary != null)", results_start)
|
||||||
|
action_row = markup[results_start:result_cards_start]
|
||||||
|
|
||||||
|
self.assertIn('@onclick="PrintReport"', action_row)
|
||||||
|
self.assertIn('@onclick="LockJob"', action_row)
|
||||||
|
self.assertIn("Lock Job", action_row)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
Reference in New Issue
Block a user