diff --git a/.drone.yml b/.drone.yml index 54422fc..de99786 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,7 +16,7 @@ steps: - assets/node_modules/ - name: test - image: elixir:1.13.4-alpine + image: elixir:1.14.1-alpine environment: TEST_DATABASE_URL: ecto://postgres:postgres@database/cannery_test HOST: testing.example.tld diff --git a/.tool-versions b/.tool-versions index 6e9c564..66bce82 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -elixir 1.13.4-otp-24 -erlang 24.2 +elixir 1.14.1-otp-25 +erlang 25.1.2 nodejs 16.13.2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a1ea4a..093dad4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Make container show page a bit more compact - Make container show page filter used-up ammo - Forgot to add the logo as the favicon whoops +- Update project dependencies, use Elixir v1.14.1 # v0.5.4 - Rename "Ammo" tab to "Catalog", and "Manage" tab is now "Ammo" diff --git a/Dockerfile b/Dockerfile index 7024fc8..76b61f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM elixir:1.13.4-alpine AS build +FROM elixir:1.14.1-alpine AS build # install build dependencies RUN apk add --no-cache build-base npm git python3 diff --git a/lib/cannery_web.ex b/lib/cannery_web.ex index 1fbd9a4..d294a5c 100644 --- a/lib/cannery_web.ex +++ b/lib/cannery_web.ex @@ -96,7 +96,7 @@ defmodule CanneryWeb do # Import LiveView and .heex helpers (live_render, live_patch, <.form>, etc) # credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse - import Phoenix.LiveView.Helpers + import Phoenix.Component # Import basic rendering functionality (render, render_layout, etc) # credo:disable-for-next-line Credo.Check.Consistency.MultiAliasImportRequireUse diff --git a/lib/cannery_web/components/add_shot_group_component.ex b/lib/cannery_web/components/add_shot_group_component.ex index 1500aaf..0beb3cc 100644 --- a/lib/cannery_web/components/add_shot_group_component.ex +++ b/lib/cannery_web/components/add_shot_group_component.ex @@ -54,7 +54,7 @@ defmodule CanneryWeb.Components.AddShotGroupComponent do |> case do {:ok, _shot_group} -> prompt = dgettext("prompts", "Shots recorded successfully") - socket |> put_flash(:info, prompt) |> push_redirect(to: return_to) + socket |> put_flash(:info, prompt) |> push_navigate(to: return_to) {:error, %Ecto.Changeset{} = changeset} -> socket |> assign(changeset: changeset) diff --git a/lib/cannery_web/components/add_shot_group_component.html.heex b/lib/cannery_web/components/add_shot_group_component.html.heex index 79fa8b3..7e0fc21 100644 --- a/lib/cannery_web/components/add_shot_group_component.html.heex +++ b/lib/cannery_web/components/add_shot_group_component.html.heex @@ -4,7 +4,7 @@ <.form - let={f} + :let={f} for={@changeset} id="shot-group-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" diff --git a/lib/cannery_web/components/ammo_group_card.ex b/lib/cannery_web/components/ammo_group_card.ex index e20842d..5cb2696 100644 --- a/lib/cannery_web/components/ammo_group_card.ex +++ b/lib/cannery_web/components/ammo_group_card.ex @@ -22,12 +22,11 @@ defmodule CanneryWeb.Components.AmmoGroupCard do border border-gray-400 rounded-lg shadow-lg hover:shadow-md transition-all duration-300 ease-in-out" > - <%= live_patch to: Routes.ammo_group_show_path(Endpoint, :show, @ammo_group), - class: "mb-2 link" do %> + <.link patch={Routes.ammo_group_show_path(Endpoint, :show, @ammo_group)} class="mb-2 link">

<%= @ammo_group.ammo_type.name %>

- <% end %> +
@@ -67,10 +66,12 @@ defmodule CanneryWeb.Components.AmmoGroupCard do <%= gettext("Container:") %> - <%= live_patch to: Routes.container_show_path(Endpoint, :show, @ammo_group.container), - class: "link" do %> + <.link + patch={Routes.container_show_path(Endpoint, :show, @ammo_group.container)} + class="link" + > <%= @ammo_group.container.name %> - <% end %> + <% end %>
diff --git a/lib/cannery_web/components/container_card.ex b/lib/cannery_web/components/container_card.ex index db3af29..b96c095 100644 --- a/lib/cannery_web/components/container_card.ex +++ b/lib/cannery_web/components/container_card.ex @@ -19,12 +19,11 @@ defmodule CanneryWeb.Components.ContainerCard do transition-all duration-300 ease-in-out" >
- <%= live_redirect to: Routes.container_show_path(Endpoint, :show, @container), - class: "link" do %> + <.link navigate={Routes.container_show_path(Endpoint, :show, @container)} class="link">

<%= @container.name %>

- <% end %> + <%= if @container.desc do %> diff --git a/lib/cannery_web/components/move_ammo_group_component.ex b/lib/cannery_web/components/move_ammo_group_component.ex index 06f6b03..105c990 100644 --- a/lib/cannery_web/components/move_ammo_group_component.ex +++ b/lib/cannery_web/components/move_ammo_group_component.ex @@ -52,7 +52,7 @@ defmodule CanneryWeb.Components.MoveAmmoGroupComponent do {:ok, _ammo_group} -> prompt = dgettext("prompts", "Ammo moved to %{name} successfully", name: container_name) - socket |> put_flash(:info, prompt) |> push_redirect(to: return_to) + socket |> put_flash(:info, prompt) |> push_navigate(to: return_to) {:error, %Ecto.Changeset{} = changeset} -> socket |> assign(changeset: changeset) @@ -86,10 +86,9 @@ defmodule CanneryWeb.Components.MoveAmmoGroupComponent do <%= display_emoji("😔") %> - <%= live_patch(dgettext("actions", "Add another container!"), - to: Routes.container_index_path(Endpoint, :new), - class: "btn btn-primary" - ) %> + <.link patch={Routes.container_index_path(Endpoint, :new)} class="btn btn-primary"> + <%= dgettext("actions", "Add another container!") %> + <% else %> <.live_component module={CanneryWeb.Components.TableComponent} @@ -122,7 +121,7 @@ defmodule CanneryWeb.Components.MoveAmmoGroupComponent do class="btn btn-primary" phx-click="move" phx-target={@myself} - phx-value-container_id={container.id} + phx-value-container_id={@container.id} > <%= dgettext("actions", "Select") %> diff --git a/lib/cannery_web/components/topbar.ex b/lib/cannery_web/components/topbar.ex index 5843838..2116bf0 100644 --- a/lib/cannery_web/components/topbar.ex +++ b/lib/cannery_web/components/topbar.ex @@ -16,16 +16,17 @@ defmodule CanneryWeb.Components.Topbar do