Show critical branch details in web lookup
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -277,6 +277,7 @@ ServiceFabricBackup/
|
|||||||
# SQLite transient sidecars
|
# SQLite transient sidecars
|
||||||
*.db-shm
|
*.db-shm
|
||||||
*.db-wal
|
*.db-wal
|
||||||
|
/rolemaster.db
|
||||||
|
|
||||||
# Business Intelligence projects
|
# Business Intelligence projects
|
||||||
*.rdl.data
|
*.rdl.data
|
||||||
|
|||||||
@@ -52,6 +52,31 @@
|
|||||||
</div>
|
</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">
|
<details class="details-block">
|
||||||
<summary>Raw Imported Cell</summary>
|
<summary>Raw Imported Cell</summary>
|
||||||
<pre class="code-block">@Result.RawCellText</pre>
|
<pre class="code-block">@Result.RawCellText</pre>
|
||||||
|
|||||||
@@ -46,6 +46,15 @@ public sealed record CriticalLookupRequest(
|
|||||||
int Roll,
|
int Roll,
|
||||||
string? Group);
|
string? Group);
|
||||||
|
|
||||||
|
public sealed record CriticalBranchLookupResponse(
|
||||||
|
string BranchKind,
|
||||||
|
string? ConditionKey,
|
||||||
|
string ConditionText,
|
||||||
|
string Description,
|
||||||
|
string? AffixText,
|
||||||
|
string RawText,
|
||||||
|
int SortOrder);
|
||||||
|
|
||||||
public sealed record CriticalLookupResponse(
|
public sealed record CriticalLookupResponse(
|
||||||
string CriticalType,
|
string CriticalType,
|
||||||
string CriticalTableName,
|
string CriticalTableName,
|
||||||
@@ -64,6 +73,7 @@ public sealed record CriticalLookupResponse(
|
|||||||
string RawCellText,
|
string RawCellText,
|
||||||
string Description,
|
string Description,
|
||||||
string? AffixText,
|
string? AffixText,
|
||||||
|
IReadOnlyList<CriticalBranchLookupResponse> Branches,
|
||||||
string ParseStatus,
|
string ParseStatus,
|
||||||
string ParsedJson);
|
string ParsedJson);
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ public sealed class LookupService(IDbContextFactory<RolemasterDbContext> dbConte
|
|||||||
|
|
||||||
return await dbContext.CriticalResults
|
return await dbContext.CriticalResults
|
||||||
.AsNoTracking()
|
.AsNoTracking()
|
||||||
|
.AsSplitQuery()
|
||||||
.Where(item =>
|
.Where(item =>
|
||||||
item.CriticalTable.Slug == criticalType &&
|
item.CriticalTable.Slug == criticalType &&
|
||||||
item.CriticalColumn.ColumnKey == column &&
|
item.CriticalColumn.ColumnKey == column &&
|
||||||
@@ -131,6 +132,17 @@ public sealed class LookupService(IDbContextFactory<RolemasterDbContext> dbConte
|
|||||||
item.RawCellText,
|
item.RawCellText,
|
||||||
item.DescriptionText,
|
item.DescriptionText,
|
||||||
item.RawAffixText,
|
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.ParseStatus,
|
||||||
item.ParsedJson))
|
item.ParsedJson))
|
||||||
.SingleOrDefaultAsync(cancellationToken);
|
.SingleOrDefaultAsync(cancellationToken);
|
||||||
|
|||||||
@@ -229,6 +229,32 @@ textarea {
|
|||||||
color: #5b4327;
|
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 {
|
.error-text {
|
||||||
color: #8d2b1e;
|
color: #8d2b1e;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user