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

tweak: Suppress automated alerts on pre-fares & DUPs, for October RL maintenance diversion #1887

Merged
merged 1 commit into from
Oct 13, 2023
Merged
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
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
Loading