feat(uns): equipment is a tree leaf linking to the detail page; drop EquipmentModal

This commit is contained in:
Joseph Doherty
2026-06-11 15:01:10 -04:00
parent 773c073d0e
commit 826ffdc1a0
6 changed files with 26 additions and 547 deletions
@@ -68,7 +68,7 @@ public sealed class UnsTreeAssemblyTests
}
[Fact]
public void Build_sets_equipment_child_count_and_lazy_flag()
public void Build_sets_equipment_child_count_and_leaf_flag()
{
var clusters = new[] { new ClusterRow("c1", "zb", "SiteA", "Alpha") };
var areas = new[] { new AreaRow("a1", "c1", "AreaOne") };
@@ -82,9 +82,12 @@ public sealed class UnsTreeAssemblyTests
var tree = UnsTreeAssembly.Build(clusters, areas, lines, equipment);
var line = tree.Single().Children.Single().Children.Single().Children.Single();
// Equipment is a tree leaf that links to its own detail page, so it never carries an
// expander — HasLazyChildren is always false regardless of its tag/virtual-tag count.
// The ChildCount badge still reflects tags + virtual tags.
var withChildren = line.Children.Single(e => e.Key == "eq:e1");
withChildren.ChildCount.ShouldBe(3);
withChildren.HasLazyChildren.ShouldBeTrue();
withChildren.HasLazyChildren.ShouldBeFalse();
var empty = line.Children.Single(e => e.Key == "eq:e2");
empty.ChildCount.ShouldBe(0);
@@ -54,8 +54,8 @@ public sealed class UnsTreeServiceStructureTests
equipment.ClusterId.ShouldBe(UnsTreeTestDb.PopulatedClusterId);
}
/// <summary>The seeded equipment node's badge count equals tags + virtual tags and it is
/// flagged as lazily expandable.</summary>
/// <summary>The seeded equipment node's badge count equals tags + virtual tags. Equipment is a
/// tree leaf (no expander), so HasLazyChildren is always false.</summary>
[Fact]
public async Task LoadStructure_counts_tags_and_vtags_per_equipment()
{
@@ -72,7 +72,7 @@ public sealed class UnsTreeServiceStructureTests
// Seed: 2 driver tags + 1 virtual tag (the orphan tag has no equipment and is excluded).
equipment.ChildCount.ShouldBe(3);
equipment.HasLazyChildren.ShouldBeTrue();
equipment.HasLazyChildren.ShouldBeFalse();
}
/// <summary>An empty cluster (no areas) is still rendered as a Cluster node with no children.</summary>