Add grid auto-build functionality with profile management and preview capabilities
ci / build-backend (push) Successful in 2m40s
ci / build-frontend (push) Successful in 1m14s
ci / tests (push) Successful in 2m45s
ci / sonar (push) Successful in 7m4s

Implemented new API endpoints and frontend components for grid auto-building based on predefined profiles. Added functionality to list grid profiles, preview generated grids, and generate grids with specified parameters. Enhanced the TemplateEndpoints and related services to support these features, improving the user experience for channel scheduling. Localization updates were made to accommodate new features in both English and Russian.
This commit is contained in:
Leonid Pershin
2026-07-27 08:08:56 +03:00
parent 6fe6404e61
commit bef029b858
33 changed files with 2623 additions and 44 deletions
@@ -9,6 +9,11 @@ import type {
CopyTemplateResultDto,
CreatedIdResponse,
EntryTraceDto,
GenerateGridResultDto,
GridGenerationMode,
GridPlanDto,
GridProfileDto,
GridProfileKind,
JunctionAmountMode,
JunctionConditions,
JunctionElementKind,
@@ -89,6 +94,31 @@ export function getApplyDiff(channelId: string) {
return apiRequest<ScheduleDiffDto>(`/admin/channels/${channelId}/template/diff`)
}
/** Каталог профилей автосборки: имя, на что похоже и для какой библиотеки годится. */
export function listGridProfiles() {
return apiRequest<GridProfileDto[]>('/admin/grid-profiles')
}
/** План автосборки: что будет создано и что снесено. Считается тем же кодом, что и сама сборка. */
export function previewGrid(channelId: string, profile: GridProfileKind, mode: GridGenerationMode) {
const query = new URLSearchParams({ profile, mode })
return apiRequest<GridPlanDto>(
`/admin/channels/${channelId}/template/grid-plan?${query.toString()}`,
)
}
/** Собирает сетку по профилю. План пересчитывается на сервере — с клиента едут только опции. */
export function generateGrid(
channelId: string,
profile: GridProfileKind,
mode: GridGenerationMode,
) {
return apiRequest<GenerateGridResultDto>(`/admin/channels/${channelId}/template/generate`, {
method: 'POST',
body: { profile, mode },
})
}
/** Копия сетки на другой канал: слои, слоты, стыки и правила. Группы общие и не копируются. */
export function copyTemplateTo(channelId: string, targetChannelId: string) {
return apiRequest<CopyTemplateResultDto>(