Consolidate actions_menu toggle and close logic
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
Compiling 1 file (.ex)
|
||||
Generated music_library app
|
||||
|
||||
11:30:46.549 [debug] Exqlite: loading extension `/Users/cloud/github.com/cloud8421/music_library/_build/test/lib/music_library/priv/sqlite_extensions/darwin-aarch64/unicode.dylib`
|
||||
|
||||
11:30:46.549 [debug] Exqlite: loading extension `/Users/cloud/github.com/cloud8421/music_library/_build/test/lib/music_library/priv/sqlite_extensions/darwin-aarch64/unicode.dylib`
|
||||
Running ExUnit with seed: 648807, max_cases: 1
|
||||
|
||||
|
||||
MusicLibrary.Records.SearchParserTest [test/music_library/records/search_parser_test.exs]
|
||||
* doctest MusicLibrary.Records.SearchParser.parse/1 (1) [L#4]
|
||||
* doctest MusicLibrary.Records.SearchParser.parse/1 (1) (12.6ms) [L#4]
|
||||
|
||||
MusicLibrary.Records.CoverTest [test/music_library/records/cover_test.exs]
|
||||
* test resize/1 it resizes to the desired size [L#7]
|
||||
* test resize/1 it resizes to the desired size (98.1ms) [L#7]
|
||||
|
||||
LastFm.ConfigTest [test/last_fm/config_test.exs]
|
||||
* test resolve/1 reads data from application configuration [L#5]
|
||||
* test resolve/1 reads data from application configuration (0.01ms) [L#5]
|
||||
|
||||
MusicLibraryWeb.ErrorJSONTest [test/music_library_web/controllers/error_json_test.exs]
|
||||
* test renders 500 [L#8]
|
||||
* test renders 500 (9.8ms) [L#8]
|
||||
* test renders 404 [L#4]
|
||||
* test renders 404 (0.1ms) [L#4]
|
||||
|
||||
LastFm.FeedTest [test/last_fm/feed_test.exs]
|
||||
* test update and broadcast it returns tracks in descending order of scrobble [L#45]
|
||||
* test update and broadcast it returns tracks in descending order of scrobble (0.02ms) [L#45]
|
||||
* test update and broadcast it returns artists in descending order of scrobble [L#50]
|
||||
* test update and broadcast it returns artists in descending order of scrobble (0.01ms) [L#50]
|
||||
* test update and broadcast it returns albums in descending order of scrobble [L#55]
|
||||
* test update and broadcast it returns albums in descending order of scrobble (0.01ms) [L#55]
|
||||
* test update and broadcast it stores the track and broadcasts the update [L#38]
|
||||
* test update and broadcast it stores the track and broadcasts the update (0.01ms) [L#38]
|
||||
|
||||
MusicLibraryWeb.AuthTest [test/music_library_web/plug/auth_test.exs]
|
||||
* test require_logged_in/2 when logged in, it passes through [L#33]
|
||||
* test require_logged_in/2 when logged in, it passes through (0.8ms) [L#33]
|
||||
* test require_logged_in/2 when logged out, it redirects to /login [L#19]
|
||||
* test require_logged_in/2 when logged out, it redirects to /login (2.4ms) [L#19]
|
||||
|
||||
Obsidian.ParserTest [test/obsidian/parser_test.exs]
|
||||
* test handles special characters in titles [L#32]
|
||||
* test handles special characters in titles (7.0ms) [L#32]
|
||||
* test parses the content of the Obsidian album entry [L#8]
|
||||
* test parses the content of the Obsidian album entry (0.4ms) [L#8]
|
||||
|
||||
LastFm.ArtistTest [test/last_fm/artist_test.exs]
|
||||
* test from_api_response/1 returns correct data [L#7]
|
||||
* test from_api_response/1 returns correct data (2.2ms) [L#7]
|
||||
|
||||
LastFm.TrackTest [test/last_fm/track_test.exs]
|
||||
* test from_api_response/1 returns correct data [L#7]
|
||||
* test from_api_response/1 returns correct data (0.2ms) [L#7]
|
||||
|
||||
MusicLibraryWeb.ErrorHTMLTest [test/music_library_web/controllers/error_html_test.exs]
|
||||
* test renders 500.html [L#11]
|
||||
* test renders 500.html (1.5ms) [L#11]
|
||||
* test renders 404.html [L#7]
|
||||
* test renders 404.html (0.1ms) [L#7]
|
||||
|
||||
MusicLibraryWeb.WishlistLive.IndexTest [test/music_library_web/live/wishlist_live/index_test.exs]
|
||||
* test Wishlist can purchase a record and move it to the collection [L#14]
|
||||
* test Wishlist can purchase a record and move it to the collection (107.1ms) [L#14]
|
||||
|
||||
MusicLibraryWeb.SessionControllerTest [test/music_library_web/controllers/session_controller_test.exs]
|
||||
* test GET /login it resets the session [L#15]
|
||||
* test GET /login it resets the session (2.1ms) [L#15]
|
||||
* test POST /sessions/create it refuses an invalid password [L#26]
|
||||
* test POST /sessions/create it refuses an invalid password (0.1ms) [L#26]
|
||||
* test POST /sessions/create it accepts a valid password [L#42]
|
||||
* test POST /sessions/create it accepts a valid password (0.1ms) [L#42]
|
||||
* test GET /login it shows the login form [L#6]
|
||||
* test GET /login it shows the login form (0.9ms) [L#6]
|
||||
|
||||
MusicLibrary.CollectionTest [test/music_library/collection_test.exs]
|
||||
* test count_records_by_type/0 returns the count of records in the collection by type, excluding wishlisted records [L#84]
|
||||
* test count_records_by_type/0 returns the count of records in the collection by type, excluding wishlisted records (3.2ms) [L#84]
|
||||
* test get_latest_record!/0 returns the most recently purchased record [L#92]
|
||||
* test get_latest_record!/0 returns the most recently purchased record (2.7ms) [L#92]
|
||||
* test search_records/2 it respects limit [L#46]
|
||||
* test search_records/2 it respects limit (2.3ms) [L#46]
|
||||
* test search_records/2 it respects offset [L#50]
|
||||
* test search_records/2 it respects offset (2.5ms) [L#50]
|
||||
* test get_random_record!/0 returns a random record [L#103]
|
||||
* test get_random_record!/0 returns a random record (2.3ms) [L#103]
|
||||
* test count_records_by_format/0 returns the count of records in the collection by format, excluding wishlisted records [L#76]
|
||||
* test count_records_by_format/0 returns the count of records in the collection by format, excluding wishlisted records (2.3ms) [L#76]
|
||||
* test search_records/2 it respects order [L#56]
|
||||
* test search_records/2 it respects order (2.3ms) [L#56]
|
||||
* test search_records_count/1 returns the count of matching records, excluding wishlisted records [L#68]
|
||||
* test search_records_count/1 returns the count of matching records, excluding wishlisted records (2.2ms) [L#68]
|
||||
* test search_records/2 returns matching records, excluding wishlisted records [L#41]
|
||||
* test search_records/2 returns matching records, excluding wishlisted records (2.3ms) [L#41]
|
||||
|
||||
MusicLibraryWeb.CollectionControllerTest [test/music_library_web/controllers/collection_controller_test.exs]
|
||||
* test GET /api/collection/latest it returns the latest record [L#24]
|
||||
* test GET /api/collection/latest it returns the latest record (2.1ms) [L#24]
|
||||
* test GET /api/collection/random it requires authentication [L#44]
|
||||
* test GET /api/collection/random it requires authentication (0.7ms) [L#44]
|
||||
* test GET /api/collection/random it returns a random record [L#51]
|
||||
* test GET /api/collection/random it returns a random record (0.9ms) [L#51]
|
||||
* test GET /api/collection/latest it requires authentication [L#18]
|
||||
* test GET /api/collection/latest it requires authentication (0.6ms) [L#18]
|
||||
|
||||
MusicLibraryWeb.StatsLive.IndexTest [test/music_library_web/live/stats_live/index_test.exs]
|
||||
* test Stats home page it shows the latest purchase [L#56]
|
||||
* test Stats home page it shows the latest purchase (31.6ms) [L#56]
|
||||
* test Stats home page it shows the wishlist total count [L#71]
|
||||
* test Stats home page it shows the wishlist total count (26.8ms) [L#71]
|
||||
* test Stats home page it shows the scrobble activity [L#77]
|
||||
* test Stats home page it shows the scrobble activity (73.7ms) [L#77]
|
||||
* test Stats home page it shows the collection counts (total, format, and type) [L#32]
|
||||
* test Stats home page it shows the collection counts (total, format, and type) (49.3ms) [L#32]
|
||||
|
||||
MusicLibrary.WishlistTest [test/music_library/wishlist_test.exs]
|
||||
* test search_records/2 it respects limit [L#25]
|
||||
* test search_records/2 it respects limit (2.6ms) [L#25]
|
||||
* test search_records/2 it respects offset [L#29]
|
||||
* test search_records/2 it respects offset (2.2ms) [L#29]
|
||||
* test search_records_count/1 returns the count of matching records, excluding purchased records [L#39]
|
||||
* test search_records_count/1 returns the count of matching records, excluding purchased records (2.3ms) [L#39]
|
||||
* test count/0 returns the count of records in the wishlist, excluding purchased records [L#47]
|
||||
* test count/0 returns the count of records in the wishlist, excluding purchased records (2.0ms) [L#47]
|
||||
* test search_records/2 returns matching records, excluding purchased records [L#21]
|
||||
* test search_records/2 returns matching records, excluding purchased records (2.2ms) [L#21]
|
||||
|
||||
MusicLibraryWeb.CoverControllerTest [test/music_library_web/controllers/cover_controller_test.exs]
|
||||
* test GET /covers/:record_id serves the cover without etag [L#21]
|
||||
* test GET /covers/:record_id serves the cover without etag (1.7ms) [L#21]
|
||||
* test GET /covers/:record_id serves the cover when etag doesn't match [L#32]
|
||||
* test GET /covers/:record_id serves the cover when etag doesn't match (0.8ms) [L#32]
|
||||
* test GET /covers/:record_id serves a 304 when etag matches [L#46]
|
||||
* test GET /covers/:record_id serves a 304 when etag matches (0.8ms) [L#46]
|
||||
* test GET /covers/:record_id accepts a size attribute for resizing [L#60]
|
||||
* test GET /covers/:record_id accepts a size attribute for resizing (3.8ms) [L#60]
|
||||
* test GET /covers/:record_id 404s when record doesn't exist [L#14]
|
||||
* test GET /covers/:record_id 404s when record doesn't exist (0.8ms) [L#14]
|
||||
|
||||
MusicLibrary.RepoTest [test/music_library/repo_test.exs]
|
||||
* test correctly loads the unicode extension unaccent function [L#5]
|
||||
* test correctly loads the unicode extension unaccent function (0.1ms) [L#5]
|
||||
|
||||
MusicLibrary.ArtistsTest [test/music_library/artists_test.exs]
|
||||
* test get_artist/1 it returns records with essential data [L#8]
|
||||
* test get_artist/1 it returns records with essential data (0.7ms) [L#8]
|
||||
|
||||
MusicLibrary.RecordsTest [test/music_library/records_test.exs]
|
||||
* test search_records/2 tagged search - type [L#101]
|
||||
* test search_records/2 tagged search - type (2.7ms) [L#101]
|
||||
@@ -0,0 +1,151 @@
|
||||
Generated music_library app
|
||||
|
||||
11:30:38.529 [debug] Exqlite: loading extension `/Users/cloud/github.com/cloud8421/music_library/_build/test/lib/music_library/priv/sqlite_extensions/darwin-aarch64/unicode.dylib`
|
||||
|
||||
11:30:38.529 [debug] Exqlite: loading extension `/Users/cloud/github.com/cloud8421/music_library/_build/test/lib/music_library/priv/sqlite_extensions/darwin-aarch64/unicode.dylib`
|
||||
Running ExUnit with seed: 637247, max_cases: 1
|
||||
|
||||
|
||||
MusicLibraryWeb.ErrorHTMLTest [test/music_library_web/controllers/error_html_test.exs]
|
||||
* test renders 404.html [L#7]
|
||||
* test renders 404.html (46.2ms) [L#7]
|
||||
* test renders 500.html [L#11]
|
||||
* test renders 500.html (0.2ms) [L#11]
|
||||
|
||||
MusicLibraryWeb.ErrorJSONTest [test/music_library_web/controllers/error_json_test.exs]
|
||||
* test renders 404 [L#4]
|
||||
* test renders 404 (5.5ms) [L#4]
|
||||
* test renders 500 [L#8]
|
||||
* test renders 500 (0.2ms) [L#8]
|
||||
|
||||
LastFm.FeedTest [test/last_fm/feed_test.exs]
|
||||
* test update and broadcast it returns artists in descending order of scrobble [L#50]
|
||||
* test update and broadcast it returns artists in descending order of scrobble (0.06ms) [L#50]
|
||||
* test update and broadcast it stores the track and broadcasts the update [L#38]
|
||||
* test update and broadcast it stores the track and broadcasts the update (0.02ms) [L#38]
|
||||
* test update and broadcast it returns albums in descending order of scrobble [L#55]
|
||||
* test update and broadcast it returns albums in descending order of scrobble (0.01ms) [L#55]
|
||||
* test update and broadcast it returns tracks in descending order of scrobble [L#45]
|
||||
* test update and broadcast it returns tracks in descending order of scrobble (0.02ms) [L#45]
|
||||
|
||||
MusicLibrary.Records.SearchParserTest [test/music_library/records/search_parser_test.exs]
|
||||
* doctest MusicLibrary.Records.SearchParser.parse/1 (1) [L#4]
|
||||
* doctest MusicLibrary.Records.SearchParser.parse/1 (1) (11.3ms) [L#4]
|
||||
|
||||
LastFm.ArtistTest [test/last_fm/artist_test.exs]
|
||||
* test from_api_response/1 returns correct data [L#7]
|
||||
* test from_api_response/1 returns correct data (12.9ms) [L#7]
|
||||
|
||||
Obsidian.ParserTest [test/obsidian/parser_test.exs]
|
||||
* test parses the content of the Obsidian album entry [L#8]
|
||||
* test parses the content of the Obsidian album entry (24.2ms) [L#8]
|
||||
* test handles special characters in titles [L#32]
|
||||
* test handles special characters in titles (1.0ms) [L#32]
|
||||
|
||||
MusicLibraryWeb.AuthTest [test/music_library_web/plug/auth_test.exs]
|
||||
* test require_logged_in/2 when logged out, it redirects to /login [L#19]
|
||||
* test require_logged_in/2 when logged out, it redirects to /login (4.9ms) [L#19]
|
||||
* test require_logged_in/2 when logged in, it passes through [L#33]
|
||||
* test require_logged_in/2 when logged in, it passes through (0.01ms) [L#33]
|
||||
|
||||
MusicLibrary.Records.CoverTest [test/music_library/records/cover_test.exs]
|
||||
* test resize/1 it resizes to the desired size [L#7]
|
||||
* test resize/1 it resizes to the desired size (56.7ms) [L#7]
|
||||
|
||||
LastFm.ConfigTest [test/last_fm/config_test.exs]
|
||||
* test resolve/1 reads data from application configuration [L#5]
|
||||
* test resolve/1 reads data from application configuration (0.01ms) [L#5]
|
||||
|
||||
LastFm.TrackTest [test/last_fm/track_test.exs]
|
||||
* test from_api_response/1 returns correct data [L#7]
|
||||
* test from_api_response/1 returns correct data (0.7ms) [L#7]
|
||||
|
||||
MusicLibrary.WishlistTest [test/music_library/wishlist_test.exs]
|
||||
* test search_records/2 it respects offset [L#29]
|
||||
* test search_records/2 it respects offset (26.1ms) [L#29]
|
||||
* test search_records/2 returns matching records, excluding purchased records [L#21]
|
||||
* test search_records/2 returns matching records, excluding purchased records (2.5ms) [L#21]
|
||||
* test count/0 returns the count of records in the wishlist, excluding purchased records [L#47]
|
||||
* test count/0 returns the count of records in the wishlist, excluding purchased records (2.1ms) [L#47]
|
||||
* test search_records_count/1 returns the count of matching records, excluding purchased records [L#39]
|
||||
* test search_records_count/1 returns the count of matching records, excluding purchased records (2.9ms) [L#39]
|
||||
* test search_records/2 it respects limit [L#25]
|
||||
* test search_records/2 it respects limit (2.5ms) [L#25]
|
||||
|
||||
MusicLibrary.CollectionTest [test/music_library/collection_test.exs]
|
||||
* test search_records/2 it respects offset [L#50]
|
||||
* test search_records/2 it respects offset (4.6ms) [L#50]
|
||||
* test count_records_by_format/0 returns the count of records in the collection by format, excluding wishlisted records [L#76]
|
||||
* test count_records_by_format/0 returns the count of records in the collection by format, excluding wishlisted records (2.3ms) [L#76]
|
||||
* test get_random_record!/0 returns a random record [L#103]
|
||||
* test get_random_record!/0 returns a random record (2.2ms) [L#103]
|
||||
* test get_latest_record!/0 returns the most recently purchased record [L#92]
|
||||
* test get_latest_record!/0 returns the most recently purchased record (2.9ms) [L#92]
|
||||
* test search_records/2 returns matching records, excluding wishlisted records [L#41]
|
||||
* test search_records/2 returns matching records, excluding wishlisted records (2.9ms) [L#41]
|
||||
* test search_records_count/1 returns the count of matching records, excluding wishlisted records [L#68]
|
||||
* test search_records_count/1 returns the count of matching records, excluding wishlisted records (2.7ms) [L#68]
|
||||
* test count_records_by_type/0 returns the count of records in the collection by type, excluding wishlisted records [L#84]
|
||||
* test count_records_by_type/0 returns the count of records in the collection by type, excluding wishlisted records (2.3ms) [L#84]
|
||||
* test search_records/2 it respects order [L#56]
|
||||
* test search_records/2 it respects order (2.5ms) [L#56]
|
||||
* test search_records/2 it respects limit [L#46]
|
||||
* test search_records/2 it respects limit (2.3ms) [L#46]
|
||||
|
||||
MusicLibraryWeb.WishlistLive.IndexTest [test/music_library_web/live/wishlist_live/index_test.exs]
|
||||
* test Wishlist can purchase a record and move it to the collection [L#15]
|
||||
* test Wishlist can purchase a record and move it to the collection (82.7ms) [L#15]
|
||||
|
||||
MusicLibraryWeb.CollectionLive.ShowTest [test/music_library_web/live/collection_live/show_test.exs]
|
||||
* test Edit record from show page can navigate to the record edit form [L#19]
|
||||
* test Edit record from show page can navigate to the record edit form (16.6ms) [L#19]
|
||||
* test Show record it includes all needed information [L#33]
|
||||
* test Show record it includes all needed information (7.1ms) [L#33]
|
||||
|
||||
MusicLibrary.RepoTest [test/music_library/repo_test.exs]
|
||||
* test correctly loads the unicode extension unaccent function [L#5]
|
||||
* test correctly loads the unicode extension unaccent function (0.1ms) [L#5]
|
||||
|
||||
MusicLibraryWeb.StatsLive.IndexTest [test/music_library_web/live/stats_live/index_test.exs]
|
||||
* test Stats home page it shows the wishlist total count [L#70]
|
||||
* test Stats home page it shows the wishlist total count (31.0ms) [L#70]
|
||||
* test Stats home page it shows the collection counts (total, format, and type) [L#33]
|
||||
* test Stats home page it shows the collection counts (total, format, and type) (26.5ms) [L#33]
|
||||
* test Stats home page it shows the scrobble activity [L#76]
|
||||
* test Stats home page it shows the scrobble activity (36.5ms) [L#76]
|
||||
* test Stats home page it shows the latest purchase [L#56]
|
||||
* test Stats home page it shows the latest purchase (24.6ms) [L#56]
|
||||
|
||||
MusicLibrary.ArtistsTest [test/music_library/artists_test.exs]
|
||||
* test get_artist/1 it returns records with essential data [L#8]
|
||||
* test get_artist/1 it returns records with essential data (0.8ms) [L#8]
|
||||
|
||||
MusicLibraryWeb.CoverControllerTest [test/music_library_web/controllers/cover_controller_test.exs]
|
||||
* test GET /covers/:record_id serves the cover when etag doesn't match [L#32]
|
||||
* test GET /covers/:record_id serves the cover when etag doesn't match (1.6ms) [L#32]
|
||||
* test GET /covers/:record_id 404s when record doesn't exist [L#14]
|
||||
* test GET /covers/:record_id 404s when record doesn't exist (1.6ms) [L#14]
|
||||
* test GET /covers/:record_id accepts a size attribute for resizing [L#60]
|
||||
* test GET /covers/:record_id accepts a size attribute for resizing (4.2ms) [L#60]
|
||||
* test GET /covers/:record_id serves a 304 when etag matches [L#46]
|
||||
* test GET /covers/:record_id serves a 304 when etag matches (0.8ms) [L#46]
|
||||
* test GET /covers/:record_id serves the cover without etag [L#21]
|
||||
* test GET /covers/:record_id serves the cover without etag (0.7ms) [L#21]
|
||||
|
||||
MusicLibraryWeb.SessionControllerTest [test/music_library_web/controllers/session_controller_test.exs]
|
||||
* test POST /sessions/create it refuses an invalid password [L#26]
|
||||
* test POST /sessions/create it refuses an invalid password (0.8ms) [L#26]
|
||||
* test GET /login it shows the login form [L#6]
|
||||
* test GET /login it shows the login form (0.9ms) [L#6]
|
||||
* test POST /sessions/create it accepts a valid password [L#42]
|
||||
* test POST /sessions/create it accepts a valid password (0.2ms) [L#42]
|
||||
* test GET /login it resets the session [L#15]
|
||||
* test GET /login it resets the session (0.2ms) [L#15]
|
||||
|
||||
MusicLibraryWeb.ArtistLive.ShowTest [test/music_library_web/live/artist_live/show_test.exs]
|
||||
* test Show artist it shows records from the collection and the wishlist [L#79]
|
||||
* test Show artist it shows records from the collection and the wishlist (7.3ms) [L#79]
|
||||
* test Show artist it shows the artist bio and play count [L#34]
|
||||
* test Show artist it shows the artist bio and play count (4.5ms) [L#34]
|
||||
* test Show artist it gracefully handles errors in fetching bio and play count [L#58]
|
||||
* test Show artist it gracefully handles errors in fetching bio and play count (3.0ms) [L#58]
|
||||
@@ -209,12 +209,12 @@ defmodule MusicLibraryWeb.RecordComponents do
|
||||
"""
|
||||
end
|
||||
|
||||
defp toggle_actions_menu(record_id) do
|
||||
def toggle_actions_menu(record_id) do
|
||||
JS.toggle(to: "#actions-#{record_id}")
|
||||
|> JS.toggle_class("pointer-events-none", to: "#records > li")
|
||||
end
|
||||
|
||||
defp close_actions_menu(record_id) do
|
||||
def close_actions_menu(record_id) do
|
||||
JS.hide(to: "#actions-#{record_id}")
|
||||
|> JS.remove_class("pointer-events-none", to: "#records > li")
|
||||
end
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
defmodule MusicLibraryWeb.CollectionLive.Show do
|
||||
use MusicLibraryWeb, :live_view
|
||||
|
||||
import MusicLibraryWeb.RecordComponents, only: [toggle_actions_menu: 1, close_actions_menu: 1]
|
||||
alias Phoenix.LiveView.JS
|
||||
|
||||
alias MusicLibrary.Records
|
||||
|
||||
@impl true
|
||||
@@ -137,14 +137,4 @@ defmodule MusicLibraryWeb.CollectionLive.Show do
|
||||
|
||||
defp title_segment(:show), do: gettext("Show")
|
||||
defp title_segment(:edit), do: gettext("Edit")
|
||||
|
||||
defp toggle_actions_menu(record_id) do
|
||||
JS.toggle(to: "#actions-#{record_id}")
|
||||
|> JS.toggle_class("pointer-events-none", to: "#records > li")
|
||||
end
|
||||
|
||||
defp close_actions_menu(record_id) do
|
||||
JS.hide(to: "#actions-#{record_id}")
|
||||
|> JS.remove_class("pointer-events-none", to: "#records > li")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
defmodule MusicLibraryWeb.RecordLive.ImportComponent do
|
||||
use MusicLibraryWeb, :live_component
|
||||
|
||||
import MusicLibraryWeb.RecordComponents, only: [toggle_actions_menu: 1, close_actions_menu: 1]
|
||||
alias MusicLibrary.Records
|
||||
|
||||
@impl true
|
||||
@@ -152,14 +153,4 @@ defmodule MusicLibraryWeb.RecordLive.ImportComponent do
|
||||
defp search(mb_query) do
|
||||
Records.search_release_group(mb_query, limit: 10)
|
||||
end
|
||||
|
||||
defp toggle_actions_menu(record_id) do
|
||||
JS.toggle(to: "#actions-#{record_id}")
|
||||
|> JS.toggle_class("pointer-events-none", to: "#records > li")
|
||||
end
|
||||
|
||||
defp close_actions_menu(record_id) do
|
||||
JS.hide(to: "#actions-#{record_id}")
|
||||
|> JS.remove_class("pointer-events-none", to: "#records > li")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
defmodule MusicLibraryWeb.WishlistLive.Show do
|
||||
use MusicLibraryWeb, :live_view
|
||||
|
||||
import MusicLibraryWeb.RecordComponents, only: [toggle_actions_menu: 1, close_actions_menu: 1]
|
||||
alias MusicLibrary.Records
|
||||
|
||||
@impl true
|
||||
@@ -134,14 +135,4 @@ defmodule MusicLibraryWeb.WishlistLive.Show do
|
||||
|
||||
defp title_segment(:show), do: gettext("Show")
|
||||
defp title_segment(:edit), do: gettext("Edit")
|
||||
|
||||
defp toggle_actions_menu(record_id) do
|
||||
JS.toggle(to: "#actions-#{record_id}")
|
||||
|> JS.toggle_class("pointer-events-none", to: "#records > li")
|
||||
end
|
||||
|
||||
defp close_actions_menu(record_id) do
|
||||
JS.hide(to: "#actions-#{record_id}")
|
||||
|> JS.remove_class("pointer-events-none", to: "#records > li")
|
||||
end
|
||||
end
|
||||
|
||||
+15
-15
@@ -53,7 +53,7 @@ msgstr ""
|
||||
#: lib/music_library_web/components/record_components.ex:161
|
||||
#: lib/music_library_web/live/collection_live/show.ex:139
|
||||
#: lib/music_library_web/live/collection_live/show.html.heex:70
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:136
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:137
|
||||
#: lib/music_library_web/live/wishlist_live/show.html.heex:70
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Edit"
|
||||
@@ -146,7 +146,7 @@ msgstr ""
|
||||
msgid "No cover selected"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/record_live/import_component.ex:45
|
||||
#: lib/music_library_web/live/record_live/import_component.ex:46
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "No results"
|
||||
msgstr ""
|
||||
@@ -197,7 +197,7 @@ msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/record_live/form_component.ex:123
|
||||
#: lib/music_library_web/live/wishlist_live/index.ex:148
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:105
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:106
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Record updated successfully"
|
||||
msgstr ""
|
||||
@@ -222,19 +222,19 @@ msgstr ""
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/record_live/import_component.ex:23
|
||||
#: lib/music_library_web/live/record_live/import_component.ex:24
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Search for a record on MusicBrainz"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/record_live/import_component.ex:24
|
||||
#: lib/music_library_web/live/record_live/import_component.ex:25
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Search for records"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/components/record_components.ex:141
|
||||
#: lib/music_library_web/live/collection_live/show.ex:138
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:135
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:136
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Show"
|
||||
msgstr ""
|
||||
@@ -264,7 +264,7 @@ msgstr ""
|
||||
#: lib/music_library_web/live/collection_live/index.ex:21
|
||||
#: lib/music_library_web/live/collection_live/show.ex:12
|
||||
#: lib/music_library_web/live/wishlist_live/index.ex:21
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:10
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:11
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "The application has been updated, please reload."
|
||||
msgstr ""
|
||||
@@ -308,7 +308,7 @@ msgstr ""
|
||||
#: lib/music_library_web/components/layouts/app.html.heex:20
|
||||
#: lib/music_library_web/live/artist_live/show.html.heex:72
|
||||
#: lib/music_library_web/live/wishlist_live/index.ex:83
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:129
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:130
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Wishlist"
|
||||
msgstr ""
|
||||
@@ -341,7 +341,7 @@ msgstr ""
|
||||
msgid "Scrobble activity"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/record_live/import_component.ex:80
|
||||
#: lib/music_library_web/live/record_live/import_component.ex:81
|
||||
#: lib/music_library_web/live/stats_live/index.html.heex:169
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Choose which format to import"
|
||||
@@ -370,13 +370,13 @@ msgid "Includes"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/collection_live/show.ex:54
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:52
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:53
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Error refreshing MusicBrainz data"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/collection_live/show.ex:46
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:44
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:45
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "MusicBrainz data refreshed successfully"
|
||||
msgstr ""
|
||||
@@ -387,12 +387,12 @@ msgid "Refresh LastFm Feed"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/collection_live/show.ex:86
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:64
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:65
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Cover refreshed successfully"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:72
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:73
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Error refreshing Cover"
|
||||
msgstr ""
|
||||
@@ -459,13 +459,13 @@ msgid "Loading play count"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/collection_live/show.ex:74
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:92
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:93
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Error populating genres"
|
||||
msgstr ""
|
||||
|
||||
#: lib/music_library_web/live/collection_live/show.ex:66
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:84
|
||||
#: lib/music_library_web/live/wishlist_live/show.ex:85
|
||||
#, elixir-autogen, elixir-format
|
||||
msgid "Genres populated successfully"
|
||||
msgstr ""
|
||||
|
||||
Reference in New Issue
Block a user