upgrade to phoenix 1.7
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -60,12 +60,11 @@ defmodule MemexWeb.PipelineLive.Index do
|
||||
end
|
||||
|
||||
def handle_event("search", %{"search" => %{"search_term" => ""}}, socket) do
|
||||
{:noreply, socket |> push_patch(to: Routes.pipeline_index_path(Endpoint, :index))}
|
||||
{:noreply, socket |> push_patch(to: ~p"/pipelines")}
|
||||
end
|
||||
|
||||
def handle_event("search", %{"search" => %{"search_term" => search_term}}, socket) do
|
||||
redirect_to = Routes.pipeline_index_path(Endpoint, :search, search_term)
|
||||
{:noreply, socket |> push_patch(to: redirect_to)}
|
||||
{:noreply, socket |> push_patch(to: ~p"/pipelines/#{search_term}")}
|
||||
end
|
||||
|
||||
defp display_pipelines(%{assigns: %{current_user: current_user, search: search}} = socket)
|
||||
|
@ -34,7 +34,7 @@
|
||||
<:actions :let={pipeline}>
|
||||
<.link
|
||||
:if={Pipelines.is_owner?(pipeline, @current_user)}
|
||||
patch={Routes.pipeline_index_path(@socket, :edit, pipeline.slug)}
|
||||
patch={~p"/pipelines/#{pipeline}/edit"}
|
||||
aria-label={dgettext("actions", "edit %{pipeline_slug}", pipeline_slug: pipeline.slug)}
|
||||
>
|
||||
<%= dgettext("actions", "edit") %>
|
||||
@ -55,19 +55,12 @@
|
||||
</.live_component>
|
||||
<% end %>
|
||||
|
||||
<.link
|
||||
:if={@current_user}
|
||||
patch={Routes.pipeline_index_path(@socket, :new)}
|
||||
class="self-end btn btn-primary"
|
||||
>
|
||||
<.link :if={@current_user} patch={~p"/pipelines/new"} class="self-end btn btn-primary">
|
||||
<%= dgettext("actions", "new pipeline") %>
|
||||
</.link>
|
||||
</div>
|
||||
|
||||
<.modal
|
||||
:if={@live_action in [:new, :edit]}
|
||||
return_to={Routes.pipeline_index_path(@socket, :index)}
|
||||
>
|
||||
<.modal :if={@live_action in [:new, :edit]} return_to={~p"/pipelines"}>
|
||||
<.live_component
|
||||
module={MemexWeb.PipelineLive.FormComponent}
|
||||
id={@pipeline.id || :new}
|
||||
@ -75,6 +68,6 @@
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
pipeline={@pipeline}
|
||||
return_to={Routes.pipeline_index_path(@socket, :index)}
|
||||
return_to={~p"/pipelines"}
|
||||
/>
|
||||
</.modal>
|
||||
|
@ -73,7 +73,7 @@ defmodule MemexWeb.PipelineLive.Show do
|
||||
socket =
|
||||
socket
|
||||
|> put_flash(:info, gettext("%{slug} deleted", slug: slug))
|
||||
|> push_navigate(to: Routes.pipeline_index_path(Endpoint, :index))
|
||||
|> push_navigate(to: ~p"/pipelines")
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
@ -91,7 +91,7 @@ defmodule MemexWeb.PipelineLive.Show do
|
||||
socket =
|
||||
socket
|
||||
|> put_flash(:info, gettext("%{title} deleted", title: title))
|
||||
|> push_patch(to: Routes.pipeline_show_path(Endpoint, :show, pipeline_slug))
|
||||
|> push_patch(to: ~p"/pipeline/#{pipeline_slug}")
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
@ -110,7 +110,7 @@ defmodule MemexWeb.PipelineLive.Show do
|
||||
|
||||
socket =
|
||||
socket
|
||||
|> push_patch(to: Routes.pipeline_show_path(Endpoint, :show, pipeline_slug))
|
||||
|> push_patch(to: ~p"/pipeline/#{pipeline_slug}")
|
||||
|
||||
{:noreply, socket}
|
||||
end
|
||||
|
@ -4,11 +4,7 @@
|
||||
</h1>
|
||||
|
||||
<div class="flex flex-wrap space-x-1">
|
||||
<.link
|
||||
:for={tag <- @pipeline.tags}
|
||||
navigate={Routes.pipeline_index_path(Endpoint, :search, tag)}
|
||||
class="link"
|
||||
>
|
||||
<.link :for={tag <- @pipeline.tags} navigate={~p"/pipelines/#{tag}"} class="link">
|
||||
<%= tag %>
|
||||
</.link>
|
||||
</div>
|
||||
@ -31,7 +27,7 @@
|
||||
<.link
|
||||
:if={Pipelines.is_owner?(@pipeline, @current_user)}
|
||||
class="btn btn-primary"
|
||||
patch={Routes.pipeline_show_path(@socket, :edit, @pipeline.slug)}
|
||||
patch={~p"/pipeline/#{@pipeline}/edit"}
|
||||
>
|
||||
<%= dgettext("actions", "edit") %>
|
||||
</.link>
|
||||
@ -100,7 +96,7 @@
|
||||
|
||||
<.link
|
||||
class="self-end btn btn-primary"
|
||||
patch={Routes.pipeline_show_path(@socket, :edit_step, @pipeline.slug, step_id)}
|
||||
patch={~p"/pipeline/#{@pipeline}/#{step_id}"}
|
||||
aria-label={dgettext("actions", "edit %{step_title}", step_title: step.title)}
|
||||
>
|
||||
<%= dgettext("actions", "edit") %>
|
||||
@ -127,7 +123,7 @@
|
||||
<.link
|
||||
:if={Pipelines.is_owner?(@pipeline, @current_user)}
|
||||
class="self-end btn btn-primary"
|
||||
patch={Routes.pipeline_show_path(@socket, :add_step, @pipeline.slug)}
|
||||
patch={~p"/pipeline/#{@pipeline}/add_step"}
|
||||
>
|
||||
<%= dgettext("actions", "add step") %>
|
||||
</.link>
|
||||
@ -135,7 +131,7 @@
|
||||
|
||||
<%= case @live_action do %>
|
||||
<% :edit -> %>
|
||||
<.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}>
|
||||
<.modal return_to={~p"/pipeline/#{@pipeline}"}>
|
||||
<.live_component
|
||||
module={MemexWeb.PipelineLive.FormComponent}
|
||||
id={@pipeline.id}
|
||||
@ -143,11 +139,11 @@
|
||||
title={@page_title}
|
||||
action={@live_action}
|
||||
pipeline={@pipeline}
|
||||
return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}
|
||||
return_to={~p"/pipeline/#{@pipeline}"}
|
||||
/>
|
||||
</.modal>
|
||||
<% action when action in [:add_step, :edit_step] -> %>
|
||||
<.modal return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}>
|
||||
<.modal return_to={~p"/pipeline/#{@pipeline}"}>
|
||||
<.live_component
|
||||
module={MemexWeb.StepLive.FormComponent}
|
||||
id={@pipeline.id || :new}
|
||||
@ -156,7 +152,7 @@
|
||||
action={@live_action}
|
||||
pipeline={@pipeline}
|
||||
step={@step}
|
||||
return_to={Routes.pipeline_show_path(@socket, :show, @pipeline.slug)}
|
||||
return_to={~p"/pipeline/#{@pipeline}"}
|
||||
/>
|
||||
</.modal>
|
||||
<% _ -> %>
|
||||
|
Reference in New Issue
Block a user