|
22 | 22 | Color="@TypeColor(context.Item.Type)" |
23 | 23 | Size="Size.Small" /> |
24 | 24 | </MudTooltip> |
25 | | - <MudTooltip Text="@SplitPascal(context.Item.Status)" Placement="Placement.Right"> |
| 25 | + <MudTooltip Text="@FormatStatus(context.Item.Status)" Placement="Placement.Right"> |
26 | 26 | <MudIcon Icon="@StatusIcon(context.Item.Status)" |
27 | 27 | Color="@StatusColor(context.Item.Status)" |
28 | 28 | Size="Size.Small" /> |
|
72 | 72 | <MudChip T="string" Size="Size.Small" Icon="@TypeIcon(wi.Type)" Color="@TypeColor(wi.Type)" |
73 | 73 | Variant="Variant.Outlined" Style="font-weight:600;">@SplitPascal(wi.Type)</MudChip> |
74 | 74 | <MudChip T="string" Size="Size.Small" Icon="@StatusIcon(wi.Status)" Color="@StatusColor(wi.Status)" |
75 | | - Variant="Variant.Outlined" Style="font-weight:600;"> @SplitPascal(wi.Status)</MudChip> |
| 75 | + Variant="Variant.Outlined" Style="font-weight:600;"> @FormatStatus(wi.Status)</MudChip> |
76 | 76 | @if (details?.Priority is { } priority) |
77 | 77 | { |
78 | 78 | <MudChip T="string" Size="Size.Small" Color="Color.Default" |
|
261 | 261 | x.Description ?? "", |
262 | 262 | x.Assignee?.Name ?? "unassigned", |
263 | 263 | x.Creator.Name, |
264 | | - x.Status.ToString(), |
| 264 | + x.Status, |
265 | 265 | string.Join(' ', x.Labels) |
266 | 266 | ).ToLowerInvariant(); |
267 | 267 | return term.ToLowerInvariant().Split(' ', StringSplitOptions.RemoveEmptyEntries) |
|
382 | 382 | _ => Color.Default, |
383 | 383 | }; |
384 | 384 |
|
385 | | - private static string StatusIcon(WorkItemStatus s) => s switch |
| 385 | + private static string FormatStatus(string? status) => string.IsNullOrWhiteSpace(status) ? "Unknown" : status; |
| 386 | + |
| 387 | + private static string NormalizedStatus(string? status) => (status ?? "") |
| 388 | + .Replace(" ", "", StringComparison.Ordinal) |
| 389 | + .Replace("-", "", StringComparison.Ordinal) |
| 390 | + .Replace("_", "", StringComparison.Ordinal) |
| 391 | + .ToLowerInvariant(); |
| 392 | + |
| 393 | + private static string StatusIcon(string? s) => NormalizedStatus(s) switch |
386 | 394 | { |
387 | | - WorkItemStatus.New => Icons.Material.Filled.FiberNew, |
388 | | - WorkItemStatus.Active => Icons.Material.Filled.PlayCircle, |
389 | | - WorkItemStatus.InProgress => Icons.Material.Filled.Autorenew, |
390 | | - WorkItemStatus.Resolved => Icons.Material.Filled.CheckCircle, |
391 | | - WorkItemStatus.Closed => Icons.Material.Filled.Cancel, |
392 | | - WorkItemStatus.Blocked => Icons.Material.Filled.Block, |
393 | | - _ => Icons.Material.Filled.Circle, |
| 395 | + "new" or "proposed" or "todo" => Icons.Material.Filled.FiberNew, |
| 396 | + "active" or "open" => Icons.Material.Filled.PlayCircle, |
| 397 | + "inprogress" or "committed" or "doing" => Icons.Material.Filled.Autorenew, |
| 398 | + "resolved" => Icons.Material.Filled.CheckCircle, |
| 399 | + "readyfortesting" or "readytotest" or "readyfortest" => Icons.Material.Filled.Science, |
| 400 | + "readyforrelease" or "readyforrelase" => Icons.Material.Filled.RocketLaunch, |
| 401 | + "closed" or "done" or "completed" or "removed" => Icons.Material.Filled.Cancel, |
| 402 | + "blocked" or "impediment" => Icons.Material.Filled.Block, |
| 403 | + _ => Icons.Material.Filled.Circle, |
394 | 404 | }; |
395 | 405 |
|
396 | | - private static Color StatusColor(WorkItemStatus s) => s switch |
| 406 | + private static Color StatusColor(string? s) => NormalizedStatus(s) switch |
397 | 407 | { |
398 | | - WorkItemStatus.New => Color.Info, |
399 | | - WorkItemStatus.Active or WorkItemStatus.InProgress => Color.Primary, |
400 | | - WorkItemStatus.Resolved => Color.Success, |
401 | | - WorkItemStatus.Closed => Color.Default, |
402 | | - WorkItemStatus.Blocked => Color.Error, |
403 | | - _ => Color.Secondary, |
| 408 | + "new" or "proposed" or "todo" => Color.Info, |
| 409 | + "active" or "open" or "inprogress" or "committed" or "doing" => Color.Primary, |
| 410 | + "resolved" => Color.Success, |
| 411 | + "readyfortesting" or "readytotest" or "readyfortest" => Color.Tertiary, |
| 412 | + "readyforrelease" or "readyforrelase" => Color.Success, |
| 413 | + "closed" or "done" or "completed" or "removed" => Color.Default, |
| 414 | + "blocked" or "impediment" => Color.Error, |
| 415 | + _ => Color.Secondary, |
404 | 416 | }; |
405 | 417 |
|
406 | 418 | private static string Relative(DateTimeOffset dt) |
|
0 commit comments