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 :errors, :list, default: []
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)
@ -27,7 +28,7 @@ defmodule LivebookWeb.FormComponents do
name={@name}
id={@id || @name}
value={Phoenix.HTML.Form.normalize_value("text", @value)}
class="input"
class={["input", @class]}
{@rest}
/>
</.field_wrapper>

View file

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

View file

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