From aac3c04c1bcf3a83592e1ce543bc875e97a0c5e6 Mon Sep 17 00:00:00 2001 From: MelchiorKokernoot Date: Thu, 28 Nov 2024 12:56:53 +0000 Subject: [PATCH] fix: change deprecated calls to recommended fixes --- core/frameworks/pixel/create.ex | 4 ++-- core/lib/core/persister.ex | 2 +- core/systems/account/signup_page.ex | 2 +- core/systems/admin/org_view.ex | 4 ++-- core/systems/advert/promotion_landing_page_builder.ex | 2 +- core/systems/assignment/alliance_callback_page_builder.ex | 2 +- core/systems/home/available_view.ex | 2 +- core/systems/project/node_page.ex | 2 +- core/systems/project/overview_page.ex | 2 +- core/systems/support/helpdesk_form.ex | 2 +- core/systems/support/ticket_page.ex | 4 ++-- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/core/frameworks/pixel/create.ex b/core/frameworks/pixel/create.ex index b63f7dbb57..d1e429bb85 100644 --- a/core/frameworks/pixel/create.ex +++ b/core/frameworks/pixel/create.ex @@ -3,7 +3,7 @@ defmodule Frameworks.Pixel.Create do Provides support for creating "new" views the Eyra way. """ import Phoenix.Component - import Phoenix.LiveView, only: [put_flash: 3, push_redirect: 2] + import Phoenix.LiveView, only: [put_flash: 3, push_navigate: 2] alias Phoenix.LiveView.Socket @callback create(socket :: Socket.t(), changeset :: any()) :: any() @@ -20,7 +20,7 @@ defmodule Frameworks.Pixel.Create do def create(module, socket, changeset) do case module.create(socket, changeset) do {:ok, redirect_path} -> - {:noreply, socket |> push_redirect(to: redirect_path, replace: true)} + {:noreply, socket |> push_navigate(to: redirect_path, replace: true)} {:error, %Ecto.Changeset{} = changeset} -> handle_validation_error(socket, changeset) diff --git a/core/lib/core/persister.ex b/core/lib/core/persister.ex index 7e19a69ffe..1f894c019e 100644 --- a/core/lib/core/persister.ex +++ b/core/lib/core/persister.ex @@ -8,7 +8,7 @@ defimpl Core.Persister, for: Any do require Logger def save(_any, changeset) do - Logger.warn("falling back to any persister") + Logger.warning("falling back to any persister") Core.Repo.update(changeset) end end diff --git a/core/systems/account/signup_page.ex b/core/systems/account/signup_page.ex index 60bfaa3cf0..bc25acbdd3 100644 --- a/core/systems/account/signup_page.ex +++ b/core/systems/account/signup_page.ex @@ -59,7 +59,7 @@ defmodule Systems.Account.SignupPage do {:noreply, socket |> put_flash(:info, dgettext("eyra-user", "account.created.successfully")) - |> push_redirect(to: ~p"/user/await-confirmation")} + |> push_navigate(to: ~p"/user/await-confirmation")} end end diff --git a/core/systems/admin/org_view.ex b/core/systems/admin/org_view.ex index b4c97c9f07..453cc64262 100644 --- a/core/systems/admin/org_view.ex +++ b/core/systems/admin/org_view.ex @@ -145,7 +145,7 @@ defmodule Systems.Admin.OrgView do @impl true def handle_event("handle_item_click", %{"item" => org_id}, socket) do - {:noreply, push_redirect(socket, to: ~p"/org/node/#{org_id}")} + {:noreply, push_navigate(socket, to: ~p"/org/node/#{org_id}")} end @impl true @@ -163,7 +163,7 @@ defmodule Systems.Admin.OrgView do { :noreply, socket - |> push_redirect(to: ~p"/org/node/#{org_id}") + |> push_navigate(to: ~p"/org/node/#{org_id}") } end diff --git a/core/systems/advert/promotion_landing_page_builder.ex b/core/systems/advert/promotion_landing_page_builder.ex index 7a5d3e48d0..04378170b2 100644 --- a/core/systems/advert/promotion_landing_page_builder.ex +++ b/core/systems/advert/promotion_landing_page_builder.ex @@ -83,6 +83,6 @@ defmodule Systems.Advert.PromotionLandingPageBuilder do ) do Pool.Public.add_participant!(pool, user) Promotion.Private.log_performance_event(promotion, :clicks) - LiveView.push_redirect(socket, to: ~p"/assignment/#{id}/apply") + LiveView.push_navigate(socket, to: ~p"/assignment/#{id}/apply") end end diff --git a/core/systems/assignment/alliance_callback_page_builder.ex b/core/systems/assignment/alliance_callback_page_builder.ex index 9a15a8931b..7c387afef8 100644 --- a/core/systems/assignment/alliance_callback_page_builder.ex +++ b/core/systems/assignment/alliance_callback_page_builder.ex @@ -49,6 +49,6 @@ defmodule Systems.Assignment.AllianceCallbackPageBuilder do end def handle_forward(%{assigns: %{current_user: user}} = socket) do - LiveView.push_redirect(socket, to: Account.Public.start_page_path(user)) + LiveView.push_navigate(socket, to: Account.Public.start_page_path(user)) end end diff --git a/core/systems/home/available_view.ex b/core/systems/home/available_view.ex index b9fdf9b17e..d44198068f 100644 --- a/core/systems/home/available_view.ex +++ b/core/systems/home/available_view.ex @@ -20,7 +20,7 @@ defmodule Systems.Home.AvailableView do ) do card_id = String.to_integer(card_id) %{path: path} = Enum.find(cards, &(&1.id == card_id)) - {:noreply, push_redirect(socket, to: path)} + {:noreply, push_navigate(socket, to: path)} end @impl true diff --git a/core/systems/project/node_page.ex b/core/systems/project/node_page.ex index c41e4c4692..15cdb36c0b 100644 --- a/core/systems/project/node_page.ex +++ b/core/systems/project/node_page.ex @@ -85,7 +85,7 @@ defmodule Systems.Project.NodePage do ) do card_id = String.to_integer(card_id) %{path: path} = Enum.find(item_cards ++ node_cards, &(&1.id == card_id)) - {:noreply, push_redirect(socket, to: path)} + {:noreply, push_navigate(socket, to: path)} end @impl true diff --git a/core/systems/project/overview_page.ex b/core/systems/project/overview_page.ex index 71cdfb8099..1ac47430eb 100644 --- a/core/systems/project/overview_page.ex +++ b/core/systems/project/overview_page.ex @@ -68,7 +68,7 @@ defmodule Systems.Project.OverviewPage do ) do card_id = String.to_integer(card_id) %{path: path} = Enum.find(cards, &(&1.id == card_id)) - {:noreply, push_redirect(socket, to: path)} + {:noreply, push_navigate(socket, to: path)} end @impl true diff --git a/core/systems/support/helpdesk_form.ex b/core/systems/support/helpdesk_form.ex index 5b84b4374e..8a73e5c2c4 100644 --- a/core/systems/support/helpdesk_form.ex +++ b/core/systems/support/helpdesk_form.ex @@ -49,7 +49,7 @@ defmodule Systems.Support.HelpdeskForm do {:noreply, socket |> put_flash(:info, dgettext("eyra-support", "ticket_created.info.flash")) - |> push_redirect(to: Account.Public.start_page_path(user))} + |> push_navigate(to: Account.Public.start_page_path(user))} {:error, changeset} -> {:noreply, assign(socket, :changeset, changeset)} diff --git a/core/systems/support/ticket_page.ex b/core/systems/support/ticket_page.ex index 1c901416d2..8abca8bbf5 100644 --- a/core/systems/support/ticket_page.ex +++ b/core/systems/support/ticket_page.ex @@ -24,13 +24,13 @@ defmodule Systems.Support.TicketPage do @impl true def handle_event("close_ticket", _params, %{assigns: %{id: id}} = socket) do Support.Public.close_ticket_by_id(id) - {:noreply, push_redirect(socket, to: ~p"/support/ticket")} + {:noreply, push_navigate(socket, to: ~p"/support/ticket")} end @impl true def handle_event("reopen_ticket", _params, %{assigns: %{id: id}} = socket) do Support.Public.reopen_ticket_by_id(id) - {:noreply, push_redirect(socket, to: ~p"/support/ticket")} + {:noreply, push_navigate(socket, to: ~p"/support/ticket")} end @impl true