fix(ui): mark the step failing validation on its canvas node
This commit is contained in:
1 file changed
+8
-1
@@ -309,6 +309,13 @@ const problems = computed(() =>
|
||||
}),
|
||||
),
|
||||
);
|
||||
// The parse stops at the first failing step; its node carries that failure too.
|
||||
const nodeProblems = computed(() => {
|
||||
const result = parsed.value;
|
||||
const failed = result.ok ? null : /^workflow \S+ step (\d+)\b/.exec(result.message);
|
||||
if (result.ok || !failed) return problems.value;
|
||||
return { [JSON.stringify(["steps", Number(failed[1]) - 1])]: result.message, ...problems.value };
|
||||
});
|
||||
const WORKS_ON: Record<string, string> = { optional: "Repository if given", none: "No repository" };
|
||||
const REQUIRED = "Works on a repository";
|
||||
const workflowSummary = computed(() =>
|
||||
@@ -425,7 +432,7 @@ function syncScroll(event: Event): void {
|
||||
:triggers="triggers"
|
||||
:types="stepTypeNames"
|
||||
:restartable="restartable"
|
||||
:problems="problems"
|
||||
:problems="nodeProblems"
|
||||
:title="parsed.ok ? parsed.id : id"
|
||||
:summary="workflowSummary"
|
||||
@toggle="toggle"
|
||||
|
||||
Reference in new issue
Block a user