Revert "Move Run Workflow button to top of page" (#4614)
This commit is contained in:
@@ -504,60 +504,6 @@ function RunWorkflowForm({
|
||||
onSubmit={form.handleSubmit(onSubmit, handleInvalid)}
|
||||
className="space-y-8"
|
||||
>
|
||||
<header className="flex items-end justify-between gap-4">
|
||||
<div className="space-y-5">
|
||||
<h1 className="text-3xl">
|
||||
Parameters{workflow?.title ? ` - ${workflow.title}` : ""}
|
||||
</h1>
|
||||
<h2 className="text-lg text-slate-400">
|
||||
Fill the placeholder values that you have linked throughout your
|
||||
workflow.
|
||||
</h2>
|
||||
</div>
|
||||
<div className="flex shrink-0 gap-2">
|
||||
<CopyApiCommandDropdown
|
||||
getOptions={() => {
|
||||
const values = form.getValues();
|
||||
const body = getRunWorkflowRequestBody(
|
||||
values,
|
||||
workflowParameters,
|
||||
);
|
||||
const transformedBody = transformToWorkflowRunRequest(
|
||||
body,
|
||||
workflowPermanentId,
|
||||
);
|
||||
|
||||
// Build headers - x-max-steps-override is optional and can be added manually if needed
|
||||
const headers: Record<string, string> = {
|
||||
"Content-Type": "application/json",
|
||||
"x-api-key": apiCredential ?? "<your-api-key>",
|
||||
};
|
||||
|
||||
return {
|
||||
method: "POST",
|
||||
url: `${runsApiBaseUrl}/run/workflows`,
|
||||
body: transformedBody,
|
||||
headers,
|
||||
} satisfies ApiCommandOptions;
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={
|
||||
runWorkflowMutation.isPending || hasLoginBlockValidationError
|
||||
}
|
||||
>
|
||||
{runWorkflowMutation.isPending && (
|
||||
<ReloadIcon className="mr-2 h-4 w-4 animate-spin" />
|
||||
)}
|
||||
{!runWorkflowMutation.isPending && (
|
||||
<PlayIcon className="mr-2 h-4 w-4" />
|
||||
)}
|
||||
Run workflow
|
||||
</Button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{hasLoginBlockValidationError && (
|
||||
<Alert variant="destructive">
|
||||
<ExclamationTriangleIcon className="h-4 w-4" />
|
||||
@@ -1105,6 +1051,49 @@ function RunWorkflowForm({
|
||||
</AccordionItem>
|
||||
</Accordion>
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end gap-2">
|
||||
<CopyApiCommandDropdown
|
||||
getOptions={() => {
|
||||
const values = form.getValues();
|
||||
const body = getRunWorkflowRequestBody(
|
||||
values,
|
||||
workflowParameters,
|
||||
);
|
||||
const transformedBody = transformToWorkflowRunRequest(
|
||||
body,
|
||||
workflowPermanentId,
|
||||
);
|
||||
|
||||
// Build headers - x-max-steps-override is optional and can be added manually if needed
|
||||
const headers: Record<string, string> = {
|
||||
"Content-Type": "application/json",
|
||||
"x-api-key": apiCredential ?? "<your-api-key>",
|
||||
};
|
||||
|
||||
return {
|
||||
method: "POST",
|
||||
url: `${runsApiBaseUrl}/run/workflows`,
|
||||
body: transformedBody,
|
||||
headers,
|
||||
} satisfies ApiCommandOptions;
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={
|
||||
runWorkflowMutation.isPending || hasLoginBlockValidationError
|
||||
}
|
||||
>
|
||||
{runWorkflowMutation.isPending && (
|
||||
<ReloadIcon className="mr-2 h-4 w-4 animate-spin" />
|
||||
)}
|
||||
{!runWorkflowMutation.isPending && (
|
||||
<PlayIcon className="mr-2 h-4 w-4" />
|
||||
)}
|
||||
Run workflow
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</Form>
|
||||
);
|
||||
|
||||
@@ -44,16 +44,22 @@ function WorkflowRunParameters() {
|
||||
|
||||
const initialValues = getInitialValues(location, workflowParameters ?? []);
|
||||
|
||||
const header = (
|
||||
<header className="space-y-5">
|
||||
<h1 className="text-3xl">
|
||||
Parameters{workflow?.title ? ` - ${workflow.title}` : ""}
|
||||
</h1>
|
||||
<h2 className="text-lg text-slate-400">
|
||||
Fill the placeholder values that you have linked throughout your
|
||||
workflow.
|
||||
</h2>
|
||||
</header>
|
||||
);
|
||||
|
||||
if (isFetching) {
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
<header className="space-y-5">
|
||||
<h1 className="text-3xl">Parameters</h1>
|
||||
<h2 className="text-lg text-slate-400">
|
||||
Fill the placeholder values that you have linked throughout your
|
||||
workflow.
|
||||
</h2>
|
||||
</header>
|
||||
{header}
|
||||
<Skeleton className="h-96 w-full" />
|
||||
</div>
|
||||
);
|
||||
@@ -64,21 +70,26 @@ function WorkflowRunParameters() {
|
||||
}
|
||||
|
||||
return (
|
||||
<RunWorkflowForm
|
||||
initialValues={initialValues}
|
||||
workflowParameters={workflowParameters}
|
||||
initialSettings={{
|
||||
proxyLocation:
|
||||
proxyLocation ?? workflow.proxy_location ?? ProxyLocation.Residential,
|
||||
webhookCallbackUrl:
|
||||
webhookCallbackUrl ?? workflow.webhook_callback_url ?? "",
|
||||
maxScreenshotScrolls:
|
||||
maxScreenshotScrolls ?? workflow.max_screenshot_scrolls ?? null,
|
||||
extraHttpHeaders:
|
||||
extraHttpHeaders ?? workflow.extra_http_headers ?? null,
|
||||
cdpAddress: null,
|
||||
}}
|
||||
/>
|
||||
<div className="space-y-8">
|
||||
{header}
|
||||
<RunWorkflowForm
|
||||
initialValues={initialValues}
|
||||
workflowParameters={workflowParameters}
|
||||
initialSettings={{
|
||||
proxyLocation:
|
||||
proxyLocation ??
|
||||
workflow.proxy_location ??
|
||||
ProxyLocation.Residential,
|
||||
webhookCallbackUrl:
|
||||
webhookCallbackUrl ?? workflow.webhook_callback_url ?? "",
|
||||
maxScreenshotScrolls:
|
||||
maxScreenshotScrolls ?? workflow.max_screenshot_scrolls ?? null,
|
||||
extraHttpHeaders:
|
||||
extraHttpHeaders ?? workflow.extra_http_headers ?? null,
|
||||
cdpAddress: null,
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ const nodeLibraryItems: Array<{
|
||||
/>
|
||||
),
|
||||
title: "File Parser Block",
|
||||
description: "Parse PDFs, CSVs, and Excel files",
|
||||
description: "Parse PDFs, CSVs, Excel files, and Images",
|
||||
},
|
||||
// {
|
||||
// nodeType: "pdfParser",
|
||||
|
||||
@@ -415,7 +415,7 @@ export type SendEmailBlock = WorkflowBlockBase & {
|
||||
export type FileURLParserBlock = WorkflowBlockBase & {
|
||||
block_type: "file_url_parser";
|
||||
file_url: string;
|
||||
file_type: "csv" | "excel" | "pdf";
|
||||
file_type: "csv" | "excel" | "pdf" | "image";
|
||||
json_schema: Record<string, unknown> | null;
|
||||
};
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ export type SendEmailBlockYAML = BlockYAMLBase & {
|
||||
export type FileUrlParserBlockYAML = BlockYAMLBase & {
|
||||
block_type: "file_url_parser";
|
||||
file_url: string;
|
||||
file_type: "csv" | "excel" | "pdf";
|
||||
file_type: "csv" | "excel" | "pdf" | "image";
|
||||
json_schema?: Record<string, unknown> | null;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user