Implement dynamic group management features with exclusions and mode handling
Enhanced the group management system by introducing dynamic group capabilities, allowing for the exclusion of elements from dynamic groups. Updated the Group and GroupItem models to support a new GroupMode, enabling the distinction between static and dynamic groups. Implemented API endpoints for excluding elements and updated related services to handle group composition based on the selected mode. Improved the frontend to accommodate these changes, including new API functions and UI components for managing exclusions and group modes, thereby enhancing the overall user experience in group management.
This commit is contained in:
@@ -248,12 +248,17 @@ export type GroupSummaryDto = {
|
||||
unitCount: number
|
||||
totalDurationSeconds: number
|
||||
hasFilter: boolean
|
||||
mode: GroupMode
|
||||
statsComputedAt: string | null
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
/** Откуда группа берёт состав: явный список либо вычисление правилом. */
|
||||
export type GroupMode = 'Static' | 'Dynamic'
|
||||
|
||||
type GroupItemDto = {
|
||||
id: string
|
||||
/** null — элемент найден правилом динамической группы: своей строки, веса и порядка у него нет. */
|
||||
id: string | null
|
||||
elementKind: GroupElementKind
|
||||
elementId: string
|
||||
elementName: string
|
||||
@@ -264,18 +269,29 @@ type GroupItemDto = {
|
||||
audience: ShowAudience | null
|
||||
year: number | null
|
||||
posterImageId: string | null
|
||||
/** Закреплён руками в динамической группе — правило его не выбрасывает. */
|
||||
pinned: boolean
|
||||
}
|
||||
|
||||
/** Элемент, исключённый из динамической группы вручную. */
|
||||
export type GroupExcludedDto = {
|
||||
elementKind: GroupElementKind
|
||||
elementId: string
|
||||
elementName: string
|
||||
}
|
||||
|
||||
export type GroupDto = {
|
||||
id: string
|
||||
name: string
|
||||
description: string | null
|
||||
mode: GroupMode
|
||||
filter: GroupFilter | null
|
||||
itemCount: number
|
||||
unitCount: number
|
||||
totalDurationSeconds: number
|
||||
statsComputedAt: string | null
|
||||
items: GroupItemDto[]
|
||||
excluded: GroupExcludedDto[]
|
||||
}
|
||||
|
||||
/** Кандидат, найденный правилом набора. */
|
||||
|
||||
@@ -101,6 +101,21 @@ export const en = {
|
||||
found: 'Found: {{total}}, new: {{fresh}}',
|
||||
added: 'Items added: {{count}}',
|
||||
alreadyIn: 'already in group',
|
||||
mode: {
|
||||
label: 'Composition',
|
||||
Static: 'Explicit list',
|
||||
Dynamic: 'By rule',
|
||||
StaticHint: 'Items are added by hand; the rule only helps to find them.',
|
||||
DynamicHint:
|
||||
'Composition is computed by the rule on every read — new library items go on air by themselves.',
|
||||
},
|
||||
pinned: 'pinned',
|
||||
byRule: 'by rule',
|
||||
excluded: 'Excluded',
|
||||
excludeHint: 'Exclude from the composition — the rule will stop adding it back',
|
||||
restore: 'Restore',
|
||||
dynamicOrderHint:
|
||||
'Order: pinned items first (drag to arrange), then rule matches alphabetically.',
|
||||
pendingFound: 'New matches for this rule: {{count}} —',
|
||||
pendingAdd: 'Add all ({{count}})',
|
||||
elementKinds: { Show: 'Show', Collection: 'Collection' },
|
||||
|
||||
@@ -101,6 +101,21 @@ export const ru = {
|
||||
found: 'Найдено: {{total}}, новых: {{fresh}}',
|
||||
added: 'Добавлено позиций: {{count}}',
|
||||
alreadyIn: 'уже в группе',
|
||||
mode: {
|
||||
label: 'Состав',
|
||||
Static: 'Явный список',
|
||||
Dynamic: 'По правилу',
|
||||
StaticHint: 'Позиции добавляются вручную; правило только помогает их найти.',
|
||||
DynamicHint:
|
||||
'Состав считается правилом при каждом обращении — новое из библиотеки попадает в эфир само.',
|
||||
},
|
||||
pinned: 'закреплено',
|
||||
byRule: 'по правилу',
|
||||
excluded: 'Исключено',
|
||||
excludeHint: 'Исключить из состава — правило больше не будет его подставлять',
|
||||
restore: 'Вернуть',
|
||||
dynamicOrderHint:
|
||||
'Порядок: сначала закреплённое (перетаскиванием), затем найденное правилом по алфавиту.',
|
||||
pendingFound: 'Под правило группы подходит нового: {{count}} —',
|
||||
pendingAdd: 'Добавить все ({{count}})',
|
||||
elementKinds: { Show: 'Шоу', Collection: 'Коллекция' },
|
||||
|
||||
Reference in New Issue
Block a user