From db88734f8c0b7ead577d162b68f64e10c8205045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Goworko?= Date: Thu, 30 Jan 2025 16:05:21 +0100 Subject: [PATCH 1/8] FE loading changes --- designer/client/cypress/support/process.ts | 4 ++-- .../src/actions/nk/fetchVisualizationData.ts | 18 +++++++++++++----- designer/client/src/actions/nk/process.ts | 12 ++++++++++++ designer/client/src/common/ProcessUtils.ts | 6 +++++- designer/client/src/components/tips/Tips.tsx | 6 +++++- .../client/src/components/tips/ValidTips.tsx | 8 ++++++-- .../components/toolbars/creator/ToolBox.tsx | 4 ++-- .../scenarioActions/buttons/DeployButton.tsx | 11 +++++++++-- .../buttons/RunOffScheduleButton.tsx | 10 ++++++++-- designer/client/src/http/HttpService.ts | 8 ++++++++ .../client/src/reducers/selectors/graph.ts | 3 ++- .../client/src/reducers/selectors/settings.ts | 2 +- docs/Changelog.md | 2 ++ 13 files changed, 75 insertions(+), 19 deletions(-) diff --git a/designer/client/cypress/support/process.ts b/designer/client/cypress/support/process.ts index b493106f56a..f86549f0c07 100644 --- a/designer/client/cypress/support/process.ts +++ b/designer/client/cypress/support/process.ts @@ -89,14 +89,14 @@ function visitProcess(processName: string) { } function visitNewProcess(name?: string, fixture?: string, category?: string) { - cy.intercept("GET", "/api/processes/*").as("fetch"); + cy.intercept("GET", /^\/api\/processes\/[^/]+$/).as("fetch"); return cy.createTestProcess(name, fixture, category).then((processName) => { return cy.visitProcess(processName); }); } function visitNewFragment(name?: string, fixture?: string, category?: string) { - cy.intercept("GET", "/api/processes/*").as("fetch"); + cy.intercept("GET", /^\/api\/processes\/[^/]+$/).as("fetch"); return cy.createTestFragment(name, fixture, category).then((processName) => { return cy.visitProcess(processName); }); diff --git a/designer/client/src/actions/nk/fetchVisualizationData.ts b/designer/client/src/actions/nk/fetchVisualizationData.ts index c73139b8d16..f39d4ed75c0 100644 --- a/designer/client/src/actions/nk/fetchVisualizationData.ts +++ b/designer/client/src/actions/nk/fetchVisualizationData.ts @@ -1,17 +1,25 @@ import { ThunkAction } from "../reduxTypes"; -import { displayCurrentProcessVersion } from "./process"; +import { displayTestCapabilities, fetchStickyNotesForScenario, fetchValidatedProcess } from "./process"; import { fetchProcessDefinition } from "./processDefinitionData"; import { loadProcessToolbarsConfiguration } from "./loadProcessToolbarsConfiguration"; import { ProcessName } from "../../components/Process/types"; +import HttpService from "../../http/HttpService"; export function fetchVisualizationData(processName: ProcessName, onSuccess: () => void, onError: (error) => void): ThunkAction { return async (dispatch) => { try { - const scenario = await dispatch(displayCurrentProcessVersion(processName)); + dispatch({ type: "PROCESS_FETCH" }); + const response = await HttpService.fetchLatestProcessDetailsWithoutValidation(processName); + const scenario = response.data; const { name, isFragment, processingType } = scenario; - await dispatch(loadProcessToolbarsConfiguration(name)); - const processDefinitionData = await dispatch(fetchProcessDefinition(processingType, isFragment)); - dispatch({ type: "CORRECT_INVALID_SCENARIO", processDefinitionData }); + await dispatch(fetchProcessDefinition(processingType, isFragment)).then((processDefinitionData) => { + dispatch({ type: "DISPLAY_PROCESS", scenario: response.data }); + dispatch({ type: "CORRECT_INVALID_SCENARIO", processDefinitionData }); + }); + dispatch(loadProcessToolbarsConfiguration(processName)); + dispatch(displayTestCapabilities(processName, response.data.scenarioGraph)); + dispatch(fetchStickyNotesForScenario(processName, response.data.processVersionId)); + dispatch(fetchValidatedProcess(name)); onSuccess(); return scenario; } catch (error) { diff --git a/designer/client/src/actions/nk/process.ts b/designer/client/src/actions/nk/process.ts index b00dfffe989..861bb60d136 100644 --- a/designer/client/src/actions/nk/process.ts +++ b/designer/client/src/actions/nk/process.ts @@ -30,6 +30,18 @@ export function fetchProcessToDisplay(processName: ProcessName, versionId?: Proc }; } +export function fetchValidatedProcess(processName: ProcessName, versionId?: ProcessVersionId): ThunkAction> { + return (dispatch) => { + return HttpService.fetchProcessDetails(processName, versionId).then((response) => { + dispatch({ + type: "DISPLAY_PROCESS", + scenario: response.data, + }); + return response.data; + }); + }; +} + export function loadProcessState(processName: ProcessName, processVersionId: number): ThunkAction { return (dispatch) => HttpService.fetchProcessState(processName, processVersionId).then(({ data }) => diff --git a/designer/client/src/common/ProcessUtils.ts b/designer/client/src/common/ProcessUtils.ts index 2cbbe187297..a831830b333 100644 --- a/designer/client/src/common/ProcessUtils.ts +++ b/designer/client/src/common/ProcessUtils.ts @@ -48,9 +48,13 @@ class ProcessUtils { return isEmpty(scenario) ? false : !isEmpty(scenario.scenarioGraph.nodes); }; + isValidationResultPresent = (scenario: Scenario) => { + return !!scenario.validationResult; + }; + //fixme maybe return hasErrors flag from backend? hasNeitherErrorsNorWarnings = (scenario: Scenario) => { - return this.hasNoErrors(scenario) && this.hasNoWarnings(scenario); + return !!scenario.validationResult && this.hasNoErrors(scenario) && this.hasNoWarnings(scenario); }; extractInvalidNodes = (invalidNodes: Pick) => { diff --git a/designer/client/src/components/tips/Tips.tsx b/designer/client/src/components/tips/Tips.tsx index 761003a66ab..331ec980a22 100644 --- a/designer/client/src/components/tips/Tips.tsx +++ b/designer/client/src/components/tips/Tips.tsx @@ -39,7 +39,11 @@ export default function Tips(props: ToolbarPanelProps): JSX.Element { renderThumbVertical={(props) =>
} hideTracksWhenNotNeeded={true} > - + {!ProcessUtils.hasNoErrors(scenario) && } {!ProcessUtils.hasNoWarnings(scenario) && ( + {loading && ( + + )} {hasNeitherErrorsNorWarnings && ( )} diff --git a/designer/client/src/components/toolbars/creator/ToolBox.tsx b/designer/client/src/components/toolbars/creator/ToolBox.tsx index f7217a53d02..a13981daecc 100644 --- a/designer/client/src/components/toolbars/creator/ToolBox.tsx +++ b/designer/client/src/components/toolbars/creator/ToolBox.tsx @@ -119,9 +119,9 @@ export default function ToolBox(props: ToolBoxProps): JSX.Element { const pristine = useSelector(isPristine); const { t } = useTranslation(); - const componentGroups: ComponentGroup[] = useMemo(() => processDefinitionData.componentGroups, [processDefinitionData]); + const componentGroups: ComponentGroup[] = useMemo(() => processDefinitionData.componentGroups ?? [], [processDefinitionData]); const filters = useMemo(() => props.filter?.toLowerCase().split(/\s/).filter(Boolean), [props.filter]); - const stickyNoteToolGroup = useMemo(() => stickyNoteComponentGroup(pristine), [pristine, props, t]); + const stickyNoteToolGroup = useMemo(() => stickyNoteComponentGroup(pristine), [pristine]); const groups = useMemo(() => { const allComponentGroups = stickyNotesSettings.enabled ? concat(componentGroups, stickyNoteToolGroup) : componentGroups; return allComponentGroups.map(filterComponentsByLabel(filters)).filter((g) => g.components.length > 0); diff --git a/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx b/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx index a2868e533c4..df43ddc856d 100644 --- a/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx +++ b/designer/client/src/components/toolbars/scenarioActions/buttons/DeployButton.tsx @@ -4,7 +4,13 @@ import { useDispatch, useSelector } from "react-redux"; import { disableToolTipsHighlight, enableToolTipsHighlight, loadProcessState } from "../../../../actions/nk"; import Icon from "../../../../assets/img/toolbarButtons/deploy.svg"; import HttpService from "../../../../http/HttpService"; -import { getProcessName, hasError, isDeployPossible, isSaveDisabled } from "../../../../reducers/selectors/graph"; +import { + getProcessName, + hasError, + isDeployPossible, + isSaveDisabled, + isValidationResultPresent, +} from "../../../../reducers/selectors/graph"; import { getCapabilities } from "../../../../reducers/selectors/other"; import { useWindows } from "../../../../windowManager"; import { WindowKind } from "../../../../windowManager"; @@ -19,11 +25,12 @@ export default function DeployButton(props: ToolbarButtonProps) { const deployPossible = useSelector(isDeployPossible); const saveDisabled = useSelector(isSaveDisabled); const hasErrors = useSelector(hasError); + const validationResultPresent = useSelector(isValidationResultPresent); const processName = useSelector(getProcessName); const capabilities = useSelector(getCapabilities); const { disabled, type } = props; - const available = !disabled && deployPossible && capabilities.deploy; + const available = validationResultPresent && !disabled && deployPossible && capabilities.deploy; const { t } = useTranslation(); const deployToolTip = !capabilities.deploy ? t("panels.actions.deploy.tooltips.forbidden", "Deploy forbidden for current scenario.") diff --git a/designer/client/src/components/toolbars/scenarioActions/buttons/RunOffScheduleButton.tsx b/designer/client/src/components/toolbars/scenarioActions/buttons/RunOffScheduleButton.tsx index 4911d20d32a..e316456fc90 100644 --- a/designer/client/src/components/toolbars/scenarioActions/buttons/RunOffScheduleButton.tsx +++ b/designer/client/src/components/toolbars/scenarioActions/buttons/RunOffScheduleButton.tsx @@ -4,7 +4,12 @@ import { useDispatch, useSelector } from "react-redux"; import { loadProcessState } from "../../../../actions/nk"; import Icon from "../../../../assets/img/toolbarButtons/run-off-schedule.svg"; import HttpService from "../../../../http/HttpService"; -import { getProcessName, isRunOffSchedulePossible, isRunOffScheduleVisible } from "../../../../reducers/selectors/graph"; +import { + getProcessName, + isRunOffSchedulePossible, + isRunOffScheduleVisible, + isValidationResultPresent, +} from "../../../../reducers/selectors/graph"; import { getCapabilities } from "../../../../reducers/selectors/other"; import { useWindows, WindowKind } from "../../../../windowManager"; import { ToggleProcessActionModalData } from "../../../modals/DeployProcessDialog"; @@ -21,11 +26,12 @@ export default function RunOffScheduleButton(props: ToolbarButtonProps) { const dispatch = useDispatch(); const { disabled, type } = props; const scenarioState = useSelector((state: RootState) => getProcessState(state)); + const validationResultPresent = useSelector(isValidationResultPresent); const isVisible = useSelector(isRunOffScheduleVisible); const isPossible = useSelector(isRunOffSchedulePossible); const processName = useSelector(getProcessName); const capabilities = useSelector(getCapabilities); - const available = !disabled && isPossible && capabilities.deploy; + const available = validationResultPresent && !disabled && isPossible && capabilities.deploy; const { open } = useWindows(); const action = (name: ProcessName, versionId: ProcessVersionId, comment: string) => diff --git a/designer/client/src/http/HttpService.ts b/designer/client/src/http/HttpService.ts index 3759f6fb9b4..07af8f7b63c 100644 --- a/designer/client/src/http/HttpService.ts +++ b/designer/client/src/http/HttpService.ts @@ -283,6 +283,14 @@ class HttpService { return api.get(url); } + fetchLatestProcessDetailsWithoutValidation(processName: ProcessName, versionId?: ProcessVersionId): Promise> { + const id = encodeURIComponent(processName); + const url = versionId + ? `/processes/${id}/${versionId}?skipValidateAndResolve=true` + : `/processes/${id}?skipValidateAndResolve=true`; + return api.get(url); + } + fetchProcessesStates() { return api .get("/processes/status") diff --git a/designer/client/src/reducers/selectors/graph.ts b/designer/client/src/reducers/selectors/graph.ts index 473f3251439..a9660e44e84 100644 --- a/designer/client/src/reducers/selectors/graph.ts +++ b/designer/client/src/reducers/selectors/graph.ts @@ -29,6 +29,7 @@ export const isLatestProcessVersion = createSelector(getScenario, (d) => d?.isLa export const isFragment = createSelector(getScenario, (p) => p?.isFragment); export const isArchived = createSelector(getScenario, (p) => p?.isArchived); export const isPristine = (state: RootState): boolean => ProcessUtils.nothingToSave(state) && !isProcessRenamed(state); +export const isValidationResultPresent = createSelector(getScenario, (p) => ProcessUtils.isValidationResultPresent(p)); export const hasError = createSelector(getScenario, (p) => !ProcessUtils.hasNoErrors(p)); export const hasWarnings = createSelector(getScenario, (p) => !ProcessUtils.hasNoWarnings(p)); export const hasPropertiesErrors = createSelector(getScenario, (p) => !ProcessUtils.hasNoPropertiesErrors(p)); @@ -78,7 +79,7 @@ export const getTestResults = createSelector(getGraph, (g) => g.testResults); export const getProcessCountsRefresh = createSelector(getGraph, (g) => g.processCountsRefresh || null); export const getProcessCounts = createSelector(getGraph, (g): ProcessCounts => g.processCounts || ({} as ProcessCounts)); export const getStickyNotes = createSelector([getGraph, getStickyNotesSettings], (g, settings) => - settings.enabled ? g.stickyNotes || ([] as StickyNote[]) : ([] as StickyNote[]), + (settings ? settings.enabled : false) ? g.stickyNotes || ([] as StickyNote[]) : ([] as StickyNote[]), ); export const getShowRunProcessDetails = createSelector( [getTestResults, getProcessCounts], diff --git a/designer/client/src/reducers/selectors/settings.ts b/designer/client/src/reducers/selectors/settings.ts index 8177dc4d240..88e6e060c51 100644 --- a/designer/client/src/reducers/selectors/settings.ts +++ b/designer/client/src/reducers/selectors/settings.ts @@ -23,7 +23,7 @@ export const getProcessDefinitionData = createDeepEqualSelector( getSettings, (s) => s.processDefinitionData || ({} as ProcessDefinitionData), ); -export const getComponentGroups = createSelector(getProcessDefinitionData, (p) => p.componentGroups || ({} as ComponentGroup[])); +export const getComponentGroups = createSelector(getProcessDefinitionData, (p) => p.componentGroups || []); export const getCategories = createSelector(getLoggedUser, (u) => u.categories || []); export const getWritableCategories = createSelector(getLoggedUser, getCategories, (user, categories) => categories.filter((c) => user.canWrite(c)), diff --git a/docs/Changelog.md b/docs/Changelog.md index b3f50974193..849176c1744 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -74,6 +74,8 @@ * Introduced some default values: * For all - default `windowLength` is 1 hour * For `aggregate-session` - default `endSessionCondition` is now false +* Improved scenario visualization loading time + * [#7453](https://github.com/TouK/nussknacker/pull/7453) optimized and rearranged API calls and GUI loading order ## 1.18 From f285f3460f655685d14b00621b359bf60a745d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Goworko?= Date: Thu, 6 Feb 2025 19:21:49 +0100 Subject: [PATCH 2/8] fetch only validation result instead of full graph with validation --- .../client/src/actions/nk/fetchVisualizationData.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/designer/client/src/actions/nk/fetchVisualizationData.ts b/designer/client/src/actions/nk/fetchVisualizationData.ts index f39d4ed75c0..a741bda0a2e 100644 --- a/designer/client/src/actions/nk/fetchVisualizationData.ts +++ b/designer/client/src/actions/nk/fetchVisualizationData.ts @@ -13,13 +13,15 @@ export function fetchVisualizationData(processName: ProcessName, onSuccess: () = const scenario = response.data; const { name, isFragment, processingType } = scenario; await dispatch(fetchProcessDefinition(processingType, isFragment)).then((processDefinitionData) => { - dispatch({ type: "DISPLAY_PROCESS", scenario: response.data }); + dispatch({ type: "DISPLAY_PROCESS", scenario: scenario }); dispatch({ type: "CORRECT_INVALID_SCENARIO", processDefinitionData }); }); - dispatch(loadProcessToolbarsConfiguration(processName)); - dispatch(displayTestCapabilities(processName, response.data.scenarioGraph)); - dispatch(fetchStickyNotesForScenario(processName, response.data.processVersionId)); - dispatch(fetchValidatedProcess(name)); + dispatch(loadProcessToolbarsConfiguration(name)); + dispatch(displayTestCapabilities(name, scenario.scenarioGraph)); + dispatch(fetchStickyNotesForScenario(name, scenario.processVersionId)); + HttpService.validateProcess(name, name, scenario.scenarioGraph).then(({ data }) => + dispatch({ type: "VALIDATION_RESULT", validationResult: data }), + ); onSuccess(); return scenario; } catch (error) { From ea28a85acc57013c1bbc088951305a931cf4c098 Mon Sep 17 00:00:00 2001 From: mgoworko <37329559+mgoworko@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:11:02 +0100 Subject: [PATCH 3/8] Update designer/client/src/reducers/selectors/graph.ts Co-authored-by: Dawid Poliszak --- designer/client/src/reducers/selectors/graph.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/client/src/reducers/selectors/graph.ts b/designer/client/src/reducers/selectors/graph.ts index a9660e44e84..360d62dc7d8 100644 --- a/designer/client/src/reducers/selectors/graph.ts +++ b/designer/client/src/reducers/selectors/graph.ts @@ -79,7 +79,7 @@ export const getTestResults = createSelector(getGraph, (g) => g.testResults); export const getProcessCountsRefresh = createSelector(getGraph, (g) => g.processCountsRefresh || null); export const getProcessCounts = createSelector(getGraph, (g): ProcessCounts => g.processCounts || ({} as ProcessCounts)); export const getStickyNotes = createSelector([getGraph, getStickyNotesSettings], (g, settings) => - (settings ? settings.enabled : false) ? g.stickyNotes || ([] as StickyNote[]) : ([] as StickyNote[]), + (settings?.enabled ? g.stickyNotes : []) as StickyNote[], ); export const getShowRunProcessDetails = createSelector( [getTestResults, getProcessCounts], From 6f6fa5298665d718e11f9e67f7970e7ede30cb3c Mon Sep 17 00:00:00 2001 From: mgoworko <37329559+mgoworko@users.noreply.github.com> Date: Fri, 7 Feb 2025 13:11:12 +0100 Subject: [PATCH 4/8] Update designer/client/src/common/ProcessUtils.ts Co-authored-by: Dawid Poliszak --- designer/client/src/common/ProcessUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer/client/src/common/ProcessUtils.ts b/designer/client/src/common/ProcessUtils.ts index a831830b333..f051b8b9f64 100644 --- a/designer/client/src/common/ProcessUtils.ts +++ b/designer/client/src/common/ProcessUtils.ts @@ -54,7 +54,7 @@ class ProcessUtils { //fixme maybe return hasErrors flag from backend? hasNeitherErrorsNorWarnings = (scenario: Scenario) => { - return !!scenario.validationResult && this.hasNoErrors(scenario) && this.hasNoWarnings(scenario); + return this.isValidationResultPresent(scenario) && this.hasNoErrors(scenario) && this.hasNoWarnings(scenario); }; extractInvalidNodes = (invalidNodes: Pick) => { From 4ceec9d5935ae764143e55dd59bd580392537187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Goworko?= Date: Fri, 7 Feb 2025 13:16:41 +0100 Subject: [PATCH 5/8] qs --- .../client/src/actions/nk/fetchVisualizationData.ts | 2 +- designer/client/src/actions/nk/process.ts | 12 ------------ designer/client/src/common/ProcessUtils.ts | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/designer/client/src/actions/nk/fetchVisualizationData.ts b/designer/client/src/actions/nk/fetchVisualizationData.ts index a741bda0a2e..24994e36300 100644 --- a/designer/client/src/actions/nk/fetchVisualizationData.ts +++ b/designer/client/src/actions/nk/fetchVisualizationData.ts @@ -1,5 +1,5 @@ import { ThunkAction } from "../reduxTypes"; -import { displayTestCapabilities, fetchStickyNotesForScenario, fetchValidatedProcess } from "./process"; +import { displayTestCapabilities, fetchStickyNotesForScenario } from "./process"; import { fetchProcessDefinition } from "./processDefinitionData"; import { loadProcessToolbarsConfiguration } from "./loadProcessToolbarsConfiguration"; import { ProcessName } from "../../components/Process/types"; diff --git a/designer/client/src/actions/nk/process.ts b/designer/client/src/actions/nk/process.ts index 861bb60d136..b00dfffe989 100644 --- a/designer/client/src/actions/nk/process.ts +++ b/designer/client/src/actions/nk/process.ts @@ -30,18 +30,6 @@ export function fetchProcessToDisplay(processName: ProcessName, versionId?: Proc }; } -export function fetchValidatedProcess(processName: ProcessName, versionId?: ProcessVersionId): ThunkAction> { - return (dispatch) => { - return HttpService.fetchProcessDetails(processName, versionId).then((response) => { - dispatch({ - type: "DISPLAY_PROCESS", - scenario: response.data, - }); - return response.data; - }); - }; -} - export function loadProcessState(processName: ProcessName, processVersionId: number): ThunkAction { return (dispatch) => HttpService.fetchProcessState(processName, processVersionId).then(({ data }) => diff --git a/designer/client/src/common/ProcessUtils.ts b/designer/client/src/common/ProcessUtils.ts index f051b8b9f64..c1e5770650f 100644 --- a/designer/client/src/common/ProcessUtils.ts +++ b/designer/client/src/common/ProcessUtils.ts @@ -49,7 +49,7 @@ class ProcessUtils { }; isValidationResultPresent = (scenario: Scenario) => { - return !!scenario.validationResult; + return Boolean(scenario.validationResult); }; //fixme maybe return hasErrors flag from backend? From 1f6b417601c576f29f68bb59cb52e265bdf04287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Goworko?= Date: Fri, 7 Feb 2025 16:19:25 +0100 Subject: [PATCH 6/8] fix attempt --- designer/client/cypress/support/process.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer/client/cypress/support/process.ts b/designer/client/cypress/support/process.ts index f86549f0c07..b8ac6530e0b 100644 --- a/designer/client/cypress/support/process.ts +++ b/designer/client/cypress/support/process.ts @@ -89,14 +89,14 @@ function visitProcess(processName: string) { } function visitNewProcess(name?: string, fixture?: string, category?: string) { - cy.intercept("GET", /^\/api\/processes\/[^/]+$/).as("fetch"); + cy.intercept("GET", "/api/processValidation/*").as("fetch"); return cy.createTestProcess(name, fixture, category).then((processName) => { return cy.visitProcess(processName); }); } function visitNewFragment(name?: string, fixture?: string, category?: string) { - cy.intercept("GET", /^\/api\/processes\/[^/]+$/).as("fetch"); + cy.intercept("GET", "/api/processValidation/*").as("fetch"); return cy.createTestFragment(name, fixture, category).then((processName) => { return cy.visitProcess(processName); }); From 1598212b34eb16c1256e16eb9303b216415c4703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Goworko?= Date: Fri, 7 Feb 2025 17:06:15 +0100 Subject: [PATCH 7/8] review changes --- designer/client/src/components/tips/ValidTips.tsx | 7 ++++--- designer/client/src/reducers/selectors/graph.ts | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/designer/client/src/components/tips/ValidTips.tsx b/designer/client/src/components/tips/ValidTips.tsx index d876b9d43fa..ff4775876f1 100644 --- a/designer/client/src/components/tips/ValidTips.tsx +++ b/designer/client/src/components/tips/ValidTips.tsx @@ -1,9 +1,8 @@ import React from "react"; import TestingMode from "../../assets/img/icons/testingMode.svg"; import CheckCircleIcon from "@mui/icons-material/CheckCircle"; -import HourglassEmptyIcon from "@mui/icons-material/HourglassEmpty"; import ValidTip from "./ValidTip"; -import { useTheme } from "@mui/material"; +import { Box, CircularProgress, useTheme } from "@mui/material"; export default function ValidTips(props: { loading: boolean; hasNeitherErrorsNorWarnings?: boolean; testing?: boolean }): JSX.Element { const { loading, hasNeitherErrorsNorWarnings, testing } = props; @@ -12,7 +11,9 @@ export default function ValidTips(props: { loading: boolean; hasNeitherErrorsNor return ( {loading && ( - + + + )} {hasNeitherErrorsNorWarnings && ( diff --git a/designer/client/src/reducers/selectors/graph.ts b/designer/client/src/reducers/selectors/graph.ts index 360d62dc7d8..484fa6541ee 100644 --- a/designer/client/src/reducers/selectors/graph.ts +++ b/designer/client/src/reducers/selectors/graph.ts @@ -78,8 +78,9 @@ export const getTestParameters = createSelector(getGraph, (g) => g.testFormParam export const getTestResults = createSelector(getGraph, (g) => g.testResults); export const getProcessCountsRefresh = createSelector(getGraph, (g) => g.processCountsRefresh || null); export const getProcessCounts = createSelector(getGraph, (g): ProcessCounts => g.processCounts || ({} as ProcessCounts)); -export const getStickyNotes = createSelector([getGraph, getStickyNotesSettings], (g, settings) => - (settings?.enabled ? g.stickyNotes : []) as StickyNote[], +export const getStickyNotes = createSelector( + [getGraph, getStickyNotesSettings], + (g, settings) => (settings?.enabled ? g.stickyNotes || ([] as StickyNote[]) : []) as StickyNote[], ); export const getShowRunProcessDetails = createSelector( [getTestResults, getProcessCounts], From f620aa67a095aca47bb2f029a6ad171f51966b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Goworko?= Date: Fri, 7 Feb 2025 17:31:06 +0100 Subject: [PATCH 8/8] review changes --- designer/client/cypress/support/process.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer/client/cypress/support/process.ts b/designer/client/cypress/support/process.ts index b8ac6530e0b..aca566a4a44 100644 --- a/designer/client/cypress/support/process.ts +++ b/designer/client/cypress/support/process.ts @@ -89,14 +89,14 @@ function visitProcess(processName: string) { } function visitNewProcess(name?: string, fixture?: string, category?: string) { - cy.intercept("GET", "/api/processValidation/*").as("fetch"); + cy.intercept("POST", "/api/processValidation/*").as("fetch"); return cy.createTestProcess(name, fixture, category).then((processName) => { return cy.visitProcess(processName); }); } function visitNewFragment(name?: string, fixture?: string, category?: string) { - cy.intercept("GET", "/api/processValidation/*").as("fetch"); + cy.intercept("POST", "/api/processValidation/*").as("fetch"); return cy.createTestFragment(name, fixture, category).then((processName) => { return cy.visitProcess(processName); });