From 4fc4fdfaf720739594fb9ea79b3a8aaaf2ec8551 Mon Sep 17 00:00:00 2001 From: Martin Wygas Date: Tue, 11 Nov 2025 17:44:21 +0100 Subject: [PATCH 1/2] Fix workflow parameters in scheduled events --- .../EventDetailsWorkflowSchedulingTab.tsx | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowSchedulingTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowSchedulingTab.tsx index 20dad74e06..fcb4083b70 100644 --- a/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowSchedulingTab.tsx +++ b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowSchedulingTab.tsx @@ -65,17 +65,38 @@ const EventDetailsWorkflowSchedulingTab = ({ return true; }; - const setInitialValues = () => { - let initialConfig = undefined; + const extractDefaultValuesFromWorkflowDefinition = (workflowId: string) => { + const defaultValues: Record = {}; + const workflowDefinition = workflowDefinitions.find(def => def.id === workflowId); + if (workflowDefinition) { + const panel = workflowDefinition.configurationPanelJson; + if (Array.isArray(panel)) { + const fieldset = panel[0].fieldset; + if (fieldset !== undefined) { + fieldset.forEach(function (field) { + defaultValues[field.name] = field.value; + }); + } + } + } + if (defaultValues.length == 0) { + console.warn("No default values extracted from workflow definition: ", workflowId); + } + return defaultValues; + }; + const setInitialValues = () => { + let configFromDatabase = undefined; if (baseWorkflow.configuration) { - initialConfig = parseBooleanInObject(baseWorkflow.configuration); + configFromDatabase = parseBooleanInObject(baseWorkflow.configuration); } - - return { - workflowDefinition: "workflowId" in workflow && !!workflow.workflowId + const workflowId = "workflowId" in workflow && !!workflow.workflowId ? workflow.workflowId - : baseWorkflow.workflowId, + : baseWorkflow.workflowId; + const initialConfigValuesFromWorkflowDef = extractDefaultValuesFromWorkflowDefinition(workflowId); + const initialConfig = { ...initialConfigValuesFromWorkflowDef, ...configFromDatabase }; + return { + workflowDefinition: workflowId, configuration: initialConfig, }; }; From 945e027fb8502f50511cc08743960e8ed693b6db Mon Sep 17 00:00:00 2001 From: Carolina Ziegler Date: Tue, 23 Jun 2026 13:51:27 +0200 Subject: [PATCH 2/2] Rebasing https://github.com/opencast/admin-interface/pull/1476/commits/9252a41928c2458225410cb64cecf93206dde478 and applying comments from https://github.com/opencast/admin-interface/pull/1476 --- .../EventDetailsWorkflowSchedulingTab.tsx | 23 ++----------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowSchedulingTab.tsx b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowSchedulingTab.tsx index fcb4083b70..a221e0c26f 100644 --- a/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowSchedulingTab.tsx +++ b/src/components/events/partials/ModalTabsAndPages/EventDetailsWorkflowSchedulingTab.tsx @@ -21,6 +21,7 @@ import { removeNotificationWizardForm } from "../../../../slices/notificationSli import { useTranslation } from "react-i18next"; import { formatWorkflowsForDropdown } from "../../../../utils/dropDownUtils"; import ModalContent from "../../../shared/modals/ModalContent"; +import { setDefaultConfig } from "../../../../utils/workflowPanelUtils"; type InitialValues = { workflowDefinition: string; @@ -65,26 +66,6 @@ const EventDetailsWorkflowSchedulingTab = ({ return true; }; - const extractDefaultValuesFromWorkflowDefinition = (workflowId: string) => { - const defaultValues: Record = {}; - const workflowDefinition = workflowDefinitions.find(def => def.id === workflowId); - if (workflowDefinition) { - const panel = workflowDefinition.configurationPanelJson; - if (Array.isArray(panel)) { - const fieldset = panel[0].fieldset; - if (fieldset !== undefined) { - fieldset.forEach(function (field) { - defaultValues[field.name] = field.value; - }); - } - } - } - if (defaultValues.length == 0) { - console.warn("No default values extracted from workflow definition: ", workflowId); - } - return defaultValues; - }; - const setInitialValues = () => { let configFromDatabase = undefined; if (baseWorkflow.configuration) { @@ -93,7 +74,7 @@ const EventDetailsWorkflowSchedulingTab = ({ const workflowId = "workflowId" in workflow && !!workflow.workflowId ? workflow.workflowId : baseWorkflow.workflowId; - const initialConfigValuesFromWorkflowDef = extractDefaultValuesFromWorkflowDefinition(workflowId); + const initialConfigValuesFromWorkflowDef = setDefaultConfig(workflowDefinitions, workflowId); const initialConfig = { ...initialConfigValuesFromWorkflowDef, ...configFromDatabase }; return { workflowDefinition: workflowId,