From 44f641a076cf45acf2c58d03d5bee45d270d0ce4 Mon Sep 17 00:00:00 2001 From: Artem Araptanov Date: Tue, 9 Jun 2026 22:11:49 +0500 Subject: [PATCH] DDCORE-13657: maxRelatedTasks --- CHANGELOG.md | 3 +++ .../src/CustomSettingsContext.tsx | 6 ++++++ .../src/RemoteTaskQueueApplication.tsx | 5 ++++- .../src/containers/TaskChainsTreeContainer.tsx | 6 ++++-- version.json | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 184e7dc2..bc9558f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## v3.8.0 - 2026.06.16 +- add prop for configurable max related tasks limit in task chains tree + ## v3.7.0 - 2026.06.08 - update colors to 2.0 according to edi-ui diff --git a/cassandra-distributed-task-queue-ui/src/CustomSettingsContext.tsx b/cassandra-distributed-task-queue-ui/src/CustomSettingsContext.tsx index f11c3cf0..6d760835 100644 --- a/cassandra-distributed-task-queue-ui/src/CustomSettingsContext.tsx +++ b/cassandra-distributed-task-queue-ui/src/CustomSettingsContext.tsx @@ -22,12 +22,16 @@ export interface ICustomSettings { customStateCaptions: TaskStateDict; hideMissingMeta: boolean; customSearchHelp?: ReactElement; + maxRelatedTasks: number; } +const defaultMaxRelatedTasks = 100; + const defaultValue: ICustomSettings = { customStateCaptions: TaskStateCaptions, customDetailRenderer: new CustomRenderer(), hideMissingMeta: false, + maxRelatedTasks: defaultMaxRelatedTasks, }; const CustomSettingsContext = createContext(defaultValue); @@ -37,6 +41,7 @@ export const CustomSettingsProvider = ({ customSearchHelp, customDetailRenderer, hideMissingMeta, + maxRelatedTasks, children, }: PropsWithChildren>) => { const stateCaptions = customStateCaptions || TaskStateCaptions; @@ -48,6 +53,7 @@ export const CustomSettingsProvider = ({ customDetailRenderer: renderer, customSearchHelp, hideMissingMeta: !!hideMissingMeta, + maxRelatedTasks: maxRelatedTasks ?? defaultMaxRelatedTasks, }}> {children} diff --git a/cassandra-distributed-task-queue-ui/src/RemoteTaskQueueApplication.tsx b/cassandra-distributed-task-queue-ui/src/RemoteTaskQueueApplication.tsx index a7338025..9769d4c9 100644 --- a/cassandra-distributed-task-queue-ui/src/RemoteTaskQueueApplication.tsx +++ b/cassandra-distributed-task-queue-ui/src/RemoteTaskQueueApplication.tsx @@ -17,6 +17,7 @@ interface RemoteTaskQueueApplicationProps { customSearchHelp?: ReactElement; hideMissingMeta?: boolean; useFrontPaging?: boolean; + maxRelatedTasks?: number; } export const RemoteTaskQueueApplication = ({ @@ -28,12 +29,14 @@ export const RemoteTaskQueueApplication = ({ customSearchHelp, hideMissingMeta, useFrontPaging, + maxRelatedTasks, }: RemoteTaskQueueApplicationProps): ReactElement => ( + hideMissingMeta={hideMissingMeta} + maxRelatedTasks={maxRelatedTasks}> ([]); + const { maxRelatedTasks } = useCustomSettings(); useEffect(() => { const request = getRequestBySearchQuery(search); @@ -90,8 +92,8 @@ export const TaskChainsTreeContainer = ({ let taskIdsToLoad = results.taskMetas.map(x => x.id); while (taskIdsToLoad.length > 0) { iterationCount++; - if (taskIdsToLoad.length > 100) { - throw new Error("Количство задач в дереве превысило допустимый предел: 100 зачад"); + if (taskIdsToLoad.length > maxRelatedTasks) { + throw new Error(`Количество задач в дереве превысило допустимый предел: ${maxRelatedTasks} задач`); } const loadedTaskDetails = await Promise.all( taskIdsToLoad.map(id => rtqMonitoringApi.getTaskDetails(id)) diff --git a/version.json b/version.json index f8de1dcf..097afa40 100644 --- a/version.json +++ b/version.json @@ -1,5 +1,5 @@ { - "version": "3.7", + "version": "3.8", "assemblyVersion": { "precision": "build" },