Skip to content

Commit ee593ea

Browse files
committed
Merge branch 'schedule-or-upload-in-new-event' of Arnei/opencast-admin-interface into develop
Pull request #1567 Fixes #1531 Show upload OR schedule workflows in Create Event
2 parents 878851d + 55728d1 commit ee593ea

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/components/events/partials/ModalTabsAndPages/NewProcessingPage.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ const NewProcessingPage = <T extends RequiredFormProps>({
3535

3636
useEffect(() => {
3737
// Load workflow definitions for selecting
38-
dispatch(fetchWorkflowDef("default"));
39-
// eslint-disable-next-line react-hooks/exhaustive-deps
40-
}, []);
38+
if (formik.values.sourceMode !== "UPLOAD") {
39+
dispatch(fetchWorkflowDef("new-event-schedule"));
40+
} else {
41+
dispatch(fetchWorkflowDef("new-event-upload"));
42+
}
43+
}, [dispatch, formik.values.sourceMode]);
4144

4245
// Preselect the first item
4346
useEffect(() => {

src/slices/workflowSlice.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ const initialState: WorkflowState = {
5353
};
5454

5555
// fetch workflow definitions from server
56-
export const fetchWorkflowDef = createAppAsyncThunk("workflow/fetchWorkflowDef", async (type: string) => {
56+
export const fetchWorkflowDef = createAppAsyncThunk("workflow/fetchWorkflowDef", async (
57+
type: "tasks" | "delete-event" | "event-details" | "new-event-upload" | "new-event-schedule" | "default",
58+
) => {
5759
type NewProcessing = {
5860
default_workflow_id: string,
5961
workflows: Workflow[],
@@ -78,6 +80,16 @@ export const fetchWorkflowDef = createAppAsyncThunk("workflow/fetchWorkflowDef",
7880
tags: "schedule",
7981
};
8082
break;
83+
case "new-event-upload":
84+
urlParams = {
85+
tags: "upload",
86+
};
87+
break;
88+
case "new-event-schedule":
89+
urlParams = {
90+
tags: "schedule",
91+
};
92+
break;
8193
default: {
8294
urlParams = {
8395
tags: "upload,schedule",

0 commit comments

Comments
 (0)