Show missing floor mappings explicitly in the Context workspace

This commit is contained in:
Nick Beckley 2026-11-06 10:45:53 +00:00
parent e34c9a53ba
commit be88c1d068

View File

@ -2,9 +2,9 @@
@{
var scene = Model.Context!.Scene!;
var floorPlan = Model.FloorPlan;
// Only an explicit scene/occupancy mapping identifies a floor.
var floorId = scene.InitialFloorPlanFloorID
?? floorPlan?.OccupancyScenes.FirstOrDefault(x => x.SceneID == scene.SceneID)?.InitialFloorPlanFloorID
?? floorPlan?.Floors.OrderBy(x => x.SortOrder).FirstOrDefault()?.FloorPlanFloorID;
?? floorPlan?.OccupancyScenes.FirstOrDefault(x => x.SceneID == scene.SceneID)?.InitialFloorPlanFloorID;
var floor = floorPlan?.Floors.FirstOrDefault(x => x.FloorPlanFloorID == floorId);
var blocks = floor is null ? [] : floorPlan!.Blocks.Where(x => x.FloorPlanFloorID == floor.FloorPlanFloorID).ToList();
var tokens = floor is null ? [] : floorPlan!.OccupancyTokens.Where(x => x.SceneID == scene.SceneID && x.FloorPlanFloorID == floor.FloorPlanFloorID).ToList();
@ -30,7 +30,7 @@
}
else if (floor is null || !blocks.Any())
{
<p>No placed rooms are available for this floor.</p>
<p>@(floor is null?"No saved floor mapping for this scene. Open the linked floor plan to choose a floor.":"No placed rooms are available for this floor.")</p>
}
else
{