Skip to content

Commit

Permalink
Merge pull request #1358 from OpenFn/worker_and_save_run_glitch
Browse files Browse the repository at this point in the history
close #1356 and close #1357
  • Loading branch information
taylordowns2000 authored Nov 10, 2023
2 parents 8a6f463 + 3d8eb25 commit 3f5b680
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 11 deletions.
16 changes: 8 additions & 8 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"zustand": "^4.3.7"
},
"devDependencies": {
"@openfn/ws-worker": "^0.2.0",
"@openfn/ws-worker": "^0.2.1",
"@types/marked": "^4.0.8",
"@types/react": "^18.0.15",
"@types/react-dom": "^18.0.6",
Expand Down
13 changes: 11 additions & 2 deletions lib/lightning_web/live/workflow_live/edit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ defmodule LightningWeb.WorkflowLive.Edit do
form={@manual_run_form.id}
disabled={@save_and_run_disabled}
>
<.icon name="hero-play-solid" class="w-4 h-4" /> Save + Run
<.icon name="hero-play-solid" class="w-4 h-4" /> Save & Run
</.button>
</div>
Expand Down Expand Up @@ -762,7 +762,16 @@ defmodule LightningWeb.WorkflowLive.Edit do
can_edit_job: can_edit_job,
can_run_job: can_run_job
} ->
manual_run_form.source.errors |> Enum.any?() or
form_valid =
if manual_run_form.source.errors == [
created_by: {"can't be blank", [validation: :required]}
] and Map.get(manual_run_form.params, "dataclip_id") do
true
else
!Enum.any?(manual_run_form.source.errors)
end

!form_valid or
!changeset.valid? or
!(can_edit_job or can_run_job)
end
Expand Down
6 changes: 6 additions & 0 deletions test/lightning_web/live/workflow_live/editor_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,12 @@ defmodule LightningWeb.WorkflowLive.EditorTest do
)

assert render(element) =~ "selected"

refute view
|> element(
~s{button[type='submit'][form='manual_run_form'][disabled]}
)
|> has_element?()
end
end

Expand Down

0 comments on commit 3f5b680

Please sign in to comment.