Skip to content

Commit

Permalink
tweak: Suppress automated alerts on pre-fares & DUPs, for October RL …
Browse files Browse the repository at this point in the history
…maintenance diversion (#1887)
  • Loading branch information
jzimbel-mbta authored Oct 13, 2023
1 parent e5b9ffb commit 2520383
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 6 additions & 1 deletion lib/screens/v2/widget_instance/dup_alert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ defmodule Screens.V2.WidgetInstance.DupAlert do

@spec valid_candidate?(t()) :: boolean()
def valid_candidate?(%__MODULE__{} = t) do
alert_layout(t) != :no_render
# Suppress alerts 519314 and 529291, at all stations served by the Red Line.
suppressed =
t.alert.id in ["519314", "529291"] and
Enum.any?(t.location_context.routes, &(&1[:route_id] == "Red"))

not suppressed and alert_layout(t) != :no_render
end

# Inputs/output are stored as a table for readability.
Expand Down
12 changes: 6 additions & 6 deletions lib/screens/v2/widget_instance/reconstructed_alert.ex
Original file line number Diff line number Diff line change
Expand Up @@ -652,12 +652,12 @@ defmodule Screens.V2.WidgetInstance.ReconstructedAlert do
def alert_ids(%__MODULE__{} = t), do: [t.alert.id]

def valid_candidate?(%__MODULE__{} = t) do
# Suppress alert 519312 at Porter and Charles/MGH
t.alert.id != "519312" or
t.screen.app_params.reconstructed_alert_widget.stop_id not in [
"place-portr",
"place-chmnl"
]
# Suppress alerts 519314 and 529291, at all stations served by the Red Line.
suppressed =
t.alert.id in ["519314", "529291"] and
Enum.any?(t.location_context.routes, &(&1[:route_id] == "Red"))

not suppressed
end

defimpl Screens.V2.WidgetInstance do
Expand Down

0 comments on commit 2520383

Please sign in to comment.