Spaces:
Running
Running
User commited on
Commit ·
2358ba3
1
Parent(s): 3b3dce7
update: column width
Browse files
TaskTrackingSystem.WebApp/Components/Pages/Features/Reports/IssueReport.razor
CHANGED
|
@@ -131,8 +131,17 @@
|
|
| 131 |
}
|
| 132 |
else
|
| 133 |
{
|
| 134 |
-
<div class="overflow-x-
|
| 135 |
-
<table class="w-full">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
<thead>
|
| 137 |
<tr class="border-b border-slate-100 bg-slate-50/60">
|
| 138 |
<th class="px-4 py-3 text-left text-xs font-semibold uppercase tracking-wider text-slate-500">Issue</th>
|
|
@@ -149,7 +158,7 @@
|
|
| 149 |
{
|
| 150 |
<tr class="align-top hover:bg-slate-50/50">
|
| 151 |
<td class="px-4 py-3">
|
| 152 |
-
<button @onclick="() => ToggleExpanded(issue.Id)" class="text-left text-sm font-semibold text-slate-900 hover:text-violet-600">@issue.Title</button>
|
| 153 |
@if (expandedIssues.Contains(issue.Id))
|
| 154 |
{
|
| 155 |
<div class="mt-2 rounded-lg bg-slate-50 p-3 text-xs text-slate-600">
|
|
@@ -159,12 +168,23 @@
|
|
| 159 |
</div>
|
| 160 |
}
|
| 161 |
</td>
|
| 162 |
-
<td class="px-4 py-3 text-sm text-slate-600">
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
</tr>
|
| 169 |
}
|
| 170 |
@if (!PagedIssues.Any())
|
|
@@ -186,6 +206,7 @@
|
|
| 186 |
private List<IssueDto> issues = new();
|
| 187 |
private List<ProjectDto> projects = new();
|
| 188 |
private HashSet<long> expandedIssues = new();
|
|
|
|
| 189 |
private string searchInput = string.Empty;
|
| 190 |
private string appliedSearch = string.Empty;
|
| 191 |
private long filterProjectId;
|
|
@@ -266,6 +287,7 @@
|
|
| 266 |
|
| 267 |
private void SetView(bool chartView) => isChartView = chartView;
|
| 268 |
private void ToggleExpanded(long id) { if (!expandedIssues.Remove(id)) expandedIssues.Add(id); }
|
|
|
|
| 269 |
private Task HandlePageChanged(int page) { currentPage = page; return Task.CompletedTask; }
|
| 270 |
private Task HandlePageSizeChanged(int size) { pageSize = size; currentPage = 1; return Task.CompletedTask; }
|
| 271 |
|
|
@@ -287,6 +309,7 @@
|
|
| 287 |
}
|
| 288 |
|
| 289 |
private static bool IsOverdue(IssueDto issue) => issue.StatusId != AppTaskStatus.Done && issue.DueDate.Date < DateTime.Today;
|
|
|
|
| 290 |
private static string GetStatusLabel(AppTaskStatus status) => status == AppTaskStatus.InProgress ? "In Progress" : status == AppTaskStatus.Done ? "Done" : "To Do";
|
| 291 |
private static string GetStatusBadge(AppTaskStatus status) => status == AppTaskStatus.Done ? "bg-emerald-50 text-emerald-700" : status == AppTaskStatus.InProgress ? "bg-blue-50 text-blue-700" : "bg-slate-100 text-slate-700";
|
| 292 |
private static string GetPriorityLabel(TaskPriority priority) => priority == TaskPriority.High ? "High" : priority == TaskPriority.Medium ? "Medium" : "Low";
|
|
|
|
| 131 |
}
|
| 132 |
else
|
| 133 |
{
|
| 134 |
+
<div class="overflow-x-hidden">
|
| 135 |
+
<table class="w-full table-fixed">
|
| 136 |
+
<colgroup>
|
| 137 |
+
<col class="w-[27%]" />
|
| 138 |
+
<col class="w-[17%]" />
|
| 139 |
+
<col class="w-[18%]" />
|
| 140 |
+
<col class="w-[11%]" />
|
| 141 |
+
<col class="w-[10%]" />
|
| 142 |
+
<col class="w-[9%]" />
|
| 143 |
+
<col class="w-[8%]" />
|
| 144 |
+
</colgroup>
|
| 145 |
<thead>
|
| 146 |
<tr class="border-b border-slate-100 bg-slate-50/60">
|
| 147 |
<th class="px-4 py-3 text-left text-xs font-semibold uppercase tracking-wider text-slate-500">Issue</th>
|
|
|
|
| 158 |
{
|
| 159 |
<tr class="align-top hover:bg-slate-50/50">
|
| 160 |
<td class="px-4 py-3">
|
| 161 |
+
<button @onclick="() => ToggleExpanded(issue.Id)" class="block w-full text-left text-sm font-semibold text-slate-900 hover:text-violet-600 break-words">@issue.Title</button>
|
| 162 |
@if (expandedIssues.Contains(issue.Id))
|
| 163 |
{
|
| 164 |
<div class="mt-2 rounded-lg bg-slate-50 p-3 text-xs text-slate-600">
|
|
|
|
| 168 |
</div>
|
| 169 |
}
|
| 170 |
</td>
|
| 171 |
+
<td class="px-4 py-3 text-sm text-slate-600">
|
| 172 |
+
<button @onclick="() => ToggleTaskDetails(issue.Id)" class="inline-flex items-center rounded-full border border-slate-200 bg-slate-50 px-2.5 py-1 font-mono text-[11px] font-semibold tracking-wide text-indigo-700 hover:border-indigo-200 hover:bg-indigo-50">
|
| 173 |
+
@GetTaskCode(issue.TaskId)
|
| 174 |
+
</button>
|
| 175 |
+
@if (expandedTaskDetails.Contains(issue.Id))
|
| 176 |
+
{
|
| 177 |
+
<div class="mt-2 rounded-lg bg-slate-50 p-3 text-xs text-slate-600">
|
| 178 |
+
<div class="font-medium text-slate-800 break-words">@issue.TaskTitle</div>
|
| 179 |
+
<div class="mt-1 break-words">@issue.ProjectName</div>
|
| 180 |
+
</div>
|
| 181 |
+
}
|
| 182 |
+
</td>
|
| 183 |
+
<td class="px-4 py-3 text-sm text-slate-600 break-words">@(issue.AssignedToName ?? "Unassigned")</td>
|
| 184 |
+
<td class="px-4 py-3"><span class="inline-flex whitespace-nowrap rounded-full px-2 py-0.5 text-xs font-medium @GetStatusBadge(issue.StatusId)">@GetStatusLabel(issue.StatusId)</span></td>
|
| 185 |
+
<td class="px-4 py-3 text-sm text-slate-700 whitespace-nowrap">@((issue.EstimatedHours ?? 0).ToString("N1")) / @((issue.ActualHours ?? 0).ToString("N1"))</td>
|
| 186 |
+
<td class="px-4 py-3 text-sm whitespace-nowrap @(IsOverdue(issue) ? "font-semibold text-rose-600" : "text-slate-600")">@DisplayFormats.Date(issue.DueDate)</td>
|
| 187 |
+
<td class="px-4 py-3 whitespace-nowrap">@RiskBadge(issue)</td>
|
| 188 |
</tr>
|
| 189 |
}
|
| 190 |
@if (!PagedIssues.Any())
|
|
|
|
| 206 |
private List<IssueDto> issues = new();
|
| 207 |
private List<ProjectDto> projects = new();
|
| 208 |
private HashSet<long> expandedIssues = new();
|
| 209 |
+
private HashSet<long> expandedTaskDetails = new();
|
| 210 |
private string searchInput = string.Empty;
|
| 211 |
private string appliedSearch = string.Empty;
|
| 212 |
private long filterProjectId;
|
|
|
|
| 287 |
|
| 288 |
private void SetView(bool chartView) => isChartView = chartView;
|
| 289 |
private void ToggleExpanded(long id) { if (!expandedIssues.Remove(id)) expandedIssues.Add(id); }
|
| 290 |
+
private void ToggleTaskDetails(long id) { if (!expandedTaskDetails.Remove(id)) expandedTaskDetails.Add(id); }
|
| 291 |
private Task HandlePageChanged(int page) { currentPage = page; return Task.CompletedTask; }
|
| 292 |
private Task HandlePageSizeChanged(int size) { pageSize = size; currentPage = 1; return Task.CompletedTask; }
|
| 293 |
|
|
|
|
| 309 |
}
|
| 310 |
|
| 311 |
private static bool IsOverdue(IssueDto issue) => issue.StatusId != AppTaskStatus.Done && issue.DueDate.Date < DateTime.Today;
|
| 312 |
+
private static string GetTaskCode(long taskId) => $"TSK-{taskId:D4}";
|
| 313 |
private static string GetStatusLabel(AppTaskStatus status) => status == AppTaskStatus.InProgress ? "In Progress" : status == AppTaskStatus.Done ? "Done" : "To Do";
|
| 314 |
private static string GetStatusBadge(AppTaskStatus status) => status == AppTaskStatus.Done ? "bg-emerald-50 text-emerald-700" : status == AppTaskStatus.InProgress ? "bg-blue-50 text-blue-700" : "bg-slate-100 text-slate-700";
|
| 315 |
private static string GetPriorityLabel(TaskPriority priority) => priority == TaskPriority.High ? "High" : priority == TaskPriority.Medium ? "Medium" : "Low";
|