Implemented a new endpoint for restoring templates to their last applied state, allowing users to revert changes made since the last application. Updated the ScheduleTemplate class to include a snapshot of the last applied state, enabling rollback capabilities. Enhanced the frontend with a restore button in the ChannelDetail component, providing users with a confirmation prompt before executing the restore action. Localization updates were made to support new UI strings in both English and Russian, improving the overall user experience in template management.
77 lines
2.8 KiB
C#
77 lines
2.8 KiB
C#
using TeleWave.Application.Common.Models;
|
|
|
|
namespace TeleWave.Application.Programming.Templates;
|
|
|
|
public static class TemplateErrors
|
|
{
|
|
public static readonly Error NotFound = Error.NotFound(
|
|
"Templates.NotFound",
|
|
"Шаблон сетки не найден."
|
|
);
|
|
|
|
public static readonly Error LayerNotFound = Error.NotFound(
|
|
"Templates.LayerNotFound",
|
|
"Слой сетки не найден."
|
|
);
|
|
|
|
public static readonly Error SlotNotFound = Error.NotFound(
|
|
"Templates.SlotNotFound",
|
|
"Слот не найден."
|
|
);
|
|
|
|
public static readonly Error BackgroundLayerCannotBeDeleted = Error.Validation(
|
|
"Templates.BackgroundLayerCannotBeDeleted",
|
|
"Фоновый слой удалить нельзя — без него в сетке появятся дыры."
|
|
);
|
|
|
|
public static readonly Error SlotsOverlap = Error.Conflict(
|
|
"Templates.SlotsOverlap",
|
|
"Слоты одного слоя пересекаются по времени."
|
|
);
|
|
|
|
public static readonly Error GroupRequired = Error.Validation(
|
|
"Templates.GroupRequired",
|
|
"Слоту с контентом нужна группа."
|
|
);
|
|
|
|
public static readonly Error GroupNotFound = Error.NotFound(
|
|
"Templates.GroupNotFound",
|
|
"Группа не найдена."
|
|
);
|
|
|
|
public static readonly Error JunctionNotFound = Error.NotFound(
|
|
"Templates.JunctionNotFound",
|
|
"Шаблон стыка не найден."
|
|
);
|
|
|
|
public static readonly Error JunctionElementNotFound = Error.NotFound(
|
|
"Templates.JunctionElementNotFound",
|
|
"Врезка не найдена."
|
|
);
|
|
|
|
public static readonly Error JunctionInUse = Error.Conflict(
|
|
"Templates.JunctionInUse",
|
|
"Стык используется слотами — сначала отвяжите его."
|
|
);
|
|
|
|
public static readonly Error JunctionGroupRequired = Error.Validation(
|
|
"Templates.JunctionGroupRequired",
|
|
"Врезке нужна группа, откуда брать ролики."
|
|
);
|
|
|
|
public static readonly Error NothingToRestore = Error.Validation(
|
|
"Templates.NothingToRestore",
|
|
"Откатывать не к чему: сетка ещё ни разу не применялась."
|
|
);
|
|
|
|
public static readonly Error NoGroupsToGenerate = Error.Validation(
|
|
"Templates.NoGroupsToGenerate",
|
|
"Собирать сетку не из чего: нет ни одной группы с готовым медиа."
|
|
);
|
|
|
|
public static readonly Error RepeatSourceRequired = Error.Validation(
|
|
"Templates.RepeatSourceRequired",
|
|
"Слоту-повтору нужно указать, что повторять."
|
|
);
|
|
}
|