From a007055c26ba2f9895d2542577f7c0cd0a7a471d Mon Sep 17 00:00:00 2001 From: Jamil Bou Kheir Date: Tue, 7 Sep 2021 13:20:50 -0700 Subject: [PATCH 1/4] Update dependencies --- .tool-versions | 4 ++-- apps/fz_http/mix.exs | 3 ++- mix.lock | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.tool-versions b/.tool-versions index 78588a5d9..4bc29d370 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,4 +1,4 @@ nodejs 16.6.2 -elixir 1.12.2-otp-24 -erlang 24.0.5 +elixir 1.12.3-otp-24 +erlang 24.0.6 ruby 2.7.4 diff --git a/apps/fz_http/mix.exs b/apps/fz_http/mix.exs index 9593b3264..38b862b0a 100644 --- a/apps/fz_http/mix.exs +++ b/apps/fz_http/mix.exs @@ -58,12 +58,13 @@ defmodule FzHttp.MixProject do {:ecto_network, "~> 1.3"}, {:inflex, "~> 2.1"}, {:plug, "~> 1.12"}, - {:postgrex, "~> 0.15"}, + {:postgrex, "~> 0.15.10"}, {:phoenix_html, "~> 3.0"}, {:phoenix_live_reload, "~> 1.3", only: :dev}, {:phoenix_live_view, "~> 0.16"}, {:gettext, "~> 0.18"}, {:jason, "~> 1.2"}, + {:telemetry, "~> 0.4.3"}, {:plug_cowboy, "~> 2.5"}, {:credo, "~> 1.5", only: [:dev, :test], runtime: false} ] diff --git a/mix.lock b/mix.lock index af97bbd10..fe3bfbecd 100644 --- a/mix.lock +++ b/mix.lock @@ -32,16 +32,16 @@ "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mime": {:hex, :mime, "2.0.1", "0de4c81303fe07806ebc2494d5321ce8fb4df106e34dd5f9d787b637ebadc256", [:mix], [], "hexpm", "7a86b920d2aedce5fb6280ac8261ac1a739ae6c1a1ad38f5eadf910063008942"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"}, - "mix_test_watch": {:hex, :mix_test_watch, "1.0.3", "63d5b21e9278abf519f359e6d59aed704ed3c72ec38be6ab22306ae5dc9a2e06", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "7352e91952d9748fb4f8aebe0a60357cdaf4bd6d6c42b5139c78fbcda6a0d7a2"}, + "mix_test_watch": {:hex, :mix_test_watch, "1.1.0", "330bb91c8ed271fe408c42d07e0773340a7938d8a0d281d57a14243eae9dc8c3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}], "hexpm", "52b6b1c476cbb70fd899ca5394506482f12e5f6b0d6acff9df95c7f1e0812ec3"}, "parse_trans": {:hex, :parse_trans, "3.3.1", "16328ab840cc09919bd10dab29e431da3af9e9e7e7e6f0089dd5a2d2820011d8", [:rebar3], [], "hexpm", "07cd9577885f56362d414e8c4c4e6bdf10d43a8767abb92d24cbe8b24c54888b"}, "phoenix": {:hex, :phoenix, "1.5.12", "75fddb14c720388eea93d33886166a690416a7ff8633fbd93f364355b6fe1166", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_html, "~> 2.13 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:plug, "~> 1.10", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 1.0 or ~> 2.2", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.1.2 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8f0ae6734fcc18bbaa646c161e2febc46fb899eae43f82679b92530983324113"}, "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.0", "0672ed4e4808b3fbed494dded89958e22fb882de47a97634c0b13e7b0b5f7720", [:mix], [{:ecto, "~> 3.3", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "09864e558ed31ee00bd48fcc1d4fc58ae9678c9e81649075431e69dbabb43cc1"}, - "phoenix_html": {:hex, :phoenix_html, "3.0.2", "0d71bd7dfa5fad2103142206e25e16accd64f41bcbd0002af3f0da17e530968d", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "d6c6e85d9bef8d52a5a66fcccd15529651f379eaccbf10500343a17f6f814f82"}, + "phoenix_html": {:hex, :phoenix_html, "3.0.3", "32812d70841c7e975e01edb591989b2b002b69797db1005b8d0adc1fe717be30", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "e8152ae9e8c60705659761edb8d8c4bb7e29130a9b0803ec1854fe137ec62dde"}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.3.3", "3a53772a6118d5679bf50fc1670505a290e32a1d195df9e069d8c53ab040c054", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "766796676e5f558dbae5d1bdb066849673e956005e3730dfd5affd7a6da4abac"}, "phoenix_live_view": {:hex, :phoenix_live_view, "0.16.0", "913d5a51b72fb6035762a4b443f22b515b4047b9872f82cb9afe44df850ee968", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.5.9 or ~> 1.6.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.0.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "eed6ba0aae9dd3936b72b46444e580896d740c0dc1d4c42049fb95ea5009db3c"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.0.0", "a1ae76717bb168cdeb10ec9d92d1480fec99e3080f011402c0a2d68d47395ffb", [:mix], [], "hexpm", "c52d948c4f261577b9c6fa804be91884b381a7f8f18450c5045975435350f771"}, "plug": {:hex, :plug, "1.12.0", "39dc7f1ef8c46bb1bf6dd8f6a49f526c45b4b92ce553687fd885b559a46d0230", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5282c76e89efdf43f2e04bd268ca99d738039f9518137f02ff468cee3ba78096"}, - "plug_cowboy": {:hex, :plug_cowboy, "2.5.0", "51c998f788c4e68fc9f947a5eba8c215fbb1d63a520f7604134cab0270ea6513", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "5b2c8925a5e2587446f33810a58c01e66b3c345652eeec809b76ba007acde71a"}, + "plug_cowboy": {:hex, :plug_cowboy, "2.5.2", "62894ccd601cf9597e2c23911ff12798a8a18d237e9739f58a6b04e4988899fe", [:mix], [{:cowboy, "~> 2.7", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowboy_telemetry, "~> 0.3", [hex: :cowboy_telemetry, repo: "hexpm", optional: false]}, {:plug, "~> 1.7", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "ea6e87f774c8608d60c8d34022a7d073bd7680a0a013f049fc62bf35efea1044"}, "plug_crypto": {:hex, :plug_crypto, "1.2.2", "05654514ac717ff3a1843204b424477d9e60c143406aa94daf2274fdd280794d", [:mix], [], "hexpm", "87631c7ad914a5a445f0a3809f99b079113ae4ed4b867348dd9eec288cecb6db"}, "postgrex": {:hex, :postgrex, "0.15.10", "2809dee1b1d76f7cbabe570b2a9285c2e7b41be60cf792f5f2804a54b838a067", [:mix], [{:connection, "~> 1.0", [hex: :connection, repo: "hexpm", optional: false]}, {: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]}], "hexpm", "1560ca427542f6b213f8e281633ae1a3b31cdbcd84ebd7f50628765b8f6132be"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, From fbda97e2b7b83d27c7804a562fe271daf661821b Mon Sep 17 00:00:00 2001 From: Jamil Bou Kheir Date: Tue, 7 Sep 2021 14:00:58 -0700 Subject: [PATCH 2/4] Transitioning to heex --- ...ent.html.leex => form_component.html.heex} | 4 +- .../{show.html.leex => show.html.heex} | 0 ...ent.html.leex => form_component.html.heex} | 4 +- .../{index.html.leex => index.html.heex} | 2 +- .../{show.html.leex => show.html.heex} | 3 +- .../{index.html.leex => index.html.heex} | 0 ...tml.leex => rule_list_component.html.heex} | 4 +- .../fz_http_web/live/user_live/new.html.leex | 54 ------------------- .../fz_http_web/live/user_live/new_live.ex | 28 ---------- .../layout/{auth.html.leex => auth.html.heex} | 2 +- .../layout/{live.html.leex => live.html.heex} | 0 .../layout/{root.html.leex => root.html.heex} | 2 +- apps/fz_http/mix.exs | 2 +- mix.lock | 4 +- 14 files changed, 14 insertions(+), 95 deletions(-) rename apps/fz_http/lib/fz_http_web/live/account_live/{form_component.html.leex => form_component.html.heex} (93%) rename apps/fz_http/lib/fz_http_web/live/account_live/{show.html.leex => show.html.heex} (100%) rename apps/fz_http/lib/fz_http_web/live/device_live/{form_component.html.leex => form_component.html.heex} (82%) rename apps/fz_http/lib/fz_http_web/live/device_live/{index.html.leex => index.html.heex} (86%) rename apps/fz_http/lib/fz_http_web/live/device_live/{show.html.leex => show.html.heex} (95%) rename apps/fz_http/lib/fz_http_web/live/rule_live/{index.html.leex => index.html.heex} (100%) rename apps/fz_http/lib/fz_http_web/live/rule_live/{rule_list_component.html.leex => rule_list_component.html.heex} (92%) delete mode 100644 apps/fz_http/lib/fz_http_web/live/user_live/new.html.leex delete mode 100644 apps/fz_http/lib/fz_http_web/live/user_live/new_live.ex rename apps/fz_http/lib/fz_http_web/templates/layout/{auth.html.leex => auth.html.heex} (96%) rename apps/fz_http/lib/fz_http_web/templates/layout/{live.html.leex => live.html.heex} (100%) rename apps/fz_http/lib/fz_http_web/templates/layout/{root.html.leex => root.html.heex} (98%) diff --git a/apps/fz_http/lib/fz_http_web/live/account_live/form_component.html.leex b/apps/fz_http/lib/fz_http_web/live/account_live/form_component.html.heex similarity index 93% rename from apps/fz_http/lib/fz_http_web/live/account_live/form_component.html.leex rename to apps/fz_http/lib/fz_http_web/live/account_live/form_component.html.heex index 2c9a1e6ca..97af90b5e 100644 --- a/apps/fz_http/lib/fz_http_web/live/account_live/form_component.html.leex +++ b/apps/fz_http/lib/fz_http_web/live/account_live/form_component.html.heex @@ -1,4 +1,4 @@ -<%= f = form_for @changeset, "#", [id: "account-edit", phx_target: @myself, phx_submit: "save"] %> +<.form let={f} for={@changeset} id="account-edit" phx-target={@myself} phx-submit="save">

