Skip to content

Commit d4a9cac

Browse files
format
1 parent e0a745c commit d4a9cac

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

assets/js/hooks/KeyHandlers.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,18 @@ const openRunPanelAction = (_e: KeyboardEvent, _el: HTMLElement) => {
411411
foundButton.click();
412412
}
413413
} else {
414-
// Panel is not open, open it by clicking the run link
415-
const runButton = document.querySelector('a[href*="m=workflow_input"]') as HTMLAnchorElement;
416-
runButton?.click();
414+
// Check if a step is already selected by looking at the URL
415+
const isStepSelected = window.location.href.includes('s=');
416+
417+
if (isStepSelected) {
418+
// Step is selected, click the "Run" button on the step panel
419+
const stepRunButton = document.querySelector('[id^="run-from-step-"]') as HTMLAnchorElement;
420+
stepRunButton?.click();
421+
} else {
422+
// No step selected, open it by clicking the run link
423+
const runButton = document.querySelector('a[href*="m=workflow_input"]') as HTMLAnchorElement;
424+
runButton?.click();
425+
}
417426
}
418427
};
419428

lib/lightning_web/live/workflow_live/edit.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ defmodule LightningWeb.WorkflowLive.Edit do
506506
patch={"#{@base_url}?s=#{@selected_job.id}&m=workflow_input"}
507507
type="button"
508508
theme="primary"
509+
id={"run-from-step-#{@selected_job.id}"}
509510
>
510511
Run
511512
</.button_link>
@@ -2857,10 +2858,14 @@ defmodule LightningWeb.WorkflowLive.Edit do
28572858

28582859
patches =
28592860
WorkflowParams.to_patches(initial_params, next_params)
2861+
28602862
inverse_patches = WorkflowParams.to_patches(next_params, initial_params)
28612863

28622864
socket
2863-
|> push_event("patches-applied", %{patches: patches, inverse: inverse_patches})
2865+
|> push_event("patches-applied", %{
2866+
patches: patches,
2867+
inverse: inverse_patches
2868+
})
28642869
end
28652870

28662871
defp maybe_push_workflow_created(socket, workflow) do

0 commit comments

Comments
 (0)