Add reset template functionality to channel management
Implemented a new endpoint for resetting the channel template, which clears the grid and removes future scheduled entries while preserving past and current recordings. Updated the frontend to include a reset button in the channel management interface, along with corresponding localization strings in English and Russian. Enhanced integration tests to verify the reset functionality, ensuring that the expected number of slots, layers, and entries are accurately reported after the reset operation.
This commit is contained in:
@@ -11,6 +11,7 @@ using TeleWave.Application.Programming.Templates.DeleteSlot;
|
||||
using TeleWave.Application.Programming.Templates.Generate;
|
||||
using TeleWave.Application.Programming.Templates.GetTemplate;
|
||||
using TeleWave.Application.Programming.Templates.Layers;
|
||||
using TeleWave.Application.Programming.Templates.Reset;
|
||||
using TeleWave.Application.Programming.Templates.Restore;
|
||||
using TeleWave.Application.Programming.Templates.Transfer;
|
||||
using TeleWave.Application.Programming.Templates.UpdateSlot;
|
||||
@@ -50,6 +51,10 @@ public static class TemplateEndpoints
|
||||
admin
|
||||
.MapPost("/channels/{channelId:guid}/template/restore", RestoreTemplate)
|
||||
.Produces<RestoreTemplateResultDto>();
|
||||
// Сброс сетки вместе с собранным по ней будущим эфиром. Прошлое и идущая запись остаются.
|
||||
admin
|
||||
.MapPost("/channels/{channelId:guid}/template/reset", ResetTemplate)
|
||||
.Produces<ResetTemplateResultDto>();
|
||||
// Предпросмотр — тот же генератор, но без записи и без продвижения курсоров.
|
||||
admin
|
||||
.MapGet("/channels/{channelId:guid}/template/preview", PreviewTemplate)
|
||||
@@ -165,6 +170,16 @@ public static class TemplateEndpoints
|
||||
return result.ToHttpResult();
|
||||
}
|
||||
|
||||
private static async Task<IResult> ResetTemplate(
|
||||
Guid channelId,
|
||||
ISender sender,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
var result = await sender.Send(new ResetTemplateCommand(channelId), cancellationToken);
|
||||
return result.ToHttpResult();
|
||||
}
|
||||
|
||||
private static async Task<IResult> PreviewTemplate(
|
||||
Guid channelId,
|
||||
ISender sender,
|
||||
|
||||
Reference in New Issue
Block a user