Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: allow deleting gardens from web

+15
+7
apps/sower/lib/sower_web/live/garden_live/show.ex
··· 83 83 end 84 84 85 85 @impl true 86 + def handle_event("delete", %{"id" => id}, socket) do 87 + garden = Orchestration.get_garden!(id) 88 + {:ok, _} = Orchestration.delete_garden(garden) 89 + 90 + {:noreply, push_navigate(socket, to: ~p"/gardens")} 91 + end 92 + 86 93 def handle_event("deploy_subscription", %{"subscription_sid" => sub_sid}, socket) do 87 94 subscription = Enum.find(socket.assigns.garden.subscriptions, &(&1.sid == sub_sid)) 88 95
+8
apps/sower/lib/sower_web/live/garden_live/show.html.heex
··· 4 4 <.online state={@online} /> 5 5 <span>Garden: {@garden.name}</span> 6 6 </div> 7 + <:actions> 8 + <.link 9 + phx-click={JS.push("delete", value: %{id: @garden.id})} 10 + data-confirm="Are you sure?" 11 + > 12 + <.button variant={:danger}>Delete</.button> 13 + </.link> 14 + </:actions> 7 15 </.header> 8 16 9 17 <div class="mt-8 space-y-10">