Removed predecessors, as it's a limiting factor
This commit is contained in:
parent
4201d109a7
commit
ecb306c698
@ -53,18 +53,6 @@ const formatNewTaskName = (
|
|||||||
return `${base}${index}`;
|
return `${base}${index}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
const setDefaultPredecessors = (
|
|
||||||
task: TaskDefinition,
|
|
||||||
tasks: TaskDefinition[],
|
|
||||||
): string[] => {
|
|
||||||
const allowedPredecessors = getAllowedPredecessors(task, tasks);
|
|
||||||
if (allowedPredecessors.length === 0) return [];
|
|
||||||
|
|
||||||
return [
|
|
||||||
allowedPredecessors[allowedPredecessors.length - 1].config.guid as string,
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
export const TaskCoreEditor: React.FC<CapabilityEditorProps> = (props) => {
|
export const TaskCoreEditor: React.FC<CapabilityEditorProps> = (props) => {
|
||||||
const { task, tasks, onChange, fieldErrors } = props;
|
const { task, tasks, onChange, fieldErrors } = props;
|
||||||
|
|
||||||
@ -97,22 +85,6 @@ export const TaskCoreEditor: React.FC<CapabilityEditorProps> = (props) => {
|
|||||||
InputType.time,
|
InputType.time,
|
||||||
fieldErrors,
|
fieldErrors,
|
||||||
)}
|
)}
|
||||||
{renderTaskField(
|
|
||||||
task,
|
|
||||||
onChange,
|
|
||||||
"predecessors",
|
|
||||||
"Predecessors",
|
|
||||||
InputType.checklist,
|
|
||||||
fieldErrors,
|
|
||||||
"",
|
|
||||||
0,
|
|
||||||
{
|
|
||||||
options: allowedPredecessors.map((t) => ({
|
|
||||||
value: t.config.guid as string,
|
|
||||||
label: t.config.name as string,
|
|
||||||
})),
|
|
||||||
},
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@ -149,13 +121,6 @@ const runValidation = (
|
|||||||
errors.predecessors = "A task cannot depend on itself.";
|
errors.predecessors = "A task cannot depend on itself.";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (task.config.predecessors) {
|
|
||||||
const unique = new Set(task.config.predecessors as string[]);
|
|
||||||
if (unique.size !== (task.config.predecessors as string[]).length) {
|
|
||||||
errors.predecessors = "Duplicate predecessors are not allowed.";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.resolve(errors);
|
return Promise.resolve(errors);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -172,7 +137,6 @@ export function defaultsAssignment(
|
|||||||
);
|
);
|
||||||
task.config.description = "";
|
task.config.description = "";
|
||||||
task.config.duration = "01:00";
|
task.config.duration = "01:00";
|
||||||
task.config.predecessors = setDefaultPredecessors(task, tasks);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const taskCoreEditorRegistryEntry: capabilityEditorRegistryEntry = {
|
export const taskCoreEditorRegistryEntry: capabilityEditorRegistryEntry = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user