mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
Simplify workflow inspector copy
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
@@ -58,8 +58,7 @@ function TriggerConfigFields({
|
||||
value={trigger.filter ?? ""}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Run only when this evalexpr expression matches. Leave empty to run
|
||||
for every matching event.
|
||||
Evalexpr. Empty matches all events.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
@@ -78,15 +77,12 @@ function TriggerConfigFields({
|
||||
placeholder="e.g. thumbsup"
|
||||
value={trigger.emoji ?? ""}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Leave empty to trigger on any reaction.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
case "webhook":
|
||||
return (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
A unique webhook URL will be generated when the workflow is created.
|
||||
A unique URL is generated after creation.
|
||||
</p>
|
||||
);
|
||||
case "schedule":
|
||||
@@ -121,7 +117,7 @@ function TriggerConfigFields({
|
||||
/>
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Provide either a cron expression or a simple interval.
|
||||
Use either cron or interval.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
@@ -663,16 +659,7 @@ export function WorkflowFormBuilder({
|
||||
variants={inspectorContentVariants}
|
||||
>
|
||||
{selectedNode.type === "trigger" ? (
|
||||
<div className="space-y-4">
|
||||
<div className="space-y-1">
|
||||
<h4 className="text-sm font-semibold text-foreground">
|
||||
Trigger settings
|
||||
</h4>
|
||||
<p className="text-xs leading-relaxed text-muted-foreground">
|
||||
Configure when this event should start the
|
||||
workflow.
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<TriggerConfigFields
|
||||
onUpdate={(trigger) =>
|
||||
updateFormState({ ...formState, trigger })
|
||||
|
||||
@@ -98,8 +98,8 @@ function StepConfigFields({
|
||||
value={step.channel ?? ""}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Leave empty to use the trigger channel. Webhook runs and manual
|
||||
Trigger runs need an explicit channel override.
|
||||
Defaults to the trigger channel. Webhook and manual triggers
|
||||
require a channel.
|
||||
</p>
|
||||
{triggerType === "webhook" && !(step.channel ?? "").trim() ? (
|
||||
<p className="text-xs text-amber-700">
|
||||
@@ -290,21 +290,8 @@ function StepConfigFields({
|
||||
}
|
||||
}
|
||||
|
||||
function SectionHeading({
|
||||
description,
|
||||
title,
|
||||
}: {
|
||||
description: string;
|
||||
title: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="space-y-1">
|
||||
<h4 className="text-sm font-semibold text-foreground">{title}</h4>
|
||||
<p className="text-xs leading-relaxed text-muted-foreground">
|
||||
{description}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
function SectionHeading({ title }: { title: string }) {
|
||||
return <h4 className="text-sm font-semibold text-foreground">{title}</h4>;
|
||||
}
|
||||
|
||||
export function WorkflowStepCard({
|
||||
@@ -355,10 +342,6 @@ export function WorkflowStepCard({
|
||||
) : null}
|
||||
|
||||
<section className="space-y-4 pb-5">
|
||||
<SectionHeading
|
||||
description="Configure the inputs this action needs."
|
||||
title="Action settings"
|
||||
/>
|
||||
<StepConfigFields
|
||||
disabled={disabled}
|
||||
onUpdate={onUpdate}
|
||||
@@ -369,10 +352,7 @@ export function WorkflowStepCard({
|
||||
</section>
|
||||
|
||||
<section className="space-y-4 border-t border-border/50 py-5">
|
||||
<SectionHeading
|
||||
description="Optionally limit when this step runs and how long it may take."
|
||||
title="Run controls"
|
||||
/>
|
||||
<SectionHeading title="Run controls" />
|
||||
<div className="space-y-1.5">
|
||||
<FieldLabel htmlFor={`${prefix}-condition`}>
|
||||
Condition (optional)
|
||||
@@ -387,9 +367,6 @@ export function WorkflowStepCard({
|
||||
placeholder='e.g. str_contains(trigger_text, "deploy")'
|
||||
value={step.condition ?? ""}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Leave empty to run whenever the previous node completes.
|
||||
</p>
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
<FieldLabel htmlFor={`${prefix}-timeout-secs`}>
|
||||
@@ -407,16 +384,13 @@ export function WorkflowStepCard({
|
||||
value={step.timeoutSecs ?? ""}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Leave empty to use the workflow default.
|
||||
Defaults to the workflow timeout.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="space-y-4 border-t border-border/50 pt-5">
|
||||
<SectionHeading
|
||||
description="Use a readable name and stable identifier to maintain this workflow."
|
||||
title="Step details"
|
||||
/>
|
||||
<SectionHeading title="Step details" />
|
||||
<div className="space-y-1.5">
|
||||
<FieldLabel htmlFor={`${prefix}-name`}>Name (optional)</FieldLabel>
|
||||
<Input
|
||||
@@ -429,9 +403,6 @@ export function WorkflowStepCard({
|
||||
placeholder="e.g. Notify deployment channel"
|
||||
value={step.name ?? ""}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Shown on the node instead of the action name.
|
||||
</p>
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
<FieldLabel htmlFor={`${prefix}-id`}>Step ID</FieldLabel>
|
||||
@@ -444,7 +415,7 @@ export function WorkflowStepCard({
|
||||
value={step.id}
|
||||
/>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Unique key used by workflow configuration and history.
|
||||
Used in configuration and run history.
|
||||
</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user