defmodule LivebookWeb.Hub.Teams.DeploymentGroupComponent do use LivebookWeb, :live_component alias LivebookWeb.NotFoundError alias Livebook.Teams.DeploymentGroup @impl true def update(assigns, socket) do deployment_group = assigns.deployment_group secret_name = assigns.params["secret_name"] secret_value = if assigns.params["deployment_group_id"] == deployment_group.id and assigns.live_action == :edit_deployment_group_secret do Enum.find_value(deployment_group.secrets, &(&1.name == secret_name and &1.value)) || raise(NotFoundError, "could not find secret matching #{inspect(secret_name)}") end {:ok, socket |> assign(assigns) |> assign(secret_name: secret_name, secret_value: secret_value)} end @impl true def render(assigns) do ~H"""
Secrets that are exclusive to apps deployed to this group. In case of conflicts, these secrets take precedence over Workspace secrets.
To deploy a new app, open up a notebook of your choice and click on the <.remix_icon icon="rocket-line" /> icon on the sidebar. Follow the steps there to deploy with Livebook Teams.