From 104e1e99a5a303dbdccaaeafd44ecbc4831374fe Mon Sep 17 00:00:00 2001 From: teesloane Date: Sun, 28 Apr 2024 15:58:00 -0400 Subject: [PATCH] Fix: swap pickup notes for rider_notes on campaign singup. --- lib/bike_brigade/delivery/task.ex | 2 ++ .../live/campaign_live/task_form_component.html.heex | 4 +++- .../live/campaign_signup_live/show.html.heex | 6 +++--- .../20240428193130_add_pickup_notes_to_tasks.exs | 9 +++++++++ 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 priv/repo/migrations/20240428193130_add_pickup_notes_to_tasks.exs diff --git a/lib/bike_brigade/delivery/task.ex b/lib/bike_brigade/delivery/task.ex index 6293260d..b46a33e0 100644 --- a/lib/bike_brigade/delivery/task.ex +++ b/lib/bike_brigade/delivery/task.ex @@ -24,6 +24,7 @@ defmodule BikeBrigade.Delivery.Task do :delivery_status_notes, :partner_tracking_id, :rider_notes, + :pickup_notes, :assigned_rider_id, :campaign_id ] @@ -35,6 +36,7 @@ defmodule BikeBrigade.Delivery.Task do schema "tasks" do # TODO: rename to delivery_instructions field :rider_notes, :string + field :pickup_notes, :string field :dropoff_name, :string field :dropoff_phone, EctoPhoneNumber.Canadian diff --git a/lib/bike_brigade_web/live/campaign_live/task_form_component.html.heex b/lib/bike_brigade_web/live/campaign_live/task_form_component.html.heex index b69f74b8..16d785d4 100644 --- a/lib/bike_brigade_web/live/campaign_live/task_form_component.html.heex +++ b/lib/bike_brigade_web/live/campaign_live/task_form_component.html.heex @@ -68,7 +68,9 @@ - <.input type="textarea" field={{f, :rider_notes}} label="Notes" /> + <.input type="textarea" field={{f, :rider_notes}} label="Delivery Notes" /> + + <.input type="textarea" field={{f, :pickup_notes}} label="Pickup Notes" /> <:actions> <.button type="submit" phx-disable-with="Saving...">Save diff --git a/lib/bike_brigade_web/live/campaign_signup_live/show.html.heex b/lib/bike_brigade_web/live/campaign_signup_live/show.html.heex index 82167f74..8f0717d4 100644 --- a/lib/bike_brigade_web/live/campaign_signup_live/show.html.heex +++ b/lib/bike_brigade_web/live/campaign_signup_live/show.html.heex @@ -23,8 +23,8 @@ <:col :let={task} label="Dropoff Neighbourhood"> <%= Locations.neighborhood(task.dropoff_location) %> - <:col :let={task} label="Notes"><%= task.delivery_status_notes %> - <.truncated_riders_notes note={task.rider_notes || "--"} /> + <:col :let={task} label="Pickup Notes"> + <.truncated_riders_notes note={task.pickup_notes || "--"} /> <:action :let={task}> <.signup_button id="signup-btn-desktop" @@ -57,7 +57,7 @@
Notes: - <%= t.rider_notes %> + <%= t.pickup_notes %>
diff --git a/priv/repo/migrations/20240428193130_add_pickup_notes_to_tasks.exs b/priv/repo/migrations/20240428193130_add_pickup_notes_to_tasks.exs new file mode 100644 index 00000000..94b90501 --- /dev/null +++ b/priv/repo/migrations/20240428193130_add_pickup_notes_to_tasks.exs @@ -0,0 +1,9 @@ +defmodule BikeBrigade.Repo.Migrations.AddPickupNotesToTasks do + use Ecto.Migration + + def change do + alter table(:tasks) do + add :pickup_notes, :text + end + end +end