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

Show diversion diagrams in diversion alerts #2067

Closed
wants to merge 24 commits into from

Conversation

anthonyshull
Copy link
Contributor

@@ -0,0 +1,50 @@
defmodule CMS.Page.DiversionsTest do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📓 This is really just a copy of the /page/basic_test.exs. For tests related to the CMS, we have to use the static JSON responses until we rewrite all of the CMS tests.

@@ -11,6 +11,12 @@ defmodule PageTest do
describe "from_api/1" do
test "switches on the node type in the json response and returns the proper page struct" do
assert %Page.Basic{} = Page.from_api(Static.basic_page_response())

diversions_data =
Static.basic_page_response() |> Map.put("field_page_type", [%{"name" => "Diversions"}])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📓 This is just a hacky way of creating a Diversions page without creating a giant JSON blob like all other CMS test pages.

diversion = Factories.Alerts.Alert.build(:alert, effect: :shuttle)
non_diversion = Factories.Alerts.Alert.build(:alert, effect: :delay)

Store.update([diversion, non_diversion], nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📓 We have to use this store until we convert the CMS code to using Mox for this.

@anthonyshull anthonyshull marked this pull request as ready for review May 21, 2024 13:26
@anthonyshull anthonyshull requested review from amaisano and a team as code owners May 21, 2024 13:26
@anthonyshull anthonyshull requested a review from thecristen May 21, 2024 13:26
Copy link
Contributor

@amaisano amaisano left a comment

Choose a reason for hiding this comment

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

Relying on perfectly titled/named files is always risky, but it is an easy hack for now.

assets/css/_alerts.scss Outdated Show resolved Hide resolved
lib/alerts/repo.ex Outdated Show resolved Hide resolved
@anthonyshull anthonyshull force-pushed the ags/alerts-diversions branch 2 times, most recently from 763122d to e4bc4b8 Compare May 22, 2024 17:21
@thecristen thecristen added the dev-blue Deploy to dev-blue label Jun 17, 2024
@thecristen thecristen removed the dev-blue Deploy to dev-blue label Jun 18, 2024
@anthonyshull anthonyshull added the dev-green Deploy to dev-green label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants