diff --git a/assets/css/screen-simulation.scss b/assets/css/screen-simulation.scss index 77c379e68..bbabdf7f9 100644 --- a/assets/css/screen-simulation.scss +++ b/assets/css/screen-simulation.scss @@ -4,41 +4,6 @@ margin-top: 16px; overflow: hidden; - // The below values are "height of the iframe's container", which is different than the iframe content - - // V2 apps don't need the height set - - &--bus_eink, - &--gl_eink_double { - height: 480px; - width: 180px; - background-color: white; - box-shadow: 0px 0px 32px 0px #00000040; - margin-bottom: 12px; - } - - &--gl_eink_single { - height: 240px; - width: 180px; - background-color: white; - box-shadow: 0px 0px 32px 0px #00000040; - margin-bottom: 12px; - } - - &--pa_ess { - min-height: 100px; - display: flex; - justify-content: center; - padding-bottom: 20px; - } - - &--solari { - height: 344px; - width: 194px; - box-shadow: 0px 0px 32px 0px #00000040; - margin-bottom: 12px; - } - .screen-simulation__iframe { // DUP, PreFare, Bus Shelter, and Eink v2s all could have scrollbars, // so height adjusted to fit @@ -59,22 +24,6 @@ height: 515px; } - &--bus_eink, - &--gl_eink_double { - height: 3200px; - width: 1200px; - transform: scale(15%); - transform-origin: top left; - } - - &--gl_eink_single { - height: 1600px; - width: 1200px; - transform: scale(15%); - transform-origin: top left; - } - - &--dup, &--dup_v2 { height: 195px; } @@ -83,12 +32,5 @@ height: 80px; width: 250px; } - - &--solari { - height: 1920px; - width: 1080px; - transform: scale(17.92%); - transform-origin: top left; - } } } diff --git a/assets/js/components/Dashboard/PlaceRow.tsx b/assets/js/components/Dashboard/PlaceRow.tsx index c1b23a4e1..8ca1ce469 100644 --- a/assets/js/components/Dashboard/PlaceRow.tsx +++ b/assets/js/components/Dashboard/PlaceRow.tsx @@ -22,14 +22,9 @@ const typeMap: Record = { pa_ess: "PA", bus_shelter_v2: "Bus Shelter", pre_fare_v2: "Prefare", - dup: "DUP", dup_v2: "DUP", - gl_eink_single: "GL E-Ink", - gl_eink_double: "GL E-Ink", gl_eink_v2: "GL E-Ink", - bus_eink: "Bus E-Ink", bus_eink_v2: "Bus E-Ink", - solari: "Sectional", busway_v2: "Sectional", elevator_v2: "Elevator", }; diff --git a/assets/js/components/Dashboard/PlaceRowAccordion.tsx b/assets/js/components/Dashboard/PlaceRowAccordion.tsx index 173f2113e..8c363f632 100644 --- a/assets/js/components/Dashboard/PlaceRowAccordion.tsx +++ b/assets/js/components/Dashboard/PlaceRowAccordion.tsx @@ -23,7 +23,7 @@ type ScreenGroup = { }; const groupScreens = (screens: Screen[]): ScreenGroup[] => { - const inlineScreenTypes = ["busway_v2", "solari", "elevator_v2"]; + const inlineScreenTypes = ["busway_v2", "elevator_v2"]; const inlineScreens = screens.filter((screen) => inlineScreenTypes.includes(screen.type), diff --git a/assets/js/components/Dashboard/ScreenDetailHeader.tsx b/assets/js/components/Dashboard/ScreenDetailHeader.tsx index 2009608da..28220ebb7 100644 --- a/assets/js/components/Dashboard/ScreenDetailHeader.tsx +++ b/assets/js/components/Dashboard/ScreenDetailHeader.tsx @@ -17,7 +17,7 @@ const ScreenDetailHeader = (props: ScreenDetailHeaderProps): JSX.Element => {
{props.translatedScreenType} {props.screenLocation} - {["dup", "dup_v2"].includes(props.screen.type) && ( + {props.screen.type === "dup_v2" && (
Cycle in the ad loop for 7.5 seconds every 45 seconds
@@ -31,26 +31,12 @@ const ScreenDetailHeader = (props: ScreenDetailHeaderProps): JSX.Element => { ); }; -const generateSource = (screen: Screen) => { - const { id, type } = screen; - // @ts-ignore Suppressing "object could be null" warning +const generateSource = ({ id }: Screen) => { const screensUrl = document .querySelector("meta[name=screens-url]") ?.getAttribute("content"); - if (type.includes("v2")) { - return `${screensUrl}/v2/screen/${id}`; - } - if (["bus_eink", "gl_eink_single", "gl_eink_double"].includes(type)) { - return `${screensUrl}/screen/${id}`; - } - if (type === "solari") { - // Solari app disables scrolling unless this param is added. - // (Due to quirks of running on a very old browser in the past) - return `${screensUrl}/screen/${id}?scroll=true`; - } - - return ""; + return `${screensUrl}/v2/screen/${id}`; }; export default ScreenDetailHeader; diff --git a/assets/js/components/Dashboard/ScreenSimulation.tsx b/assets/js/components/Dashboard/ScreenSimulation.tsx index 3891e8ba4..2c003fcaf 100644 --- a/assets/js/components/Dashboard/ScreenSimulation.tsx +++ b/assets/js/components/Dashboard/ScreenSimulation.tsx @@ -28,29 +28,15 @@ const ScreenSimulation = ({ ); }; -const generateSource = (screen: Screen, isPending: boolean) => { - const { id, type } = screen; - // @ts-ignore Suppressing "object could be null" warning +const generateSource = ({ id }: Screen, isPending: boolean) => { const screensUrl = document .querySelector("meta[name=screens-url]") ?.getAttribute("content"); const queryParams = "requestor=screenplay"; - if (type.includes("v2")) { - return `${screensUrl}/v2/screen${ - isPending ? "/pending/" : "/" - }${id}/simulation?${queryParams}`; - } - if ( - ["bus_eink", "gl_eink_single", "gl_eink_double", "solari"].includes(type) - ) { - return `${screensUrl}/screen/${id}?${queryParams}`; - } - if (type === "dup") { - return `${screensUrl}/screen/${id}/simulation?${queryParams}`; - } - - return ""; + return `${screensUrl}/v2/screen${ + isPending ? "/pending/" : "/" + }${id}/simulation?${queryParams}`; }; export default ScreenSimulation; diff --git a/assets/js/constants/constants.ts b/assets/js/constants/constants.ts index 9a54d2e19..3fe70b479 100644 --- a/assets/js/constants/constants.ts +++ b/assets/js/constants/constants.ts @@ -44,16 +44,13 @@ export const SORT_LABELS: Record = { export const SCREEN_TYPES: { label: string; ids: string[] }[] = [ { label: "All SCREEN TYPES", ids: ["All"] }, { label: "Bus Shelter", ids: ["bus_shelter_v2"] }, - { label: "DUP", ids: ["dup", "dup_v2"] }, - { label: "E-Ink: Bus", ids: ["bus_eink", "bus_eink_v2"] }, - { - label: "E-Ink: Green Line", - ids: ["gl_eink_single", "gl_eink_double", "gl_eink_v2"], - }, + { label: "DUP", ids: ["dup_v2"] }, + { label: "E-Ink: Bus", ids: ["bus_eink_v2"] }, + { label: "E-Ink: Green Line", ids: ["gl_eink_v2"] }, { label: "Elevator", ids: ["elevator_v2"] }, { label: "PA ESS", ids: ["pa_ess"] }, { label: "Pre Fare Duo", ids: ["pre_fare_v2"] }, - { label: "Sectional", ids: ["busway_v2", "solari"] }, + { label: "Sectional", ids: ["busway_v2"] }, ]; export const STATUSES = [ diff --git a/assets/js/util.ts b/assets/js/util.ts index 26abddff0..5f63dc907 100644 --- a/assets/js/util.ts +++ b/assets/js/util.ts @@ -201,15 +201,10 @@ export const signsByDirection = (signs: Screen[]) => { }; const screenTypeOrder = [ - "dup", "dup_v2", "busway_v2", - "solari", "bus_shelter_v2", - "bus_eink", "bus_eink_v2", - "gl_eink_single", - "gl_eink_double", "gl_eink_v2", "pre_fare_v2", "elevator_v2", diff --git a/assets/tests/components/Dashboard/PlacesActionBar.test.tsx b/assets/tests/components/Dashboard/PlacesActionBar.test.tsx index d47441d50..8e88beaf5 100644 --- a/assets/tests/components/Dashboard/PlacesActionBar.test.tsx +++ b/assets/tests/components/Dashboard/PlacesActionBar.test.tsx @@ -10,8 +10,8 @@ describe("PlacesActionBar", () => { routes: ["CR", "Red", "Green-B"], status: "Auto", screens: [ - { id: "1111", type: "dup", disabled: false }, - { id: "2222", type: "solari", disabled: false }, + { id: "1111", type: "dup_v2", disabled: false }, + { id: "2222", type: "busway_v2", disabled: false }, { id: "3333", type: "bus_shelter_v2", disabled: false }, ], }; @@ -22,9 +22,9 @@ describe("PlacesActionBar", () => { routes: ["Green-B"], status: "Auto", screens: [ - { id: "4444", type: "gl_eink_double", disabled: false }, + { id: "4444", type: "gl_eink_v2", disabled: false }, // screen is shared with place-stop1 - { id: "2222", type: "solari", disabled: false }, + { id: "2222", type: "busway_v2", disabled: false }, { id: "5555", type: "paess", disabled: false }, ], }; diff --git a/assets/tests/components/placeRowAccordion.test.tsx b/assets/tests/components/placeRowAccordion.test.tsx index 65fe211eb..a26196a35 100644 --- a/assets/tests/components/placeRowAccordion.test.tsx +++ b/assets/tests/components/placeRowAccordion.test.tsx @@ -19,8 +19,8 @@ describe("PlaceRowAccordion", () => { routes: ["CR", "Red", "Green-B"], status: "Auto", screens: [ - { id: "1111", type: "dup", disabled: false }, - { id: "2222", type: "solari", disabled: false }, + { id: "1111", type: "dup_v2", disabled: false }, + { id: "2222", type: "busway_v2", disabled: false }, { id: "3333", type: "bus_shelter_v2", disabled: false }, ], }; diff --git a/assets/tests/places_and_screens.test.json b/assets/tests/places_and_screens.test.json index 927d5935a..ef0feafa0 100644 --- a/assets/tests/places_and_screens.test.json +++ b/assets/tests/places_and_screens.test.json @@ -23,7 +23,7 @@ "name": "Davis", "routes": ["Bus", "Red"], "screens": [ - { "disabled": false, "id": "Landscape255", "type": "dup" }, + { "disabled": false, "id": "Landscape255", "type": "dup_v2" }, { "id": "davis_mezzanine", "station_code": "RDAV", @@ -101,7 +101,7 @@ "name": "Malden Center", "routes": ["Bus", "CR", "Orange"], "screens": [ - { "disabled": false, "id": "DUP-Malden", "type": "dup" }, + { "disabled": false, "id": "DUP-Malden", "type": "dup_v2" }, { "id": "malden_lobby", "station_code": "OMAL", @@ -312,7 +312,7 @@ "name": "Haymarket", "routes": ["Green-D", "Green-E", "Orange"], "screens": [ - { "disabled": false, "id": "DUP-Haymarket", "type": "dup" }, + { "disabled": false, "id": "DUP-Haymarket", "type": "dup_v2" }, { "id": "orange_haymarket_mezzanine", "station_code": "OHAY", @@ -532,7 +532,7 @@ { "disabled": false, "id": "EIB-101", - "type": "bus_eink" + "type": "bus_eink_v2" } ] }, @@ -544,22 +544,22 @@ { "disabled": true, "id": "EIG-401", - "type": "gl_eink_single" + "type": "gl_eink_v2" }, { "disabled": false, "id": "EIG-404", - "type": "gl_eink_single" + "type": "gl_eink_v2" }, { "disabled": true, "id": "EIG-403", - "type": "gl_eink_single" + "type": "gl_eink_v2" }, { "disabled": true, "id": "EIG-402", - "type": "gl_eink_single" + "type": "gl_eink_v2" } ] }, @@ -571,7 +571,7 @@ { "disabled": false, "id": "MUL-101", - "type": "solari" + "type": "busway_v2" }, { "disabled": false, diff --git a/lib/screenplay/permanent_config.ex b/lib/screenplay/permanent_config.ex index d67e169a5..dc7297f59 100644 --- a/lib/screenplay/permanent_config.ex +++ b/lib/screenplay/permanent_config.ex @@ -453,18 +453,6 @@ defmodule Screenplay.PermanentConfig do screen.app_params.alerts.stop_id end - defp screen_to_place_id(screen = %Screen{app_id: :gl_eink_single}) do - screen.app_params.stop_id - end - - defp screen_to_place_id(%Screen{app_id: solari_v1_app}) - when solari_v1_app in [:solari, :solari_large] do - # Solari screens frequently show info for multiple stop IDs in different sections. - # (Try `jq '.screens | map_values(select(.app_id == "solari")) | map_values(.app_params.sections | map(.query.params.stop_ids))' git/screens/priv/local.json` in your shell to see) - # So there isn't a straightforward implementation for that case, at the moment. - raise("screen_to_place_id/1 not implemented for app_id: #{solari_v1_app}") - end - defp screen_to_place_id(%Screen{app_id: app_id}), do: raise("screen_to_place_id/1 not implemented for app_id: #{app_id}") end diff --git a/lib/screenplay/places/builder.ex b/lib/screenplay/places/builder.ex index f0181bb4b..09c27d10a 100644 --- a/lib/screenplay/places/builder.ex +++ b/lib/screenplay/places/builder.ex @@ -11,7 +11,7 @@ defmodule Screenplay.Places.Builder do alias Screenplay.Places.Place alias Screenplay.Places.Place.{PaEssScreen, ShowtimeScreen} alias Screenplay.ScreensConfig, as: ScreensConfigStore - alias ScreensConfig.{Screen, Solari} + alias ScreensConfig.Screen alias ScreensConfig.V2.Departures.{Query, Section} alias ScreensConfig.V2.{ @@ -112,7 +112,7 @@ defmodule Screenplay.Places.Builder do |> Enum.flat_map(&split_multi_place_screens/1) |> Enum.group_by(&get_stop_id/1, fn {id, - %ScreensConfig.Screen{ + %Screen{ app_id: app_id, disabled: disabled, app_params: %_app{direction_id: direction_id} @@ -124,7 +124,7 @@ defmodule Screenplay.Places.Builder do direction_id: direction_id } - {id, %ScreensConfig.Screen{app_id: app_id, disabled: disabled}} -> + {id, %Screen{app_id: app_id, disabled: disabled}} -> %ShowtimeScreen{id: id, type: app_id, disabled: disabled} end) end @@ -225,12 +225,8 @@ defmodule Screenplay.Places.Builder do stop_id end - defp get_stop_id({_id, %{app_params: %ScreensConfig.Gl{stop_id: stop_id}}}) do - stop_id - end - defp get_stop_id({_id, %{app_id: app_id, stop: stop_id}}) - when app_id in [:solari, :busway_v2, :dup_v2] do + when app_id in [:busway_v2, :dup_v2] do stop_id end @@ -312,30 +308,6 @@ defmodule Screenplay.Places.Builder do stops end - defp split_multi_place_screens( - {id, - %Screen{ - app_id: :solari, - app_params: %Solari{ - sections: sections - } - } = stuff} - ) do - stops = - Enum.flat_map(sections, fn %Solari.Section{ - query: %ScreensConfig.Query{ - params: %ScreensConfig.Query.Params{stop_ids: stop_ids} - } - } -> - stop_ids - end) - |> Enum.map(fn stop_id -> - {id, Map.put(stuff, :stop, stop_id)} - end) - - stops - end - defp split_multi_place_screens(screen) do [screen] end diff --git a/mix.exs b/mix.exs index 5f5268e74..bcd3c7686 100644 --- a/mix.exs +++ b/mix.exs @@ -64,7 +64,7 @@ defmodule Screenplay.MixProject do {:postgrex, ">= 0.0.0"}, {:screens_config, git: "https://github.com/mbta/screens-config-lib.git", - ref: "8ec6e1684a129b089edc5e867a32dfc90028b2e0"}, + ref: "c0db78ecd43c633a55a1f24b268ae7b8a5214748"}, {:mox, "~> 1.0", only: :test}, {:tzdata, "~> 1.1"}, {:ex_machina, "~> 2.7", only: :test}, diff --git a/mix.lock b/mix.lock index e00d56943..128e4eba1 100644 --- a/mix.lock +++ b/mix.lock @@ -52,7 +52,7 @@ "postgrex": {:hex, :postgrex, "0.19.2", "34d6884a332c7bf1e367fc8b9a849d23b43f7da5c6e263def92784d03f9da468", [: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", "618988886ab7ae8561ebed9a3c7469034bf6a88b8995785a3378746a4b9835ec"}, "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", "8ec6e1684a129b089edc5e867a32dfc90028b2e0", [ref: "8ec6e1684a129b089edc5e867a32dfc90028b2e0"]}, + "screens_config": {:git, "https://github.com/mbta/screens-config-lib.git", "c0db78ecd43c633a55a1f24b268ae7b8a5214748", [ref: "c0db78ecd43c633a55a1f24b268ae7b8a5214748"]}, "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"},