Update to Fluxon 2.0

Address required changes and immediate deprecations
This commit is contained in:
Claudio Ortolina
2025-08-20 16:09:53 +03:00
parent 0ed420acb3
commit 71ca5fa1b9
15 changed files with 24 additions and 28 deletions
@@ -290,12 +290,12 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do
{gettext("New")}
</.badge>
<.link :if={@status == :wishlisted} navigate={~p"/wishlist/#{@record_id}"}>
<.badge color="yellow">
<.badge color="warning">
{gettext("Wishlisted")}
</.badge>
</.link>
<.link :if={@status == :collected} navigate={~p"/collection/#{@record_id}"}>
<.badge color="green">
<.badge color="success">
{gettext("Collected")}
</.badge>
</.link>
@@ -52,7 +52,7 @@ defmodule MusicLibraryWeb.ReleaseComponent do
>
{gettext("Scrobble release")}
</.button>
<.button :if={!@can_scrobble?} as="link" size="sm" href={LastFm.auth_url()}>
<.button :if={!@can_scrobble?} size="sm" href={LastFm.auth_url()}>
{gettext("Connect your Last.fm account")}
</.button>
</div>
@@ -26,7 +26,7 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
href={LastFm.Artist.events_url(@lastfm_artist_info)}
target="_blank"
>
<.badge variant="pill" class="mr-2">{gettext("On Tour")}</.badge>
<.badge variant="soft" class="mr-2">{gettext("On Tour")}</.badge>
</a>
"""
end
@@ -78,7 +78,7 @@
<.on_tour_link lastfm_artist_info={lastfm_artist_info} />
<.play_count play_count={lastfm_artist_info.play_count} />
</.async_result>
<.button variant="solid" as="link" patch={~p"/artists/#{@artist.musicbrainz_id}/import"}>
<.button variant="solid" patch={~p"/artists/#{@artist.musicbrainz_id}/import"}>
<.icon name="hero-plus" class="h-4 w-4 mr-2" aria-hidden="true" data-slot="icon" />
{gettext("Add more")}
</.button>
@@ -6,7 +6,6 @@
<.button
class="rounded-l-md rounded-r-none"
variant="solid"
as="link"
size="sm"
patch={~p"/collection/import"}
>
@@ -16,7 +15,6 @@
<.button
class="-ml-px rounded-r-md rounded-l-none"
variant="solid"
as="link"
size="sm"
patch={~p"/collection/scan"}
>
@@ -31,7 +29,6 @@
<span class="isolate inline-flex rounded-md shadow-xs">
<.button
patch={order_path(@record_list_params, :purchase)}
as="link"
size="sm"
class={[
"rounded-l-md rounded-r-none",
@@ -48,7 +45,6 @@
</.button>
<.button
patch={order_path(@record_list_params, :alphabetical)}
as="link"
size="sm"
class={[
"-ml-px rounded-r-md rounded-l-none",
@@ -7,7 +7,7 @@
</div>
<div>
<nav class="isolate inline-flex rounded-md shadow-xs">
<.button variant="solid" as="link" size="sm" patch={~p"/online-store-templates/new"}>
<.button variant="solid" size="sm" patch={~p"/online-store-templates/new"}>
<.icon name="hero-plus" class="h-4 w-4 mr-2" aria-hidden="true" data-slot="icon" />
{gettext("New Template")}
</.button>
@@ -38,10 +38,10 @@
<p class="text-sm font-semibold text-gray-900 dark:text-white">
{template.name}
</p>
<.badge :if={template.enabled} color="green">
<.badge :if={template.enabled} color="success">
{gettext("Enabled")}
</.badge>
<.badge :if={!template.enabled} color="yellow">
<.badge :if={!template.enabled} color="warning">
{gettext("Disabled")}
</.badge>
</div>
@@ -114,8 +114,8 @@ defmodule MusicLibraryWeb.ScrobbleRulesLive.Index do
defp type_badge(assigns) do
~H"""
<.badge :if={@type == :album} color="red">{gettext("Album")}</.badge>
<.badge :if={@type == :artist} color="cyan">{gettext("Artist")}</.badge>
<.badge :if={@type == :album} color="danger">{gettext("Album")}</.badge>
<.badge :if={@type == :artist} color="info">{gettext("Artist")}</.badge>
"""
end
@@ -123,8 +123,8 @@ defmodule MusicLibraryWeb.ScrobbleRulesLive.Index do
defp status_badge(assigns) do
~H"""
<.badge :if={@enabled} color="green">{gettext("Enabled")}</.badge>
<.badge :if={!@enabled} color="yellow">{gettext("Disabled")}</.badge>
<.badge :if={@enabled} color="success">{gettext("Enabled")}</.badge>
<.badge :if={!@enabled} color="warning">{gettext("Disabled")}</.badge>
"""
end
end
@@ -10,7 +10,6 @@
<.button
class="rounded-l-md rounded-r-none"
variant="solid"
as="link"
size="sm"
patch={~p"/scrobble-rules/new"}
>
@@ -222,7 +222,7 @@
}
navigate={~p"/collection/#{record_id}"}
>
<.badge color="green">
<.badge color="success">
{gettext("Collected")}
</.badge>
</.link>
@@ -233,7 +233,7 @@
}
navigate={~p"/wishlist/#{record_id}"}
>
<.badge color="yellow">
<.badge color="warning">
{gettext("Wishlisted")}
</.badge>
</.link>
@@ -432,7 +432,7 @@
}
navigate={~p"/collection/#{record_id}"}
>
<.badge color="green">{gettext("Collected")}</.badge>
<.badge color="success">{gettext("Collected")}</.badge>
</.link>
<.link
:if={
@@ -440,7 +440,7 @@
}
navigate={~p"/wishlist/#{record_id}"}
>
<.badge color="yellow">{gettext("Wishlisted")}</.badge>
<.badge color="warning">{gettext("Wishlisted")}</.badge>
</.link>
</div>
@@ -142,12 +142,15 @@ defmodule MusicLibraryWeb.StatsLive.TopAlbums do
}>
{album.play_count}
</.badge>
<.badge :if={tracked_record?(@collected_releases, album.album_musicbrainz_id)} color="green">
<.badge
:if={tracked_record?(@collected_releases, album.album_musicbrainz_id)}
color="success"
>
{album.play_count}
</.badge>
<.badge
:if={tracked_record?(@wishlisted_releases, album.album_musicbrainz_id)}
color="yellow"
color="warning"
>
{album.play_count}
</.badge>
@@ -23,7 +23,6 @@
<span class="isolate inline-flex rounded-md shadow-xs">
<.button
patch={order_path(@record_list_params, :insertion)}
as="link"
size="sm"
class={[
"rounded-l-md rounded-r-none",
@@ -35,7 +34,6 @@
</.button>
<.button
patch={order_path(@record_list_params, :alphabetical)}
as="link"
size="sm"
class={[
"-ml-px rounded-r-md rounded-l-none",
@@ -279,7 +279,6 @@
<div class="mt-4 space-y-2">
<.button
:for={template <- @online_store_templates}
as="link"
href={OnlineStoreTemplates.generate_url(template, @record)}
target="_blank"
rel="noopener noreferrer"