Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ICustomSettings>(defaultValue);
Expand All @@ -37,6 +41,7 @@ export const CustomSettingsProvider = ({
customSearchHelp,
customDetailRenderer,
hideMissingMeta,
maxRelatedTasks,
children,
}: PropsWithChildren<Partial<ICustomSettings>>) => {
const stateCaptions = customStateCaptions || TaskStateCaptions;
Expand All @@ -48,6 +53,7 @@ export const CustomSettingsProvider = ({
customDetailRenderer: renderer,
customSearchHelp,
hideMissingMeta: !!hideMissingMeta,
maxRelatedTasks: maxRelatedTasks ?? defaultMaxRelatedTasks,
}}>
{children}
</CustomSettingsContext.Provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ interface RemoteTaskQueueApplicationProps {
customSearchHelp?: ReactElement;
hideMissingMeta?: boolean;
useFrontPaging?: boolean;
maxRelatedTasks?: number;
}

export const RemoteTaskQueueApplication = ({
Expand All @@ -28,12 +29,14 @@ export const RemoteTaskQueueApplication = ({
customSearchHelp,
hideMissingMeta,
useFrontPaging,
maxRelatedTasks,
}: RemoteTaskQueueApplicationProps): ReactElement => (
<CustomSettingsProvider
customStateCaptions={customStateCaptions}
customSearchHelp={customSearchHelp}
customDetailRenderer={customRenderer}
hideMissingMeta={hideMissingMeta}>
hideMissingMeta={hideMissingMeta}
maxRelatedTasks={maxRelatedTasks}>
<Routes>
<Route
path="/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import uniq from "lodash/uniq";
import { useEffect, useState, ReactElement } from "react";
import { Location, useLocation } from "react-router-dom";

import { useCustomSettings } from "../CustomSettingsContext";
import { IRtqMonitoringApi } from "../Domain/Api/RtqMonitoringApi";
import { RtqMonitoringSearchRequest } from "../Domain/Api/RtqMonitoringSearchRequest";
import { RtqMonitoringTaskModel } from "../Domain/Api/RtqMonitoringTaskModel";
Expand Down Expand Up @@ -33,6 +34,7 @@ export const TaskChainsTreeContainer = ({
const [loading, setLoading] = useState(false);
const [loaderText, setLoaderText] = useState("");
const [taskDetails, setTaskDetails] = useState<RtqMonitoringTaskModel[]>([]);
const { maxRelatedTasks } = useCustomSettings();

useEffect(() => {
const request = getRequestBySearchQuery(search);
Expand Down Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.7",
"version": "3.8",
"assemblyVersion": {
"precision": "build"
},
Expand Down
Loading