-
Notifications
You must be signed in to change notification settings - Fork 13
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
Output cleanup #2298
Output cleanup #2298
Conversation
<%= if @summary.accessible? do %> | ||
<.icon type="icon-svg" name="icon-accessible-small" class="h-3 w-3 mr-0.5" /> Accessible | ||
<% else %> | ||
<.icon type="icon-svg" name="icon-not-accessible-small" class="h-3 w-3 mr-0.5" /> May not be accessible | ||
<% end %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 Shows the accessible icon or the not accessible icon.
<% price = Fares.Format.price(@summary.total_cost) %> | ||
<div :if={price != ""} class="inline-flex items-center gap-0.5"> | ||
<.icon name="circle" class="h-0.5 w-0.5 mx-1" /> | ||
<.icon name="wallet" class="h-3 w-3" /> | ||
{Fares.Format.price(@summary.total_cost)} | ||
{price} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 If the price is nil
then "" will be returned. If the price is 0 then "Free" will be returned. If we get "" then we don't show the element.
<div class="w-full py-5"> | ||
<.leg_summary leg={@leg} alerts={@alerts.route} /> | ||
<.leg_details leg={@leg} /> | ||
</div> | ||
<% else %> | ||
<details class="w-full my-3 group/stops"> | ||
<details class="w-full py-5 group/stops"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 We just wanted more padding here.
@@ -32,7 +32,7 @@ defmodule DotcomWeb.Components.TripPlanner.WalkingLeg do | |||
</div> | |||
<details class="border-y border-x-0 border-gray-lightest my-3 w-full group"> | |||
<summary class="flex w-full gap-x-3.5 py-3"> | |||
<summary class="flex w-full gap-x-3.5 py-3 cursor-pointer"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 Gives us a cursor pointer on the accordion header.
lib/dotcom_web/live/trip_planner.ex
Outdated
@impl true | ||
# Triggered when we cannot connect to OTP. | ||
def handle_async("get_itinerary_groups", {:ok, {:error, %Req.TransportError{reason: :econnrefused}}}, socket) do | ||
message = "Cannot connect to OpenTripPlanner. Please try again later." | ||
new_socket = assign(socket, :results, Map.put(@state.results, :error, message)) | ||
|
||
{:noreply, new_socket} | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 No ticket for this, I just noticed that if OTP is unreachable, we didn't have a way to handle it.
lib/dotcom_web/live/trip_planner.ex
Outdated
diff = Timex.diff(datetime, future, :minutes) | ||
|
||
if datetime_type != "now" && Timex.before?(datetime, future) do | ||
if datetime_type != "now" && diff < 0 do | ||
push_event(socket, "set-datetime", %{datetime: future}) | ||
else | ||
socket | ||
assign(socket, :input_form, Map.put(socket.assigns.input_form, :changeset, Map.put(socket.assigns.input_form.changeset, :datetime, datetime))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📓 Looks at the old and new time according to the minute so that it doesn't reset if they are just seconds apart...which will happen if we take now
two separate times.
60b5664
to
e5936b6
Compare
@@ -54,5 +54,9 @@ defmodule DotcomWeb.Components.TripPlanner.Place do | |||
""" | |||
end | |||
|
|||
defp format_time(datetime), do: Timex.format!(datetime, "%-I:%M %p", :strftime) | |||
defp format_time(datetime) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: we should make this public somewhere and reuse it in here, DotcomWeb.Components.TripPlanner.ItinerarySummary
, and DotcomWeb.Components.TripPlanner.ItineraryDetail
# Triggered when we cannot connect to OTP. | ||
def handle_async( | ||
"get_itinerary_groups", | ||
{:ok, {:error, %Req.TransportError{reason: :econnrefused}}}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for catching!
Multiple tickets:
https://app.asana.com/0/555089885850811/1209037564056793/f
https://app.asana.com/0/555089885850811/1209037564056805/f
https://app.asana.com/0/555089885850811/1209037564056795/f
https://app.asana.com/0/555089885850811/1209037564056794/f
https://app.asana.com/0/555089885850811/1209016991115327/f
https://app.asana.com/0/555089885850811/1209016991115341/f
https://app.asana.com/0/555089885850811/1209016992377403/f
https://app.asana.com/0/555089885850811/1209037564056792/f