Enhance UI components for map editing and school creation. Update styles for improved layout and responsiveness, including adjustments to dialog positioning and flex properties. Introduce new localization strings for better user guidance in both English and Russian. Refactor code structure for clarity and maintainability, ensuring a more intuitive user experience.
ci / server (push) Failing after 3m32s
ci / client (push) Successful in 14s

This commit is contained in:
Leonid Pershin
2026-08-18 16:34:35 +03:00
parent 3068d10409
commit 7658443cd5
9 changed files with 378 additions and 119 deletions
@@ -33,4 +33,42 @@ public class MapViewTests
Assert.Empty(corridor.Items);
Assert.Empty(corridor.Positions);
}
[Fact]
public void FloorLabel_FollowsTheDefLabelInsteadOfReplacingIt()
{
var catalog = new CatalogLoader().Load(
[CatalogLoader.CorePackId],
[
new ContentDocument(
CatalogLoader.CorePackId,
"defs/floors/standard.jsonc",
"""{ "defName": "StandardFloor" }"""),
new ContentDocument(
CatalogLoader.CorePackId,
"defs/territories/yard.jsonc",
"""{ "defName": "Yard" }"""),
new ContentDocument(
CatalogLoader.CorePackId,
"localizations/ru.jsonc",
"""{ "StandardFloor": "Этаж", "Yard": "Двор" }"""),
]);
var map = new MapLayout
{
Territory = new TerritoryNode { Id = "yard", Def = "Yard" },
Buildings = [new BuildingNode { Id = "main", Def = "Main" }],
Floors =
[
new FloorNode { Id = "floor-1", Def = "StandardFloor", Building = "main", Label = "1" },
new FloorNode { Id = "floor-2", Def = "StandardFloor", Building = "main" },
],
};
var nodes = MapView.Build(catalog, map, "ru");
// A bare "1" in the tree is the label on its own; the def label carries the noun.
Assert.Equal("Этаж 1", nodes.Single(node => node.Id == "floor-1").Name);
Assert.Equal("Этаж", nodes.Single(node => node.Id == "floor-2").Name);
}
}