From 3d8eb25075854f5169596ea074b2771d69806b5f Mon Sep 17 00:00:00 2001 From: Taylor Downs Date: Fri, 10 Nov 2023 18:08:29 +0000 Subject: [PATCH] close #1356 and close #1357 --- assets/package-lock.json | 16 ++++++++-------- assets/package.json | 2 +- lib/lightning_web/live/workflow_live/edit.ex | 13 +++++++++++-- .../live/workflow_live/editor_test.exs | 6 ++++++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/assets/package-lock.json b/assets/package-lock.json index a70f08a5c1..9104e30957 100644 --- a/assets/package-lock.json +++ b/assets/package-lock.json @@ -33,7 +33,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", @@ -491,9 +491,9 @@ } }, "node_modules/@openfn/engine-multi": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@openfn/engine-multi/-/engine-multi-0.1.6.tgz", - "integrity": "sha512-l6dvN0ik9kOo+Sji3OtJDKvM3adDdfOGTkzXf0mVl70Jusj0ULVmo0JiIX8KCo3AMJtUNATSDB7tCa4i6gnrCA==", + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@openfn/engine-multi/-/engine-multi-0.1.7.tgz", + "integrity": "sha512-VerTktnlkf/tUX8Rz6QbbWtL4G452vZRskRZY8zyy4ZbXB+I0JTs4OaZDKkL/T63mnVmR4QralrRagWNr4bSZQ==", "dev": true, "dependencies": { "@openfn/compiler": "0.0.38", @@ -536,13 +536,13 @@ } }, "node_modules/@openfn/ws-worker": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@openfn/ws-worker/-/ws-worker-0.2.0.tgz", - "integrity": "sha512-WnI7wkFFvklIzFW/jG6bAhZnJNiHZjzTY+PoJJCmxHKDQzw5Si22Iiw2ON+d02hgWd7pk5So+BN1oBEfjMkVpA==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@openfn/ws-worker/-/ws-worker-0.2.1.tgz", + "integrity": "sha512-7eYvIxZryMhIiGMRNaRUd3+JA1Wj/tNb9KZJIMr3NbEyhzyPelx4ZQU0NQibhTCyijaMDbtqHrbhTF1VrRhenQ==", "dev": true, "dependencies": { "@koa/router": "^12.0.0", - "@openfn/engine-multi": "0.1.6", + "@openfn/engine-multi": "0.1.7", "@openfn/logger": "0.0.19", "@openfn/runtime": "0.1.0", "@types/koa-logger": "^3.1.2", diff --git a/assets/package.json b/assets/package.json index 5717ea6fc1..a9a9dfda83 100644 --- a/assets/package.json +++ b/assets/package.json @@ -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", diff --git a/lib/lightning_web/live/workflow_live/edit.ex b/lib/lightning_web/live/workflow_live/edit.ex index b720c07681..b39d13d477 100644 --- a/lib/lightning_web/live/workflow_live/edit.ex +++ b/lib/lightning_web/live/workflow_live/edit.ex @@ -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 @@ -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 diff --git a/test/lightning_web/live/workflow_live/editor_test.exs b/test/lightning_web/live/workflow_live/editor_test.exs index 33cf9a4ca2..2919d767f3 100644 --- a/test/lightning_web/live/workflow_live/editor_test.exs +++ b/test/lightning_web/live/workflow_live/editor_test.exs @@ -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