Change email or enter new password below.

@@ -59,4 +59,4 @@ - + diff --git a/apps/fz_http/lib/fz_http_web/live/account_live/show.html.leex b/apps/fz_http/lib/fz_http_web/live/account_live/show.html.heex similarity index 100% rename from apps/fz_http/lib/fz_http_web/live/account_live/show.html.leex rename to apps/fz_http/lib/fz_http_web/live/account_live/show.html.heex diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/form_component.html.leex b/apps/fz_http/lib/fz_http_web/live/device_live/form_component.html.heex similarity index 82% rename from apps/fz_http/lib/fz_http_web/live/device_live/form_component.html.leex rename to apps/fz_http/lib/fz_http_web/live/device_live/form_component.html.heex index f3ea7a3a0..c7502aefd 100644 --- a/apps/fz_http/lib/fz_http_web/live/device_live/form_component.html.leex +++ b/apps/fz_http/lib/fz_http_web/live/device_live/form_component.html.heex @@ -1,4 +1,4 @@ -<%= f = form_for(@changeset, "#", [id: "edit-device", phx_target: @myself, phx_submit: "save"]) %> +<.form let={f} for={@changeset} id="edit-device" phx-target={@myself} phx-submit="save">
<%= label f, :name, class: "label" %> @@ -20,4 +20,4 @@
- + diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/index.html.leex b/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex similarity index 86% rename from apps/fz_http/lib/fz_http_web/live/device_live/index.html.leex rename to apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex index bd52e8c67..64663e3bd 100644 --- a/apps/fz_http/lib/fz_http_web/live/device_live/index.html.leex +++ b/apps/fz_http/lib/fz_http_web/live/device_live/index.html.heex @@ -14,7 +14,7 @@ <%= for device <- @devices do %> - <%= live_redirect(device.name, to: Routes.device_show_path(@socket, :show, device)) %> + <%= live_patch(device.name, to: Routes.device_show_path(@socket, :show, device)) %> <%= device.public_key %> <%= device.remote_ip || "Never connected" %> diff --git a/apps/fz_http/lib/fz_http_web/live/device_live/show.html.leex b/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex similarity index 95% rename from apps/fz_http/lib/fz_http_web/live/device_live/show.html.leex rename to apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex index 4292a9bb3..d9deb710d 100644 --- a/apps/fz_http/lib/fz_http_web/live/device_live/show.html.leex +++ b/apps/fz_http/lib/fz_http_web/live/device_live/show.html.heex @@ -1,3 +1,4 @@ +<%= @page_heading %> <%= if @live_action == :edit do %> <%= live_modal( FzHttpWeb.DeviceLive.FormComponent, @@ -63,7 +64,7 @@
- <%= live_redirect("Back to Devices", to: Routes.device_index_path(@socket, :index), class: "button") %> + <%= live_patch("Back to Devices", to: Routes.device_index_path(@socket, :index), class: "button") %>
<% end %> -
<%= @inner_content %>
diff --git a/apps/fz_http/lib/fz_http_web/templates/layout/root.html.heex b/apps/fz_http/lib/fz_http_web/templates/layout/root.html.heex index fc1e4fa48..b07bec4bb 100644 --- a/apps/fz_http/lib/fz_http_web/templates/layout/root.html.heex +++ b/apps/fz_http/lib/fz_http_web/templates/layout/root.html.heex @@ -5,7 +5,7 @@ <%= csrf_meta_tag() %> - <%= live_title_tag assigns[:page_heading], prefix: "FireZone • " %> + <%= live_title_tag assigns[:page_title], prefix: "FireZone • " %> @@ -72,7 +72,7 @@