diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c9ab0edf0..2fe6244636 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ and this project adheres to ## [Unreleased] +- Remove Environment input from Sandbox form + [#3954](https://github.com/OpenFn/lightning/issues/3954) + ### Added ### Changed diff --git a/lib/lightning_web/live/sandbox_live/form_component.ex b/lib/lightning_web/live/sandbox_live/form_component.ex index 382d043def..17cbb121c2 100644 --- a/lib/lightning_web/live/sandbox_live/form_component.ex +++ b/lib/lightning_web/live/sandbox_live/form_component.ex @@ -82,7 +82,10 @@ defmodule LightningWeb.SandboxLive.FormComponent do } } = socket ) do - attrs = build_sandbox_attrs(params) + attrs = + params + |> build_sandbox_attrs() + |> Map.put(:env, "dev") with :ok <- ProjectLimiter.limit_new_sandbox(parent.id), {:ok, sandbox} <- Projects.provision_sandbox(parent, actor, attrs) do @@ -232,14 +235,6 @@ defmodule LightningWeb.SandboxLive.FormComponent do <% end %> - <.input - type="text" - field={f[:env]} - label="Environment" - placeholder="staging" - autocomplete="off" - /> - @@ -276,7 +271,6 @@ defmodule LightningWeb.SandboxLive.FormComponent do %{ "name" => sandbox.name, "raw_name" => sandbox.name, - "env" => sandbox.env, "color" => sandbox.color } end @@ -320,8 +314,7 @@ defmodule LightningWeb.SandboxLive.FormComponent do defp build_sandbox_attrs(params) do %{ name: params["name"], - color: params["color"], - env: params["env"] + color: params["color"] } end diff --git a/test/lightning_web/live/sandbox_live/form_component_test.exs b/test/lightning_web/live/sandbox_live/form_component_test.exs index 6b9c4718a0..deafa62eee 100644 --- a/test/lightning_web/live/sandbox_live/form_component_test.exs +++ b/test/lightning_web/live/sandbox_live/form_component_test.exs @@ -199,7 +199,7 @@ defmodule LightningWeb.SandboxLive.FormComponentTest do assert user_arg.id == user.id name = attrs[:name] || attrs["name"] - env = attrs[:env] || attrs["env"] + env = attrs[:env] || attrs["env"] || current_sb.env color = attrs[:color] || attrs["color"] if name in [nil, ""] do