update to liveview 0.18 and use elixir 1.14
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,7 +60,7 @@ defmodule CanneryWeb.InviteLive.FormComponent do
|
||||
case invite |> Invites.update_invite(invite_params, current_user) do
|
||||
{:ok, %{name: invite_name}} ->
|
||||
prompt = dgettext("prompts", "%{name} updated successfully", name: invite_name)
|
||||
socket |> put_flash(:info, prompt) |> push_redirect(to: return_to)
|
||||
socket |> put_flash(:info, prompt) |> push_navigate(to: return_to)
|
||||
|
||||
{:error, %Changeset{} = changeset} ->
|
||||
socket |> assign(:changeset, changeset)
|
||||
@ -78,7 +78,7 @@ defmodule CanneryWeb.InviteLive.FormComponent do
|
||||
case current_user |> Invites.create_invite(invite_params) do
|
||||
{:ok, %{name: invite_name}} ->
|
||||
prompt = dgettext("prompts", "%{name} created successfully", name: invite_name)
|
||||
socket |> put_flash(:info, prompt) |> push_redirect(to: return_to)
|
||||
socket |> put_flash(:info, prompt) |> push_navigate(to: return_to)
|
||||
|
||||
{:error, %Changeset{} = changeset} ->
|
||||
socket |> assign(changeset: changeset)
|
||||
|
@ -3,7 +3,7 @@
|
||||
<%= @title %>
|
||||
</h2>
|
||||
<.form
|
||||
let={f}
|
||||
:let={f}
|
||||
for={@changeset}
|
||||
id="invite-form"
|
||||
class="flex flex-col space-y-4 sm:space-y-0 sm:grid sm:grid-cols-3 sm:gap-4 justify-center items-center"
|
||||
|
@ -17,7 +17,7 @@ defmodule CanneryWeb.InviteLive.Index do
|
||||
else
|
||||
prompt = dgettext("errors", "You are not authorized to view this page")
|
||||
return_to = Routes.live_path(Endpoint, HomeLive)
|
||||
socket |> put_flash(:error, prompt) |> push_redirect(to: return_to)
|
||||
socket |> put_flash(:error, prompt) |> push_navigate(to: return_to)
|
||||
end
|
||||
|
||||
{:ok, socket}
|
||||
|
@ -9,15 +9,13 @@
|
||||
<%= display_emoji("😔") %>
|
||||
</h1>
|
||||
|
||||
<%= live_patch(dgettext("actions", "Invite someone new!"),
|
||||
to: Routes.invite_index_path(Endpoint, :new),
|
||||
class: "btn btn-primary"
|
||||
) %>
|
||||
<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
|
||||
<%= dgettext("actions", "Invite someone new!") %>
|
||||
</.link>
|
||||
<% else %>
|
||||
<%= live_patch(dgettext("actions", "Create Invite"),
|
||||
to: Routes.invite_index_path(Endpoint, :new),
|
||||
class: "btn btn-primary"
|
||||
) %>
|
||||
<.link patch={Routes.invite_index_path(Endpoint, :new)} class="btn btn-primary">
|
||||
<%= dgettext("actions", "Create Invite") %>
|
||||
</.link>
|
||||
<% end %>
|
||||
|
||||
<div class="w-full flex flex-row flex-wrap justify-center items-center">
|
||||
@ -34,25 +32,28 @@
|
||||
</button>
|
||||
</form>
|
||||
</:code_actions>
|
||||
<%= live_patch to: Routes.invite_index_path(Endpoint, :edit, invite),
|
||||
class: "text-primary-600 link",
|
||||
data: [qa: "edit-#{invite.id}"] do %>
|
||||
<.link
|
||||
patch={Routes.invite_index_path(Endpoint, :edit, invite)}
|
||||
class="text-primary-600 link"
|
||||
data-qa={"edit-#{invite.id}"}
|
||||
>
|
||||
<i class="fa-fw fa-lg fas fa-edit"></i>
|
||||
<% end %>
|
||||
</.link>
|
||||
|
||||
<%= link to: "#",
|
||||
class: "text-primary-600 link",
|
||||
phx_click: "delete_invite",
|
||||
phx_value_id: invite.id,
|
||||
data: [
|
||||
confirm:
|
||||
dgettext("prompts", "Are you sure you want to delete the invite for %{name}?",
|
||||
name: invite.name
|
||||
),
|
||||
qa: "delete-#{invite.id}"
|
||||
] do %>
|
||||
<.link
|
||||
href="#"
|
||||
class="text-primary-600 link"
|
||||
phx-click="delete_invite"
|
||||
phx-value-id={invite.id}
|
||||
data-confirm={
|
||||
dgettext("prompts", "Are you sure you want to delete the invite for %{name}?",
|
||||
name: invite.name
|
||||
)
|
||||
}
|
||||
data-qa={"delete-#{invite.id}"}
|
||||
>
|
||||
<i class="fa-fw fa-lg fas fa-trash"></i>
|
||||
<% end %>
|
||||
</.link>
|
||||
|
||||
<%= if invite.disabled_at |> is_nil() do %>
|
||||
<a href="#" class="btn btn-primary" phx-click="disable_invite" phx-value-id={invite.id}>
|
||||
@ -93,20 +94,21 @@
|
||||
<div class="w-full flex flex-row flex-wrap justify-center items-center">
|
||||
<%= for admin <- @admins do %>
|
||||
<.user_card user={admin}>
|
||||
<%= link to: "#",
|
||||
class: "text-primary-600 link",
|
||||
phx_click: "delete_user",
|
||||
phx_value_id: admin.id,
|
||||
data: [
|
||||
confirm:
|
||||
dgettext(
|
||||
"prompts",
|
||||
"Are you sure you want to delete %{email}? This action is permanent!",
|
||||
email: admin.email
|
||||
)
|
||||
] do %>
|
||||
<.link
|
||||
href="#"
|
||||
class="text-primary-600 link"
|
||||
phx-click="delete_user"
|
||||
phx-value-id={admin.id}
|
||||
data-confirm={
|
||||
dgettext(
|
||||
"prompts",
|
||||
"Are you sure you want to delete %{email}? This action is permanent!",
|
||||
email: admin.email
|
||||
)
|
||||
}
|
||||
>
|
||||
<i class="fa-fw fa-lg fas fa-trash"></i>
|
||||
<% end %>
|
||||
</.link>
|
||||
</.user_card>
|
||||
<% end %>
|
||||
</div>
|
||||
@ -122,20 +124,21 @@
|
||||
<div class="w-full flex flex-row flex-wrap justify-center items-center">
|
||||
<%= for user <- @users do %>
|
||||
<.user_card user={user}>
|
||||
<%= link to: "#",
|
||||
class: "text-primary-600 link",
|
||||
phx_click: "delete_user",
|
||||
phx_value_id: user.id,
|
||||
data: [
|
||||
confirm:
|
||||
dgettext(
|
||||
"prompts",
|
||||
"Are you sure you want to delete %{email}? This action is permanent!",
|
||||
email: user.email
|
||||
)
|
||||
] do %>
|
||||
<.link
|
||||
href="#"
|
||||
class="text-primary-600 link"
|
||||
phx-click="delete_user"
|
||||
phx-value-id={user.id}
|
||||
data-confirm={
|
||||
dgettext(
|
||||
"prompts",
|
||||
"Are you sure you want to delete %{email}? This action is permanent!",
|
||||
email: user.email
|
||||
)
|
||||
}
|
||||
>
|
||||
<i class="fa-fw fa-lg fas fa-trash"></i>
|
||||
<% end %>
|
||||
</.link>
|
||||
</.user_card>
|
||||
<% end %>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user