diff --git a/lib/launch_cart/forms/wasm_handler.ex b/lib/launch_cart/forms/wasm_handler.ex index 1acd385..68b43fa 100644 --- a/lib/launch_cart/forms/wasm_handler.ex +++ b/lib/launch_cart/forms/wasm_handler.ex @@ -11,6 +11,7 @@ defmodule LaunchCart.Forms.WasmHandler do @foreign_key_type :binary_id schema "wasm_handlers" do field :wasm, Wasm.Type + field :description, :string belongs_to :form, Form timestamps() @@ -19,8 +20,8 @@ defmodule LaunchCart.Forms.WasmHandler do @doc false def changeset(wasm_handler, attrs) do wasm_handler - |> cast(attrs, [:form_id]) + |> cast(attrs, [:form_id, :description]) |> cast_attachments(attrs, [:wasm], allow_paths: true) - |> validate_required([:form_id]) + |> validate_required([:form_id, :description]) end end diff --git a/lib/launch_cart_web/live/form_live/show.html.heex b/lib/launch_cart_web/live/form_live/show.html.heex index c79d7da..28c66c9 100644 --- a/lib/launch_cart_web/live/form_live/show.html.heex +++ b/lib/launch_cart_web/live/form_live/show.html.heex @@ -30,14 +30,7 @@ <%= live_redirect "View reponses", to: Routes.form_form_responses_path(@socket, :index, @form) %>
-Form responses will be sent to these end points:
- -<.web_hooks id="web-hooks" web-hooks={@form.web_hooks}> - -Form responses will be sent to these email addresses:
- -<.form_emails id="form-emails" form-emails={@form.form_emails}> - +<.link patch={~p"/forms/#{@form.id}/wasm_handlers"}>WASM Form HandlersUsing your Launch Form is easy!
diff --git a/lib/launch_cart_web/live/wasm_handler_live/form_component.ex b/lib/launch_cart_web/live/wasm_handler_live/form_component.ex index accb3ff..f9f0708 100644 --- a/lib/launch_cart_web/live/wasm_handler_live/form_component.ex +++ b/lib/launch_cart_web/live/wasm_handler_live/form_component.ex @@ -22,6 +22,7 @@ defmodule LaunchCartWeb.WasmHandlerLive.FormComponent do phx-submit="save" > <.input type="hidden" field={@form[:form_id]} value={@form_id} /> + <.input type="text" field={@form[:description]} label="Description" /> <.live_file_input upload={@uploads.wasm}/> <:actions> diff --git a/lib/launch_cart_web/live/wasm_handler_live/index.html.heex b/lib/launch_cart_web/live/wasm_handler_live/index.html.heex index 4d2df42..e38487b 100644 --- a/lib/launch_cart_web/live/wasm_handler_live/index.html.heex +++ b/lib/launch_cart_web/live/wasm_handler_live/index.html.heex @@ -2,7 +2,7 @@ Listing Wasm handlers <:actions> <.link patch={~p"/forms/#{@form_id}/wasm_handlers/new"}> - <.button>New Wasm handler + New WASM Handler @@ -12,7 +12,7 @@ rows={@streams.wasm_handlers} row_click={fn {_id, wasm_handler} -> JS.navigate(~p"/forms/#{@form_id}/wasm_handlers/#{wasm_handler}") end} > - <:col :let={{_id, wasm_handler}} label="Wasm">Filename goes here + <:col :let={{_id, wasm_handler}} label="Description"><%= wasm_handler.description %> <:action :let={{_id, wasm_handler}}>