Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make root layout configurable #2310

Merged
merged 4 commits into from
Jul 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor to make credo happy
  • Loading branch information
midigofrank committed Jul 25, 2024
commit 1359f45ddb791d5b34e51b77a36f282c4d6f896b
16 changes: 9 additions & 7 deletions lib/lightning_web/live/workflow_live/edit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1366,13 +1366,7 @@ defmodule LightningWeb.WorkflowLive.Edit do
|> assign_workflow(workflow, snapshot)
|> put_flash(:info, "Workflow saved")
|> push_patches_applied(initial_params)
|> then(fn socket ->
if socket.assigns.live_action == :new do
push_event(socket, "workflow_created", %{id: workflow.id})
else
socket
end
end)
|> maybe_push_workflow_created(workflow)
|> push_patch(
to: ~p"/projects/#{project.id}/w/#{workflow.id}?#{query_params}",
replace: true
Expand Down Expand Up @@ -2023,6 +2017,14 @@ defmodule LightningWeb.WorkflowLive.Edit do
|> push_event("patches-applied", %{patches: patches})
end

defp maybe_push_workflow_created(socket, workflow) do
if socket.assigns.live_action == :new do
push_event(socket, "workflow_created", %{id: workflow.id})
else
socket
end
end

# In situations where a new job is added, specifically by the WorkflowDiagram
# component, the job will not have an adaptor set. This function will set the
# adaptor to the current latest version of the adaptor, instead of the
Expand Down