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

feat: Elevator evergreen content #2318

Merged
merged 2 commits into from
Nov 26, 2024
Merged

Conversation

cmaddox5
Copy link
Contributor

@cmaddox5 cmaddox5 commented Nov 26, 2024

Adds evergreen content support on elevator screens. Assuming Screens.Util.Assets.s3_asset_url/1 points at the screens-dev-green bucket, you can use the following config to test:

{
  "ELE-101": {
    "disabled": false,
    "name": "",
    "app_id": "elevator_v2",
    "app_params": {
      "evergreen_content": [
        {
          "priority": [0],
          "slot_names": ["header"],
          "asset_path": "images/elevator/header_test.png",
          "schedule": [
            {
              "start_dt": null,
              "end_dt": null
            }
          ],
          "text_for_audio": null,
          "audio_priority": null
        },
        {
          "priority": [0],
          "slot_names": ["main_content"],
          "asset_path": "images/elevator/main_content_test.png",
          "schedule": [
            {
              "start_dt": null,
              "end_dt": null
            }
          ],
          "text_for_audio": null,
          "audio_priority": null
        },
        {
          "priority": [0],
          "slot_names": ["footer"],
          "asset_path": "images/elevator/footer_test.png",
          "schedule": [
            {
              "start_dt": null,
              "end_dt": null
            }
          ],
          "text_for_audio": null,
          "audio_priority": null
        }
      ],
      "elevator_id": "842",
      "alternate_direction_text": "Alternate direction text goes here. This is the largest body text class. Use this for shorter sets of directions. Add up to 6 lines at this size",
      "accessible_path_image_url": "images/elevator/maps/forest-hills-map.png",
      "accessible_path_direction_arrow": "e",
      "accessible_path_image_here_coordinates": {
        "x": 151,
        "y": 182
      }
    },
    "device_id": "",
    "hidden_from_screenplay": false,
    "refresh_if_loaded_before": null,
    "tags": [],
    "vendor": "mimo"
  }
}

@cmaddox5 cmaddox5 requested a review from a team as a code owner November 26, 2024 15:11
Copy link
Contributor

@digitalcora digitalcora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌲

lib/screens/v2/candidate_generator/elevator.ex Outdated Show resolved Hide resolved
@cmaddox5 cmaddox5 merged commit 6e25840 into main Nov 26, 2024
11 checks passed
@cmaddox5 cmaddox5 deleted the cm/elevator-evergreen-content branch November 26, 2024 19:54
elevator_closure_instances_fn.(config)
Enum.concat([
header_instance(config, now),
footer_instance(config),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused as to how this works. header_ and footer_instance return a single widget struct, which is not an enumerable, and Enum.concat/1 expects an enum of enums. Doing the equivalent of this call in IEx results in an error:

iex(1)> Enum.concat([:a, :b, [:c, :d], [:e, :f]])
** (Protocol.UndefinedError) protocol Enumerable not implemented for :a of type Atom
    (elixir 1.15.7) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.15.7) lib/enum.ex:166: Enumerable.reduce/3
    (elixir 1.15.7) lib/enum.ex:4387: anonymous fn/3 in Enum.concat_enum/1
    (elixir 1.15.7) lib/enum.ex:2510: Enum."-concat_enum/1-lists^foldl/2-1-"/3
    (elixir 1.15.7) lib/enum.ex:2510: Enum.concat_enum/1
    iex:1: (file)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants