Show critical branch details in web lookup
This commit is contained in:
@@ -52,6 +52,31 @@
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (Result.Branches.Count > 0)
|
||||
{
|
||||
<div class="callout">
|
||||
<h4>Conditional Branches</h4>
|
||||
<div class="branch-list">
|
||||
@foreach (var branch in Result.Branches)
|
||||
{
|
||||
<section class="branch-card">
|
||||
<div class="branch-condition">@branch.ConditionText</div>
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(branch.Description))
|
||||
{
|
||||
<p class="branch-copy">@branch.Description</p>
|
||||
}
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(branch.AffixText))
|
||||
{
|
||||
<p class="stacked-copy branch-affix">@branch.AffixText</p>
|
||||
}
|
||||
</section>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<details class="details-block">
|
||||
<summary>Raw Imported Cell</summary>
|
||||
<pre class="code-block">@Result.RawCellText</pre>
|
||||
|
||||
@@ -46,6 +46,15 @@ public sealed record CriticalLookupRequest(
|
||||
int Roll,
|
||||
string? Group);
|
||||
|
||||
public sealed record CriticalBranchLookupResponse(
|
||||
string BranchKind,
|
||||
string? ConditionKey,
|
||||
string ConditionText,
|
||||
string Description,
|
||||
string? AffixText,
|
||||
string RawText,
|
||||
int SortOrder);
|
||||
|
||||
public sealed record CriticalLookupResponse(
|
||||
string CriticalType,
|
||||
string CriticalTableName,
|
||||
@@ -64,6 +73,7 @@ public sealed record CriticalLookupResponse(
|
||||
string RawCellText,
|
||||
string Description,
|
||||
string? AffixText,
|
||||
IReadOnlyList<CriticalBranchLookupResponse> Branches,
|
||||
string ParseStatus,
|
||||
string ParsedJson);
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@ public sealed class LookupService(IDbContextFactory<RolemasterDbContext> dbConte
|
||||
|
||||
return await dbContext.CriticalResults
|
||||
.AsNoTracking()
|
||||
.AsSplitQuery()
|
||||
.Where(item =>
|
||||
item.CriticalTable.Slug == criticalType &&
|
||||
item.CriticalColumn.ColumnKey == column &&
|
||||
@@ -131,6 +132,17 @@ public sealed class LookupService(IDbContextFactory<RolemasterDbContext> dbConte
|
||||
item.RawCellText,
|
||||
item.DescriptionText,
|
||||
item.RawAffixText,
|
||||
item.Branches
|
||||
.OrderBy(branch => branch.SortOrder)
|
||||
.Select(branch => new CriticalBranchLookupResponse(
|
||||
branch.BranchKind,
|
||||
branch.ConditionKey,
|
||||
branch.ConditionText,
|
||||
branch.DescriptionText,
|
||||
branch.RawAffixText,
|
||||
branch.RawText,
|
||||
branch.SortOrder))
|
||||
.ToList(),
|
||||
item.ParseStatus,
|
||||
item.ParsedJson))
|
||||
.SingleOrDefaultAsync(cancellationToken);
|
||||
|
||||
@@ -229,6 +229,32 @@ textarea {
|
||||
color: #5b4327;
|
||||
}
|
||||
|
||||
.branch-list {
|
||||
display: grid;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.branch-card {
|
||||
padding: 0.8rem 0.85rem;
|
||||
border-radius: 14px;
|
||||
background: rgba(255, 252, 244, 0.75);
|
||||
border: 1px solid rgba(127, 96, 55, 0.14);
|
||||
}
|
||||
|
||||
.branch-condition {
|
||||
font-size: 0.82rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
color: #75562f;
|
||||
}
|
||||
|
||||
.branch-copy,
|
||||
.branch-affix {
|
||||
margin-top: 0.55rem;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.error-text {
|
||||
color: #8d2b1e;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user