Skip to content

Commit

Permalink
fix: change deprecated calls to recommended fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MelchiorKokernoot committed Nov 28, 2024
1 parent 8f3be11 commit aac3c04
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions core/frameworks/pixel/create.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion core/lib/core/persister.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion core/systems/account/signup_page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions core/systems/admin/org_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion core/systems/advert/promotion_landing_page_builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion core/systems/assignment/alliance_callback_page_builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion core/systems/home/available_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/systems/project/node_page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/systems/project/overview_page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/systems/support/helpdesk_form.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Expand Down
4 changes: 2 additions & 2 deletions core/systems/support/ticket_page.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aac3c04

Please sign in to comment.