-
- props.onChange(props.name, { id: BigInt(e.target.value) })
- }
- />
+
);
const RaciPicker = (props: any) => (
-
-
+
+
+
+
);
@@ -97,6 +103,7 @@ export const AssigneesOfITaskAssigneeEditor: React.FC
= (
+ |
Role |
Contact |
RACI |
@@ -109,7 +116,16 @@ export const AssigneesOfITaskAssigneeEditor: React.FC = (
{assignees.map((assignee, index) => (
-
+
+ |
+
+ |
= (
}
/>
|
-
+ |
|
+
+ Object.keys(fieldErrors ?? {}).some(
+ (key) => key === `${guid}.assignees`,
+ ),
+ )
+ .join("; ")}
+ />
);
};
diff --git a/src/modules/manager/workflowTemplates/components/TaskList.tsx b/src/modules/manager/workflowTemplates/components/TaskList.tsx
index 218a5d9..d3d3f90 100644
--- a/src/modules/manager/workflowTemplates/components/TaskList.tsx
+++ b/src/modules/manager/workflowTemplates/components/TaskList.tsx
@@ -9,6 +9,7 @@ import { faExclamationCircle } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { sortTasksTopologically } from "./workflowGraphUtils";
import { useCapabilityDefaults, validateTask } from "./useCapabilityDefaults";
+import ValidationErrorIcon from "../../../../components/validationErrorIcon";
interface TaskListProps {
tasks: TaskDefinition[];
@@ -70,11 +71,11 @@ const TaskList: React.FC
= ({
<>
{x.config.name as string}
- {validTasksList[x.config.guid as string] === false && (
-
-
-
- )}
+ {
+
+ }
>
)}
onSelect={(item) => onSelectTask(item)}
diff --git a/src/modules/manager/workflowTemplates/components/TasksEditor.tsx b/src/modules/manager/workflowTemplates/components/TasksEditor.tsx
index 65f47c5..0b0be1b 100644
--- a/src/modules/manager/workflowTemplates/components/TasksEditor.tsx
+++ b/src/modules/manager/workflowTemplates/components/TasksEditor.tsx
@@ -27,26 +27,23 @@ export const TaskEditor: React.FC = ({
const runValidation = useCallback(
(
- bubbleUp = true,
taskToValidate: TaskDefinition,
tasksList: TaskDefinition[],
tasksMetadataList: TaskMetadata[],
) => {
const errors = validateTask(taskToValidate, tasksList, tasksMetadataList);
setFieldErrors(errors);
-
- if (bubbleUp) {
- onValidate(
- taskToValidate.config.guid as string,
- Object.keys(errors).length === 0,
- );
- }
+ onValidate(
+ taskToValidate.config.guid as string,
+ Object.keys(errors).length === 0,
+ );
},
+ [onValidate],
);
React.useEffect(() => {
- runValidation(true, task, tasks, tasksMetadata);
- }, [runValidation, task, tasks, tasksMetadata]);
+ runValidation(task, tasks, tasksMetadata);
+ }, [task.config.guid, runValidation]);
const handleTaskChange = (updatedTask: TaskDefinition) => {
// Update the task list
@@ -54,16 +51,7 @@ export const TaskEditor: React.FC = ({
t.config.guid === updatedTask.config.guid ? updatedTask : t,
);
- runValidation(true, updatedTask, updatedTasks, tasksMetadata);
- // // Run validation
- // const errors = validateTask(updatedTask, updatedTasks, tasksMetadata);
- // setFieldErrors(errors);
-
- // // Bubble validity up
- // onValidate(
- // updatedTask.config.guid as string,
- // Object.keys(errors).length === 0,
- // );
+ runValidation(updatedTask, updatedTasks, tasksMetadata);
// Bubble updated task up
onChange(updatedTask);
diff --git a/src/modules/manager/workflowTemplates/components/TasksTab.tsx b/src/modules/manager/workflowTemplates/components/TasksTab.tsx
index 3ab06f8..804a00a 100644
--- a/src/modules/manager/workflowTemplates/components/TasksTab.tsx
+++ b/src/modules/manager/workflowTemplates/components/TasksTab.tsx
@@ -66,7 +66,7 @@ const TasksTab: React.FC = ({
};
return (
-