upgrade to phoenix 1.7
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-04-13 23:29:29 -04:00
parent a1c846be33
commit 63d854ffbe
116 changed files with 1156 additions and 1111 deletions

View File

@ -60,11 +60,11 @@ defmodule MemexWeb.NoteLive.Index do
end
def handle_event("search", %{"search" => %{"search_term" => ""}}, socket) do
{:noreply, socket |> push_patch(to: Routes.note_index_path(Endpoint, :index))}
{:noreply, socket |> push_patch(to: ~p"/notes")}
end
def handle_event("search", %{"search" => %{"search_term" => search_term}}, socket) do
{:noreply, socket |> push_patch(to: Routes.note_index_path(Endpoint, :search, search_term))}
{:noreply, socket |> push_patch(to: ~p"/notes/#{search_term}")}
end
defp display_notes(%{assigns: %{current_user: current_user, search: search}} = socket)

View File

@ -34,7 +34,7 @@
<:actions :let={note}>
<.link
:if={Notes.is_owner?(note, @current_user)}
patch={Routes.note_index_path(@socket, :edit, note.slug)}
patch={~p"/notes/#{note}/edit"}
aria-label={dgettext("actions", "edit %{note_slug}", note_slug: note.slug)}
>
<%= dgettext("actions", "edit") %>
@ -53,16 +53,12 @@
</.live_component>
<% end %>
<.link
:if={@current_user}
patch={Routes.note_index_path(@socket, :new)}
class="self-end btn btn-primary"
>
<.link :if={@current_user} patch={~p"/notes/new"} class="self-end btn btn-primary">
<%= dgettext("actions", "new note") %>
</.link>
</div>
<.modal :if={@live_action in [:new, :edit]} return_to={Routes.note_index_path(@socket, :index)}>
<.modal :if={@live_action in [:new, :edit]} return_to={~p"/notes"}>
<.live_component
module={MemexWeb.NoteLive.FormComponent}
id={@note.id || :new}
@ -70,6 +66,6 @@
title={@page_title}
action={@live_action}
note={@note}
return_to={Routes.note_index_path(@socket, :index)}
return_to={~p"/notes"}
/>
</.modal>

View File

@ -38,7 +38,7 @@ defmodule MemexWeb.NoteLive.Show do
socket =
socket
|> put_flash(:info, gettext("%{slug} deleted", slug: slug))
|> push_navigate(to: Routes.note_index_path(Endpoint, :index))
|> push_navigate(to: ~p"/notes")
{:noreply, socket}
end

View File

@ -4,11 +4,7 @@
</h1>
<div class="flex flex-wrap space-x-1">
<.link
:for={tag <- @note.tags}
navigate={Routes.note_index_path(Endpoint, :search, tag)}
class="link"
>
<.link :for={tag <- @note.tags} navigate={~p"/notes/#{tag}"} class="link">
<%= tag %>
</.link>
</div>
@ -23,7 +19,7 @@
<.link
:if={Notes.is_owner?(@note, @current_user)}
class="btn btn-primary"
patch={Routes.note_show_path(@socket, :edit, @note.slug)}
patch={~p"/note/#{@note}/edit"}
>
<%= dgettext("actions", "edit") %>
</.link>
@ -40,7 +36,7 @@
</div>
</div>
<.modal :if={@live_action == :edit} return_to={Routes.note_show_path(@socket, :show, @note.slug)}>
<.modal :if={@live_action == :edit} return_to={~p"/note/#{@note}"}>
<.live_component
module={MemexWeb.NoteLive.FormComponent}
id={@note.id}
@ -48,6 +44,6 @@
title={@page_title}
action={@live_action}
note={@note}
return_to={Routes.note_show_path(@socket, :show, @note.slug)}
return_to={~p"/note/#{@note}"}
/>
</.modal>