Show critical curation state in the editor and tables
This commit is contained in:
@@ -121,12 +121,14 @@
|
||||
@if (TryGetCell(rollBand.Label, group.Key, column.Key, out var groupedCell))
|
||||
{
|
||||
<td
|
||||
class="critical-table-cell is-editable"
|
||||
class="@GetCellCssClass(groupedCell)"
|
||||
tabindex="0"
|
||||
title="Click to edit this cell"
|
||||
title="@GetCellTitle(groupedCell)"
|
||||
aria-label="@GetCellTitle(groupedCell)"
|
||||
@onclick="() => OpenCellEditorAsync(groupedCell.ResultId)"
|
||||
@onkeydown="args => HandleCellKeyDownAsync(args, groupedCell.ResultId)">
|
||||
<CompactCriticalCell
|
||||
IsCurated="@groupedCell.IsCurated"
|
||||
Description="@(groupedCell.Description ?? string.Empty)"
|
||||
Effects="@(groupedCell.Effects ?? Array.Empty<CriticalEffectLookupResponse>())"
|
||||
Branches="@(groupedCell.Branches ?? Array.Empty<CriticalBranchLookupResponse>())" />
|
||||
@@ -148,12 +150,14 @@
|
||||
@if (TryGetCell(rollBand.Label, null, column.Key, out var cell))
|
||||
{
|
||||
<td
|
||||
class="critical-table-cell is-editable"
|
||||
class="@GetCellCssClass(cell)"
|
||||
tabindex="0"
|
||||
title="Click to edit this cell"
|
||||
title="@GetCellTitle(cell)"
|
||||
aria-label="@GetCellTitle(cell)"
|
||||
@onclick="() => OpenCellEditorAsync(cell.ResultId)"
|
||||
@onkeydown="args => HandleCellKeyDownAsync(args, cell.ResultId)">
|
||||
<CompactCriticalCell
|
||||
IsCurated="@cell.IsCurated"
|
||||
Description="@(cell.Description ?? string.Empty)"
|
||||
Effects="@(cell.Effects ?? Array.Empty<CriticalEffectLookupResponse>())"
|
||||
Branches="@(cell.Branches ?? Array.Empty<CriticalBranchLookupResponse>())" />
|
||||
@@ -457,4 +461,14 @@
|
||||
await OpenCellEditorAsync(resultId);
|
||||
}
|
||||
}
|
||||
|
||||
private static string GetCellCssClass(CriticalTableCellDetail cell) =>
|
||||
cell.IsCurated
|
||||
? "critical-table-cell is-editable is-curated"
|
||||
: "critical-table-cell is-editable needs-curation";
|
||||
|
||||
private static string GetCellTitle(CriticalTableCellDetail cell) =>
|
||||
cell.IsCurated
|
||||
? "Curated cell. Click to edit this cell."
|
||||
: "Needs curation. Click to edit this cell.";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user