From 31c6f7adf7c4d79f5eba2b93759e431d54a94bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 1 Sep 2022 08:09:27 +0200 Subject: [PATCH] Style secrets modal consistently with other add modals --- lib/livebook_web/live/session_live.ex | 1 + .../live/session_live/secrets_component.ex | 87 +++++++++---------- .../add_file_system_component.ex | 13 +-- 3 files changed, 49 insertions(+), 52 deletions(-) diff --git a/lib/livebook_web/live/session_live.ex b/lib/livebook_web/live/session_live.ex index 8a3a6a12c..08d617138 100644 --- a/lib/livebook_web/live/session_live.ex +++ b/lib/livebook_web/live/session_live.ex @@ -405,6 +405,7 @@ defmodule LivebookWeb.SessionLive do id="secrets" session={@session} secret={@secret} + return_to={@self_path} /> <% end %> diff --git a/lib/livebook_web/live/session_live/secrets_component.ex b/lib/livebook_web/live/session_live/secrets_component.ex index c38a0cd9c..84fc805e9 100644 --- a/lib/livebook_web/live/session_live/secrets_component.ex +++ b/lib/livebook_web/live/session_live/secrets_component.ex @@ -1,12 +1,6 @@ defmodule LivebookWeb.SessionLive.SecretsComponent do use LivebookWeb, :live_component - @impl true - def update(assigns, socket) do - socket = assign(socket, assigns) - {:ok, socket} - end - @impl true def render(assigns) do ~H""" @@ -14,48 +8,49 @@ defmodule LivebookWeb.SessionLive.SecretsComponent do

Add secret

-
-

- Enter the secret name and its value. -

- <.form - let={f} - for={:secret} - phx-submit="save" - phx-change="validate" - autocomplete="off" - phx-target={@myself} - > -
-
-
- Label (alphanumeric and underscore) -
- <%= text_input(f, :label, - value: @secret["label"], - class: "input", - placeholder: "secret label", - autofocus: true, - aria_labelledby: "secret-label", - spellcheck: "false" - ) %> -
-
-
Value
- <%= text_input(f, :value, - value: @secret["value"], - class: "input", - placeholder: "secret value", - aria_labelledby: "secret-value", - spellcheck: "false" - ) %> +

+ Enter the secret name and its value. +

+ <.form + let={f} + for={:secret} + phx-submit="save" + phx-change="validate" + autocomplete="off" + phx-target={@myself} + > +
+
+
+ Label (alphanumeric and underscore)
+ <%= text_input(f, :label, + value: @secret["label"], + class: "input", + placeholder: "secret label", + autofocus: true, + aria_labelledby: "secret-label", + spellcheck: "false" + ) %>
- - -
+
+
Value
+ <%= text_input(f, :value, + value: @secret["value"], + class: "input", + placeholder: "secret value", + aria_labelledby: "secret-value", + spellcheck: "false" + ) %> +
+
+ + <%= live_patch("Cancel", to: @return_to, class: "button-base button-outlined-gray") %> +
+
+
""" end diff --git a/lib/livebook_web/live/settings_live/add_file_system_component.ex b/lib/livebook_web/live/settings_live/add_file_system_component.ex index bb87d2b5c..aeb7bbeb1 100644 --- a/lib/livebook_web/live/settings_live/add_file_system_component.ex +++ b/lib/livebook_web/live/settings_live/add_file_system_component.ex @@ -63,12 +63,13 @@ defmodule LivebookWeb.SettingsLive.AddFileSystemComponent do ) %>
- -
- - <%= live_patch("Cancel", to: @return_to, class: "button-base button-outlined-gray") %> + +
+ + <%= live_patch("Cancel", to: @return_to, class: "button-base button-outlined-gray") %> +