Add hover tooltips on job list rows showing description and PO number
Adds CustomerPO to JobListDto (maps by convention), then builds a Bootstrap tooltip per row with description · PO: xxx, skipping blank fields. Rows with neither get no tooltip. Helps identify jobs at a glance without opening the details page. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -113,6 +113,7 @@ public class JobListDto
|
|||||||
|
|
||||||
public string? CustomerEmail { get; set; }
|
public string? CustomerEmail { get; set; }
|
||||||
public bool CustomerNotifyByEmail { get; set; } = true;
|
public bool CustomerNotifyByEmail { get; set; } = true;
|
||||||
|
public string? CustomerPO { get; set; }
|
||||||
public DateTime? ScheduledDate { get; set; }
|
public DateTime? ScheduledDate { get; set; }
|
||||||
public DateTime? DueDate { get; set; }
|
public DateTime? DueDate { get; set; }
|
||||||
public decimal FinalPrice { get; set; }
|
public decimal FinalPrice { get; set; }
|
||||||
|
|||||||
@@ -191,7 +191,14 @@
|
|||||||
var isHot = job.DueDate.HasValue && job.DueDate.Value < DateTime.Now
|
var isHot = job.DueDate.HasValue && job.DueDate.Value < DateTime.Now
|
||||||
&& job.StatusCode != "COMPLETED" && job.StatusCode != "READYFORPICKUP"
|
&& job.StatusCode != "COMPLETED" && job.StatusCode != "READYFORPICKUP"
|
||||||
&& job.StatusCode != "DELIVERED" && job.StatusCode != "CANCELLED";
|
&& job.StatusCode != "DELIVERED" && job.StatusCode != "CANCELLED";
|
||||||
<tr class="job-row" data-job-id="@job.Id" style="cursor: pointer;">
|
var tipParts = new List<string>();
|
||||||
|
if (!string.IsNullOrWhiteSpace(job.Description)) tipParts.Add(job.Description);
|
||||||
|
if (!string.IsNullOrWhiteSpace(job.CustomerPO)) tipParts.Add("PO: " + job.CustomerPO);
|
||||||
|
var tipText = string.Join(" · ", tipParts);
|
||||||
|
<tr class="job-row" data-job-id="@job.Id" style="cursor: pointer;"
|
||||||
|
@if (!string.IsNullOrEmpty(tipText)) {
|
||||||
|
<text>data-bs-toggle="tooltip" data-bs-placement="top" data-bs-title="@Html.Encode(tipText)"</text>
|
||||||
|
}>
|
||||||
<td class="ps-4 @(isHot ? "job-hot-cell" : "")">
|
<td class="ps-4 @(isHot ? "job-hot-cell" : "")">
|
||||||
<div>
|
<div>
|
||||||
<div class="mono fw-500">
|
<div class="mono fw-500">
|
||||||
@@ -629,6 +636,10 @@
|
|||||||
loadJobStatuses();
|
loadJobStatuses();
|
||||||
loadJobPriorities();
|
loadJobPriorities();
|
||||||
|
|
||||||
|
// Row tooltips (description + PO)
|
||||||
|
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(el =>
|
||||||
|
new bootstrap.Tooltip(el, { trigger: 'hover' }));
|
||||||
|
|
||||||
// / key focuses search input
|
// / key focuses search input
|
||||||
document.addEventListener('keydown', function(e) {
|
document.addEventListener('keydown', function(e) {
|
||||||
if (e.key === '/' && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {
|
if (e.key === '/' && document.activeElement.tagName !== 'INPUT' && document.activeElement.tagName !== 'TEXTAREA') {
|
||||||
|
|||||||
Reference in New Issue
Block a user