render complete criterion in task block (#1384)
This commit is contained in:
@@ -53,7 +53,7 @@ function LoginNode({ id, data }: NodeProps<LoginNode>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div>
|
||||||
<Handle
|
<Handle
|
||||||
type="source"
|
type="source"
|
||||||
position={Position.Bottom}
|
position={Position.Bottom}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div>
|
||||||
<Handle
|
<Handle
|
||||||
type="source"
|
type="source"
|
||||||
position={Position.Bottom}
|
position={Position.Bottom}
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
|
|||||||
url: data.url,
|
url: data.url,
|
||||||
navigationGoal: data.navigationGoal,
|
navigationGoal: data.navigationGoal,
|
||||||
dataExtractionGoal: data.dataExtractionGoal,
|
dataExtractionGoal: data.dataExtractionGoal,
|
||||||
|
completeCriterion: data.completeCriterion,
|
||||||
|
terminateCriterion: data.terminateCriterion,
|
||||||
dataSchema: data.dataSchema,
|
dataSchema: data.dataSchema,
|
||||||
maxRetries: data.maxRetries,
|
maxRetries: data.maxRetries,
|
||||||
maxStepsOverride: data.maxStepsOverride,
|
maxStepsOverride: data.maxStepsOverride,
|
||||||
@@ -72,7 +74,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="relative">
|
<div>
|
||||||
<Handle
|
<Handle
|
||||||
type="source"
|
type="source"
|
||||||
position={Position.Bottom}
|
position={Position.Bottom}
|
||||||
@@ -223,6 +225,20 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
|
|||||||
<AccordionTrigger>Advanced Settings</AccordionTrigger>
|
<AccordionTrigger>Advanced Settings</AccordionTrigger>
|
||||||
<AccordionContent className="pl-6 pr-1 pt-1">
|
<AccordionContent className="pl-6 pr-1 pt-1">
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
|
<div className="space-y-2">
|
||||||
|
<Label className="text-xs text-slate-300">
|
||||||
|
Complete if...
|
||||||
|
</Label>
|
||||||
|
<WorkflowBlockInputTextarea
|
||||||
|
nodeId={id}
|
||||||
|
onChange={(value) => {
|
||||||
|
handleChange("completeCriterion", value);
|
||||||
|
}}
|
||||||
|
value={inputs.completeCriterion}
|
||||||
|
className="nopan text-xs"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Separator />
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<div className="flex gap-2">
|
<div className="flex gap-2">
|
||||||
<Label className="text-xs font-normal text-slate-300">
|
<Label className="text-xs font-normal text-slate-300">
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ export type TaskNodeData = NodeBaseData & {
|
|||||||
dataExtractionGoal: string;
|
dataExtractionGoal: string;
|
||||||
errorCodeMapping: string;
|
errorCodeMapping: string;
|
||||||
dataSchema: string;
|
dataSchema: string;
|
||||||
|
completeCriterion: string;
|
||||||
|
terminateCriterion: string;
|
||||||
maxRetries: number | null;
|
maxRetries: number | null;
|
||||||
maxStepsOverride: number | null;
|
maxStepsOverride: number | null;
|
||||||
allowDownloads: boolean;
|
allowDownloads: boolean;
|
||||||
@@ -25,6 +27,8 @@ export const taskNodeDefaultData: TaskNodeData = {
|
|||||||
dataExtractionGoal: "",
|
dataExtractionGoal: "",
|
||||||
errorCodeMapping: "null",
|
errorCodeMapping: "null",
|
||||||
dataSchema: "null",
|
dataSchema: "null",
|
||||||
|
completeCriterion: "",
|
||||||
|
terminateCriterion: "",
|
||||||
maxRetries: null,
|
maxRetries: null,
|
||||||
maxStepsOverride: null,
|
maxStepsOverride: null,
|
||||||
allowDownloads: false,
|
allowDownloads: false,
|
||||||
|
|||||||
@@ -190,6 +190,8 @@ function convertToNode(
|
|||||||
totpIdentifier: block.totp_identifier ?? null,
|
totpIdentifier: block.totp_identifier ?? null,
|
||||||
totpVerificationUrl: block.totp_verification_url ?? null,
|
totpVerificationUrl: block.totp_verification_url ?? null,
|
||||||
cacheActions: block.cache_actions,
|
cacheActions: block.cache_actions,
|
||||||
|
completeCriterion: block.complete_criterion ?? "",
|
||||||
|
terminateCriterion: block.terminate_criterion ?? "",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -802,6 +804,8 @@ function getWorkflowBlock(node: WorkflowBlockNode): BlockYAML {
|
|||||||
title: node.data.label,
|
title: node.data.label,
|
||||||
navigation_goal: node.data.navigationGoal,
|
navigation_goal: node.data.navigationGoal,
|
||||||
data_extraction_goal: node.data.dataExtractionGoal,
|
data_extraction_goal: node.data.dataExtractionGoal,
|
||||||
|
complete_criterion: node.data.completeCriterion,
|
||||||
|
terminate_criterion: node.data.terminateCriterion,
|
||||||
data_schema: JSONParseSafe(node.data.dataSchema),
|
data_schema: JSONParseSafe(node.data.dataSchema),
|
||||||
error_code_mapping: JSONParseSafe(node.data.errorCodeMapping) as Record<
|
error_code_mapping: JSONParseSafe(node.data.errorCodeMapping) as Record<
|
||||||
string,
|
string,
|
||||||
@@ -1427,6 +1431,8 @@ function convertBlocksToBlockYAML(
|
|||||||
url: block.url,
|
url: block.url,
|
||||||
navigation_goal: block.navigation_goal,
|
navigation_goal: block.navigation_goal,
|
||||||
data_extraction_goal: block.data_extraction_goal,
|
data_extraction_goal: block.data_extraction_goal,
|
||||||
|
complete_criterion: block.complete_criterion,
|
||||||
|
terminate_criterion: block.terminate_criterion,
|
||||||
data_schema: block.data_schema,
|
data_schema: block.data_schema,
|
||||||
error_code_mapping: block.error_code_mapping,
|
error_code_mapping: block.error_code_mapping,
|
||||||
max_retries: block.max_retries,
|
max_retries: block.max_retries,
|
||||||
|
|||||||
@@ -155,6 +155,8 @@ export type TaskBlock = WorkflowBlockBase & {
|
|||||||
navigation_goal: string | null;
|
navigation_goal: string | null;
|
||||||
data_extraction_goal: string | null;
|
data_extraction_goal: string | null;
|
||||||
data_schema: Record<string, unknown> | null;
|
data_schema: Record<string, unknown> | null;
|
||||||
|
complete_criterion: string | null;
|
||||||
|
terminate_criterion: string | null;
|
||||||
error_code_mapping: Record<string, string> | null;
|
error_code_mapping: Record<string, string> | null;
|
||||||
max_retries?: number;
|
max_retries?: number;
|
||||||
max_steps_per_run?: number | null;
|
max_steps_per_run?: number | null;
|
||||||
|
|||||||
@@ -126,6 +126,8 @@ export type TaskBlockYAML = BlockYAMLBase & {
|
|||||||
totp_verification_url?: string | null;
|
totp_verification_url?: string | null;
|
||||||
totp_identifier?: string | null;
|
totp_identifier?: string | null;
|
||||||
cache_actions: boolean;
|
cache_actions: boolean;
|
||||||
|
complete_criterion: string | null;
|
||||||
|
terminate_criterion: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ValidationBlockYAML = BlockYAMLBase & {
|
export type ValidationBlockYAML = BlockYAMLBase & {
|
||||||
|
|||||||
Reference in New Issue
Block a user