Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 5 additions & 12 deletions lib/lightning_web/live/sandbox_live/form_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -232,14 +235,6 @@ defmodule LightningWeb.SandboxLive.FormComponent do
<% end %>
</div>

<.input
type="text"
field={f[:env]}
label="Environment"
placeholder="staging"
autocomplete="off"
/>

<Components.color_palette id="sandbox-color-picker" field={f[:color]} />
</div>

Expand Down Expand Up @@ -276,7 +271,6 @@ defmodule LightningWeb.SandboxLive.FormComponent do
%{
"name" => sandbox.name,
"raw_name" => sandbox.name,
"env" => sandbox.env,
"color" => sandbox.color
}
end
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down