feat(server): enhance workflow step execution and JSONata integration
- Refactored step execution logic to introduce runCompiledStep for improved clarity and functionality. - Added support for "set" steps, allowing context manipulation using JSONata expressions. - Implemented evaluateJsonata and isJsonataTruthy functions for evaluating conditions and expressions. - Updated workflow parsing to handle new step types and validation rules. - Enhanced logging and error handling for skipped steps and invalid configurations. - Modified UI components to reflect new step types and statuses, including "skipped".
This commit is contained in:
@@ -4,6 +4,17 @@ import { useRun } from "../api/hooks.js";
|
||||
import { LogViewer } from "../components/LogViewer.jsx";
|
||||
import { formatTime, StatusBadge } from "../lib/format.jsx";
|
||||
|
||||
function stepLabel(s) {
|
||||
if (s.script === "set") {
|
||||
return s.config?.as ? `set:${s.config.as}` : "set";
|
||||
}
|
||||
return s.script;
|
||||
}
|
||||
|
||||
function isEditableScript(s) {
|
||||
return Boolean(s.script) && s.script !== "set";
|
||||
}
|
||||
|
||||
export function EventDetailPage() {
|
||||
const { id } = useParams();
|
||||
const { data: run, isLoading, error } = useRun(id);
|
||||
@@ -67,9 +78,13 @@ export function EventDetailPage() {
|
||||
<tr key={s.id}>
|
||||
<td>{s.step_index}</td>
|
||||
<td className="font-mono">
|
||||
<Link className="link" to={`/scripts/${encodeURIComponent(s.script)}/edit`}>
|
||||
{s.script}
|
||||
</Link>
|
||||
{isEditableScript(s) ? (
|
||||
<Link className="link" to={`/scripts/${encodeURIComponent(s.script)}/edit`}>
|
||||
{stepLabel(s)}
|
||||
</Link>
|
||||
) : (
|
||||
stepLabel(s)
|
||||
)}
|
||||
</td>
|
||||
<td>
|
||||
<StatusBadge status={s.status} />
|
||||
|
||||
@@ -38,6 +38,7 @@ export function EventsPage() {
|
||||
<option value="running">running</option>
|
||||
<option value="success">success</option>
|
||||
<option value="failed">failed</option>
|
||||
<option value="skipped">skipped</option>
|
||||
</select>
|
||||
</div>
|
||||
{isLoading ? (
|
||||
|
||||
Reference in New Issue
Block a user