Typing env and secret name automatically upcases (#1736)

This commit is contained in:
Wojtek Mach 2023-02-28 13:53:18 +01:00 committed by GitHub
parent 45f9e90451
commit 1f496c8605
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -14,6 +14,7 @@ defmodule LivebookWeb.FormComponents do
attr :value, :any attr :value, :any
attr :errors, :list, default: [] attr :errors, :list, default: []
attr :field, Phoenix.HTML.FormField, doc: "a form field struct retrieved from the form" attr :field, Phoenix.HTML.FormField, doc: "a form field struct retrieved from the form"
attr :class, :string, default: nil
attr :rest, :global, include: ~w(autocomplete readonly disabled) attr :rest, :global, include: ~w(autocomplete readonly disabled)
@ -27,7 +28,7 @@ defmodule LivebookWeb.FormComponents do
name={@name} name={@name}
id={@id || @name} id={@id || @name}
value={Phoenix.HTML.Form.normalize_value("text", @value)} value={Phoenix.HTML.Form.normalize_value("text", @value)}
class="input" class={["input", @class]}
{@rest} {@rest}
/> />
</.field_wrapper> </.field_wrapper>

View file

@ -45,6 +45,7 @@ defmodule LivebookWeb.EnvVarComponent do
field={f[:name]} field={f[:name]}
label="Name (alphanumeric and underscore)" label="Name (alphanumeric and underscore)"
autofocus={@operation == :new} autofocus={@operation == :new}
class="uppercase"
/> />
<.text_field field={f[:value]} label="Value" autofocus={@operation == :edit} /> <.text_field field={f[:value]} label="Value" autofocus={@operation == :edit} />
<.hidden_field field={f[:operation]} value={@operation} /> <.hidden_field field={f[:operation]} value={@operation} />

View file

@ -98,6 +98,7 @@ defmodule LivebookWeb.SessionLive.SecretsComponent do
spellcheck="false" spellcheck="false"
autocomplete="off" autocomplete="off"
phx-debounce="blur" phx-debounce="blur"
class="uppercase"
/> />
<.text_field <.text_field
field={f[:value]} field={f[:value]}