Skip to content

update form field names to match calendly form #3076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/lightning_web/live/book_demo_banner.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ defmodule LightningWeb.BookDemoBanner do
data = %{
name: "#{user.first_name} #{user.last_name}",
email: user.email,
message: nil
a4: nil
}

types = %{name: :string, email: :string, message: :string}
types = %{name: :string, email: :string, a4: :string}

{data, types}
|> Ecto.Changeset.cast(params, Map.keys(types))
Expand Down Expand Up @@ -161,7 +161,7 @@ defmodule LightningWeb.BookDemoBanner do
<.input type="text" field={f[:email]} label="Email" required={true} />
<.input
type="textarea"
field={f[:message]}
field={f[:a4]}
label="What problem are you trying to solve with OpenFn?
What specific task, process, or program would you like to automate?"
placeholder="E.g. Every time a new person is registered in my clinic system, I must initiate a mobile money payment to a caregiver. This takes time & money. I'd like to use OpenFn to automate the process."
Expand Down
6 changes: 3 additions & 3 deletions test/lightning_web/live/book_demo_banner_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ defmodule LightningWeb.BookDemoBannerTest do
%{
"name" => "#{user.first_name} #{user.last_name}",
"email" => user.email,
"message" => expected_message
"a4" => expected_message
}

expected_redirect_url =
Expand All @@ -135,14 +135,14 @@ defmodule LightningWeb.BookDemoBannerTest do

form = view |> form("#book-demo-banner-modal form")

assert render_change(form, demo: %{email: nil, message: expected_message}) =~
assert render_change(form, demo: %{email: nil, a4: expected_message}) =~
"This field can&#39;t be blank"

assert render_submit(form) =~ "This field can&#39;t be blank"

assert {:error, {:redirect, %{to: redirect_to}}} =
render_submit(form,
demo: %{email: user.email, message: expected_message}
demo: %{email: user.email, a4: expected_message}
)

assert redirect_to == expected_redirect_url
Expand Down