Refactor BumperPlaceholders and BumperFacts for improved logic and readability
ci / build-backend (push) Successful in 2m15s
ci / build-frontend (push) Successful in 1m7s
ci / tests (push) Successful in 2m33s
ci / sonar (push) Successful in 10m26s

Updated the BumperPlaceholders class to streamline token extraction from texts, enhancing performance and clarity. Modified BumperFacts to initialize slot titles with an empty array instead of a dictionary for better consistency. Renamed methods in BumperResolver for clarity, and refactored GridScheduleGenerator to simplify return logic. Additionally, improved the BumperLinesEditor component by implementing a keyed list for better state management and user experience.
This commit is contained in:
Leonid Pershin
2026-07-27 23:04:15 +03:00
parent 3d2ae20368
commit 1afe01aed8
12 changed files with 159 additions and 113 deletions
@@ -171,7 +171,7 @@ public class BumperPreviewTests
.Handle(new RenderBumperPreviewCommand(template.Id, null), CancellationToken.None);
Assert.True(result.IsSuccess);
var spec = Specs(renderer).First();
var spec = Specs(renderer)[0];
Assert.Equal("/data/images/bg.png", spec.BackgroundFile);
// Канала нет — образцы заглушечные, но кадр всё равно собирается.
Assert.Equal("Первое шоу", spec.Lines[1].Text);
@@ -201,7 +201,7 @@ public class BumperPreviewTests
.Handle(new RenderBumperPreviewCommand(template.Id, null), CancellationToken.None);
// Жанра у образца нет — строка схлопнулась, а не оставила дыру в кадре.
var spec = Specs(renderer).First();
var spec = Specs(renderer)[0];
Assert.Single(spec.Lines);
}
}