Add reset template functionality to channel management
ci / build-backend (push) Successful in 1m35s
ci / build-frontend (push) Successful in 53s
ci / tests (push) Successful in 1m36s
ci / sonar (push) Successful in 4m21s

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:
Leonid Pershin
2026-07-28 14:19:35 +03:00
parent 3908b6e722
commit 6c85db2d60
10 changed files with 268 additions and 1 deletions
@@ -16,6 +16,7 @@ import type {
GridProfileKind,
LayerApplicability,
PlanningRules,
ResetTemplateResultDto,
RestoreTemplateResultDto,
ScheduleDiffDto,
ScheduleEntryDto,
@@ -89,6 +90,16 @@ export function restoreChannelTemplate(channelId: string) {
})
}
/**
* Полный сброс: снимает сетку и удаляет будущий эфир, собранный по ней. Прошлое и идущая сейчас
* запись остаются — их нельзя вырезать из-под зрителя.
*/
export function resetChannelTemplate(channelId: string) {
return apiRequest<ResetTemplateResultDto>(`/admin/channels/${channelId}/template/reset`, {
method: 'POST',
})
}
/** Проверки сетки по правилам — считаются по шаблону, без прогона генератора. */
export function getTemplateIssues(channelId: string) {
return apiRequest<TemplateIssueDto[]>(`/admin/channels/${channelId}/template/issues`)