Skip to content
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

Fix: swap pickup notes for rider_notes on campaign singup. #349

Closed
wants to merge 1 commit into from
Closed
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
2 changes: 2 additions & 0 deletions lib/bike_brigade/delivery/task.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
alias BikeBrigade.Delivery.{Campaign, Item, TaskItem}
alias BikeBrigade.Locations.Location

defenum(DeliveryStatusEnum,

Check warning on line 12 in lib/bike_brigade/delivery/task.ex

View workflow job for this annotation

GitHub Actions / Build and test

the underscored variable "_t" is used after being set. A leading underscore indicates that the value of the variable should be ignored. If this is intended please rename the variable to remove the underscore

Check warning on line 12 in lib/bike_brigade/delivery/task.ex

View workflow job for this annotation

GitHub Actions / Build and test

the underscored variable "_t" is used after being set. A leading underscore indicates that the value of the variable should be ignored. If this is intended please rename the variable to remove the underscore
pending: "pending",
picked_up: "picked_up",
completed: "completed",
Expand All @@ -24,6 +24,7 @@
:delivery_status_notes,
:partner_tracking_id,
:rider_notes,
:pickup_notes,
:assigned_rider_id,
:campaign_id
]
Expand All @@ -35,6 +36,7 @@
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@
</.link>
</div>

<.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</.button>
Expand Down
6 changes: 3 additions & 3 deletions lib/bike_brigade_web/live/campaign_signup_live/show.html.heex
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<:col :let={task} label="Dropoff Neighbourhood">
<%= Locations.neighborhood(task.dropoff_location) %>
</:col>
<:col :let={task} label="Notes"><%= task.delivery_status_notes %>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While swapping this, I noticed that for some reasons I added the delivery_status_notes into this html table. 🧹

<.truncated_riders_notes note={task.rider_notes || "--"} /></:col>
<:col :let={task} label="Pickup Notes">
<.truncated_riders_notes note={task.pickup_notes || "--"} /></:col>
<:action :let={task}>
<.signup_button
id="signup-btn-desktop"
Expand Down Expand Up @@ -57,7 +57,7 @@

<div :if={t.rider_notes} class="flex flex-col justify-center px-4 py-2 border-b-2">
<span>Notes:</span>
<span><%= t.rider_notes %></span>
<span><%= t.pickup_notes %></span>
</div>

<div class="flex flex-col justify-center px-4 py-2 border-b-2">
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Loading