diff --git a/lib/beacon/loader/error_module_loader.ex b/lib/beacon/loader/error_module_loader.ex index 9770d851..785e2e8a 100644 --- a/lib/beacon/loader/error_module_loader.ex +++ b/lib/beacon/loader/error_module_loader.ex @@ -6,7 +6,6 @@ defmodule Beacon.Loader.ErrorModuleLoader do def load_error_pages!(error_pages, site) do error_module = Loader.error_module_for_site(site) - component_module = Loader.component_module_for_site(site) layout_functions = Enum.map(error_pages, &build_layout_fn/1) render_functions = Enum.map(error_pages, &build_render_fn(&1, error_module)) @@ -16,16 +15,12 @@ defmodule Beacon.Loader.ErrorModuleLoader do use Phoenix.HTML require EEx import Phoenix.Component - unquote(Loader.maybe_import_my_component(component_module, render_functions ++ layout_functions)) require Logger - # One function per error page unquote_splicing(layout_functions) - - # One function per error page unquote_splicing(render_functions) - # Catch-all for error which do not have an ErrorPage defined + # catch-all for error which do not have an ErrorPage defined def render(var!(conn), var!(status)) do _ = var!(conn) Logger.warning("missing error page for #{unquote(site)} status #{var!(status)}") diff --git a/test/beacon/loader/error_module_loader_test.exs b/test/beacon/loader/error_module_loader_test.exs index 7cc97ef6..88768dc0 100644 --- a/test/beacon/loader/error_module_loader_test.exs +++ b/test/beacon/loader/error_module_loader_test.exs @@ -26,7 +26,6 @@ defmodule Beacon.Loader.ErrorModuleLoaderTest do end setup %{conn: conn} do - component_fixture(site: @site) :ok = Beacon.Loader.populate_layouts(@site) :ok = Beacon.Loader.populate_error_pages(@site) error_module = load_error_pages_module(@site) @@ -70,22 +69,6 @@ defmodule Beacon.Loader.ErrorModuleLoaderTest do assert error_module.layout(501, %{inner_content: error_page.template}) == {:safe, ["#custom_layout#", "error_501"]} end - test "user-defined component in layout" do - layout = published_layout_fixture(template: ~S|<%= my_component("sample_component", val: 1 )%><%= @inner_content %>|, site: @site) - error_page = error_page_fixture(layout: layout, template: "error", status: 502, site: @site) - error_module = load_error_pages_module(@site) - - assert error_module.layout(502, %{inner_content: error_page.template}) == {:safe, ["1", "error"]} - end - - test "user-defined component in page" do - layout = published_layout_fixture(template: ~S|<%= @inner_content %>|, site: @site) - error_page = error_page_fixture(layout: layout, template: ~S|<%= my_component("sample_component", val: 1) %>|, status: 503, site: @site) - error_module = load_error_pages_module(@site) - - assert error_module.layout(503, %{inner_content: error_page.template}) == {:safe, ["1", "error"]} - end - test "default error pages", %{conn: conn, error_module: error_module} do expected = ~S"""