Skip to content

Commit

Permalink
Add new on bus screen type
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-sundstrom committed Feb 4, 2025
1 parent fd8fdd5 commit d8b8f62
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 2 deletions.
5 changes: 5 additions & 0 deletions assets/css/screen-simulation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
height: 80px;
width: 250px;
}

&--on_bus_v2 {
height: 379px;
}

}
}
1 change: 1 addition & 0 deletions assets/js/components/Dashboard/PlaceRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const typeMap: Record<string, string> = {
bus_eink_v2: "Bus E-Ink",
busway_v2: "Sectional",
elevator_v2: "Elevator",
on_bus_v2: "On Bus",
};

const inlineMap = (place: Place, line: string) => {
Expand Down
1 change: 1 addition & 0 deletions assets/js/constants/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const SCREEN_TYPES: { label: string; ids: string[] }[] = [
{ label: "E-Ink: Bus", ids: ["bus_eink_v2"] },
{ label: "E-Ink: Green Line", ids: ["gl_eink_v2"] },
{ label: "Elevator", ids: ["elevator_v2"] },
{ label: "On Bus", ids: ["on_bus_v2"]},
{ label: "PA ESS", ids: ["pa_ess"] },
{ label: "Pre Fare Duo", ids: ["pre_fare_v2"] },
{ label: "Sectional", ids: ["busway_v2"] },
Expand Down
1 change: 1 addition & 0 deletions assets/js/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ const screenTypeOrder = [
"pre_fare_v2",
"elevator_v2",
"pa_ess",
"on_bus_v2",
];

export const sortScreens = (screenList: Screen[]) => {
Expand Down
7 changes: 7 additions & 0 deletions lib/screenplay/places/builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defmodule Screenplay.Places.Builder do
Footer,
GlEink,
Header,
OnBus,
PreFare
}

Expand Down Expand Up @@ -236,6 +237,12 @@ defmodule Screenplay.Places.Builder do
stop_id
end

defp get_stop_id(
{_id, %{app_params: %OnBus{evergreen_content: _evergreen_content}}}
) do
""
end

defp split_multi_place_screens(
{id,
%Screen{
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ defmodule Screenplay.MixProject do
{:postgrex, ">= 0.0.0"},
{:screens_config,
git: "https://github.com/mbta/screens-config-lib.git",
ref: "c0db78ecd43c633a55a1f24b268ae7b8a5214748"},
ref: "3e781e39e4dd8bd63a05825534847347e1cbffa9"},
{:mox, "~> 1.0", only: :test},
{:tzdata, "~> 1.1"},
{:ex_machina, "~> 2.7", only: :test},
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"postgrex": {:hex, :postgrex, "0.19.3", "a0bda6e3bc75ec07fca5b0a89bffd242ca209a4822a9533e7d3e84ee80707e19", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "d31c28053655b78f47f948c85bb1cf86a9c1f8ead346ba1aa0d0df017fa05b61"},
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
"remote_ip": {:hex, :remote_ip, "1.2.0", "fb078e12a44414f4cef5a75963c33008fe169b806572ccd17257c208a7bc760f", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "2ff91de19c48149ce19ed230a81d377186e4412552a597d6a5137373e5877cb7"},
"screens_config": {:git, "https://github.com/mbta/screens-config-lib.git", "c0db78ecd43c633a55a1f24b268ae7b8a5214748", [ref: "c0db78ecd43c633a55a1f24b268ae7b8a5214748"]},
"screens_config": {:git, "https://github.com/mbta/screens-config-lib.git", "3e781e39e4dd8bd63a05825534847347e1cbffa9", [ref: "3e781e39e4dd8bd63a05825534847347e1cbffa9"]},
"sentry": {:hex, :sentry, "10.4.0", "d8ffe8ce15b4b53f5e879299c3c222324c289a47a507c0b251c4f91ce7bae9ff", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_options, "~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_ownership, "~> 0.3.0", [hex: :nimble_ownership, repo: "hexpm", optional: false]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "e5f98892152879dc87363b1b7f774eeddb8cf7dddfa7355e40eba188b2cae58a"},
"sftp_client": {:hex, :sftp_client, "2.1.0", "e1de4a116437427cfc4b5b303968655a18ac837514f5ca03d42184ef1d77e6b5", [:mix], [], "hexpm", "b87a6b85454f14a170d7fdc42e5ce3edd699f2795d0f8c65d4e0b3a2ebf0e326"},
"sobelow": {:hex, :sobelow, "0.13.0", "218afe9075904793f5c64b8837cc356e493d88fddde126a463839351870b8d1e", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cd6e9026b85fc35d7529da14f95e85a078d9dd1907a9097b3ba6ac7ebbe34a0d"},
Expand Down
13 changes: 13 additions & 0 deletions test/fixtures/builder/screens_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,19 @@
"hidden_from_screenplay": false,
"vendor": "mimo",
"device_id": ""
},
"ONBUS-101": {
"disabled": false,
"name": "",
"tags": [],
"app_id": "on_bus_v2",
"app_params": {
"evergreen_content": []
},
"refresh_if_loaded_before": null,
"hidden_from_screenplay": false,
"vendor": "hanover",
"device_id": ""
}
}
}

0 comments on commit d8b8f62

Please sign in to comment.