From f5bc8a640d64c0c17eadd3c65d71f3e1561acb03 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Mon, 12 May 2025 10:43:13 +0100 Subject: [PATCH] Consolidate Fluxon usage via CoreComponents With the exclusion of 'button' which is already in use an may need a refactor --- .../components/add_record_component.ex | 2 +- .../components/core_components.ex | 7 ++++++ .../components/form_component.ex | 24 +++++-------------- .../components/record_components.ex | 2 +- .../components/release_component.ex | 12 ++++------ .../controllers/session_html/new.html.heex | 2 +- .../live/artist_live/show.html.heex | 2 +- 7 files changed, 21 insertions(+), 30 deletions(-) diff --git a/lib/music_library_web/components/add_record_component.ex b/lib/music_library_web/components/add_record_component.ex index 7211f5de..3ddbc8ba 100644 --- a/lib/music_library_web/components/add_record_component.ex +++ b/lib/music_library_web/components/add_record_component.ex @@ -21,7 +21,7 @@ defmodule MusicLibraryWeb.AddRecordComponent do phx-submit="search" class="px-4" > -
- - + <.select field={@form[:type]} label={gettext("Type")} options={types_with_labels()} /> + <.select field={@form[:format]} label={gettext("Format")} options={formats_with_labels()} />
- - + <.select searchable field={@form[:selected_release_id]} label={gettext("Selected Release")} options={selected_release_id_options(@record)} />
- - + <.date_time_picker :if={@show_purchased_at} field={@form[:purchased_at]} display_format="%B %-d, %Y at %I:%M %p" diff --git a/lib/music_library_web/components/record_components.ex b/lib/music_library_web/components/record_components.ex index fca2f06c..e525fc78 100644 --- a/lib/music_library_web/components/record_components.ex +++ b/lib/music_library_web/components/record_components.ex @@ -197,7 +197,7 @@ defmodule MusicLibraryWeb.RecordComponents do def search_form(assigns) do ~H"""
- - + <.sheet :if={@record.selected_release_id} id={@sheet_id} placement="right">

{gettext("Tracks")}

<:loading> {gettext("Loading release with tracks")} - + <.loading /> <:failed :let={_failure}>
@@ -123,14 +119,14 @@ defmodule MusicLibraryWeb.ReleaseComponent do
- + <.separator />

{medium_duration(medium)}

- + """ end diff --git a/lib/music_library_web/controllers/session_html/new.html.heex b/lib/music_library_web/controllers/session_html/new.html.heex index d539ae68..f00bbdcc 100644 --- a/lib/music_library_web/controllers/session_html/new.html.heex +++ b/lib/music_library_web/controllers/session_html/new.html.heex @@ -9,7 +9,7 @@
- <:loading> {gettext("Loading play count")} - + <.loading /> <:failed :let={_failure}>