From 077714d80ef383aba51f7714b383c2173b4761e6 Mon Sep 17 00:00:00 2001 From: Nick Beckley Date: Sun, 21 Jun 2026 18:41:09 +0100 Subject: [PATCH] Implemented the Floor Plans AJAX consolidation pass. --- PlotLine/Services/CoreServices.cs | 10 - PlotLine/Views/FloorPlans/Edit.cshtml | 270 +++++++++++++++++++------- 2 files changed, 200 insertions(+), 80 deletions(-) diff --git a/PlotLine/Services/CoreServices.cs b/PlotLine/Services/CoreServices.cs index 6eb6931..1632a2e 100644 --- a/PlotLine/Services/CoreServices.cs +++ b/PlotLine/Services/CoreServices.cs @@ -7890,16 +7890,6 @@ public sealed class FloorPlanService( throw new InvalidOperationException("Transition locations must both exist on the active floor."); } - var duplicate = transitions.Any(x => x.FloorPlanFloorID == floor.FloorPlanFloorID - && x.FloorPlanTransitionID != model.FloorPlanTransitionID - && x.FromLocationID == model.FromLocationID.Value - && x.ToLocationID == model.ToLocationID.Value - && string.Equals(x.TransitionType, model.TransitionType, StringComparison.OrdinalIgnoreCase)); - - if (duplicate) - { - throw new InvalidOperationException("That transition already exists on this floor."); - } } private async Task<(FloorPlan Plan, FloorPlanFloor Floor)> GetPlanFloorAsync(int floorPlanId, int floorPlanFloorId) diff --git a/PlotLine/Views/FloorPlans/Edit.cshtml b/PlotLine/Views/FloorPlans/Edit.cshtml index 98bad9f..a54c7d3 100644 --- a/PlotLine/Views/FloorPlans/Edit.cshtml +++ b/PlotLine/Views/FloorPlans/Edit.cshtml @@ -98,9 +98,10 @@ -@if (!Model.Floors.Any()) -{ -
+
+ @if (!Model.Floors.Any()) + { +

No floors yet

Add a floor to start arranging linked locations.

@@ -125,13 +126,13 @@
-
+ -
-} -else -{ -
+
+ } + else + { +
@@ -614,16 +615,16 @@ else
-
+ -
+ -
+ -
+
- @foreach (var floor in Model.Floors) - { + @foreach (var floor in Model.Floors) + {
@@ -642,10 +643,10 @@ else
- } + } - @foreach (var floor in Model.Floors) - { + @foreach (var floor in Model.Floors) + { var placedBlockCount = Model.Blocks.Count(x => x.FloorPlanFloorID == floor.FloorPlanFloorID); - } + } - @foreach (var floor in Model.Floors.Where(x => !string.IsNullOrWhiteSpace(x.BackgroundImagePath))) - { + @foreach (var floor in Model.Floors.Where(x => !string.IsNullOrWhiteSpace(x.BackgroundImagePath))) + { - } + } - @foreach (var transition in Model.Transitions) - { + @foreach (var transition in Model.Transitions) + { var transitionFloorBlocks = blocksByFloor.GetValueOrDefault(transition.FloorPlanFloorID) ?? []; var transitionLocationOptions = transitionFloorBlocks .Where(x => x.LocationID.HasValue) @@ -789,10 +790,10 @@ else - } + } - @foreach (var block in Model.Blocks) - { + @foreach (var block in Model.Blocks) + { + } } -} + @section Scripts { }