diff --git a/cypress/integration/playlists.spec.ts b/cypress/integration/playlists.spec.ts index ae0c8d25..ca290e3a 100644 --- a/cypress/integration/playlists.spec.ts +++ b/cypress/integration/playlists.spec.ts @@ -87,7 +87,7 @@ context('Playlists', () => { .should('be.visible') .and('contain', 'A New Playlist') - cy.get('#playlistWrapper [data-test=screen-placeholder]') + cy.get('#playlistWrapper [data-test=screen-empty-state]') .should('be.visible') .and('contain', 'The playlist is currently empty.') }) diff --git a/cypress/integration/searching.spec.ts b/cypress/integration/searching.spec.ts index 4b424ee3..33cb0a1c 100644 --- a/cypress/integration/searching.spec.ts +++ b/cypress/integration/searching.spec.ts @@ -6,7 +6,7 @@ context('Searching', () => { it('shows the search screen when search box receives focus', () => { cy.get('@searchInput').focus() - cy.get('#searchExcerptsWrapper').within(() => cy.get('[data-test=screen-placeholder]').should('be.visible')) + cy.get('#searchExcerptsWrapper').within(() => cy.get('[data-test=screen-empty-state]').should('be.visible')) }) it('performs an excerpt search', () => { diff --git a/package.json b/package.json index 11cea581..106d47be 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "**/*.php": [ "composer cs" ], - "**/*.ts": [ + "resources/assets/**/*.ts": [ "eslint" ] } diff --git a/resources/assets/js/__tests__/components/screens/album.spec.ts b/resources/assets/js/__tests__/components/screens/album.spec.ts index e787b9b7..da0f51cd 100644 --- a/resources/assets/js/__tests__/components/screens/album.spec.ts +++ b/resources/assets/js/__tests__/components/screens/album.spec.ts @@ -1,4 +1,4 @@ -import Component from '@/components/screens/album.vue' +import Component from '@/components/screens/AlbumScreen.vue' import SongList from '@/components/song/SongList.vue' import { albumInfo as albumInfoService, download } from '@/services' import factory from '@/__tests__/factory' diff --git a/resources/assets/js/__tests__/components/screens/artist.spec.ts b/resources/assets/js/__tests__/components/screens/artist.spec.ts index 4483059d..68358db2 100644 --- a/resources/assets/js/__tests__/components/screens/artist.spec.ts +++ b/resources/assets/js/__tests__/components/screens/artist.spec.ts @@ -1,4 +1,4 @@ -import Component from '@/components/screens/artist.vue' +import Component from '@/components/screens/ArtistScreen.vue' import SongList from '@/components/song/SongList.vue' import { artistInfo as artistInfoService, download } from '@/services' import factory from '@/__tests__/factory' diff --git a/resources/assets/js/__tests__/components/screens/favorites.spec.ts b/resources/assets/js/__tests__/components/screens/favorites.spec.ts index e85fba5d..28df9f27 100644 --- a/resources/assets/js/__tests__/components/screens/favorites.spec.ts +++ b/resources/assets/js/__tests__/components/screens/favorites.spec.ts @@ -1,4 +1,4 @@ -import Component from '@/components/screens/favorites.vue' +import Component from '@/components/screens/FavoritesScreen.vue' import SongList from '@/components/song/SongList.vue' import SongListControls from '@/components/songSongListControls.vue' import { download } from '@/services' @@ -36,7 +36,7 @@ describe('components/screens/favorites', () => { }) await wrapper.vm.$nextTick() - expect(wrapper.has('[data-test=screen-placeholder]')).toBe(true) + expect(wrapper.has('[data-test=screen-empty-state]')).toBe(true) }) it('allows downloading', () => { diff --git a/resources/assets/js/__tests__/components/screens/playlist.spec.ts b/resources/assets/js/__tests__/components/screens/playlist.spec.ts index be3b92ea..bb816076 100644 --- a/resources/assets/js/__tests__/components/screens/playlist.spec.ts +++ b/resources/assets/js/__tests__/components/screens/playlist.spec.ts @@ -1,4 +1,4 @@ -import Component from '@/components/screens/playlist.vue' +import Component from '@/components/screens/PlaylistScreen.vue' import SongList from '@/components/song/SongList.vue' import factory from '@/__tests__/factory' import { eventBus } from '@/utils' @@ -39,7 +39,7 @@ describe('components/screens/playlist', () => { }) }) await wrapper.vm.$nextTick() - expect(wrapper.has('[data-test=screen-placeholder]')).toBe(true) + expect(wrapper.has('[data-test=screen-empty-state]')).toBe(true) }) it('emits an event to delete the playlist', () => { diff --git a/resources/assets/js/__tests__/components/screens/recently-played.spec.ts b/resources/assets/js/__tests__/components/screens/recently-played.spec.ts index a471ed75..07c37276 100644 --- a/resources/assets/js/__tests__/components/screens/recently-played.spec.ts +++ b/resources/assets/js/__tests__/components/screens/recently-played.spec.ts @@ -1,4 +1,4 @@ -import Component from '@/components/screens/recently-played.vue' +import Component from '@/components/screens/RecentlyPlayedScreen.vue' import SongList from '@/components/song/SongList.vue' import factory from '@/__tests__/factory' import { recentlyPlayedStore } from '@/stores' diff --git a/resources/assets/js/components/layout/main-wrapper/main-content.vue b/resources/assets/js/components/layout/main-wrapper/main-content.vue index 28b3ac1f..511e0fcc 100644 --- a/resources/assets/js/components/layout/main-wrapper/main-content.vue +++ b/resources/assets/js/components/layout/main-wrapper/main-content.vue @@ -38,14 +38,14 @@ import QueueScreen from '@/components/screens/QueueScreen.vue' import AlbumListScreen from '@/components/screens/album-list.vue' import ArtistListScreen from '@/components/screens/artist-list.vue' import AllSongsScreen from '@/components/screens/AllSongsScreen.vue' -import PlaylistScreen from '@/components/screens/playlist.vue' -import FavoritesScreen from '@/components/screens/favorites.vue' +import PlaylistScreen from '@/components/screens/PlaylistScreen.vue' +import FavoritesScreen from '@/components/screens/FavoritesScreen.vue' -const RecentlyPlayedScreen = defineAsyncComponent(() => import('@/components/screens/recently-played.vue')) +const RecentlyPlayedScreen = defineAsyncComponent(() => import('@/components/screens/RecentlyPlayedScreen.vue')) const UserListScreen = defineAsyncComponent(() => import('@/components/screens/user-list.vue')) const AlbumArtOverlay = defineAsyncComponent(() => import('@/components/ui/album-art-overlay.vue')) -const AlbumScreen = defineAsyncComponent(() => import('@/components/screens/album.vue')) -const ArtistScreen = defineAsyncComponent(() => import('@/components/screens/artist.vue')) +const AlbumScreen = defineAsyncComponent(() => import('@/components/screens/AlbumScreen.vue')) +const ArtistScreen = defineAsyncComponent(() => import('@/components/screens/ArtistScreen.vue')) const SettingsScreen = defineAsyncComponent(() => import('@/components/screens/settings.vue')) const ProfileScreen = defineAsyncComponent(() => import('@/components/screens/profile.vue')) const YoutubeScreen = defineAsyncComponent(() => import('@/components/screens/youtube.vue')) diff --git a/resources/assets/js/components/screens/album.vue b/resources/assets/js/components/screens/AlbumScreen.vue similarity index 97% rename from resources/assets/js/components/screens/album.vue rename to resources/assets/js/components/screens/AlbumScreen.vue index 02ed4abd..8939f29b 100644 --- a/resources/assets/js/components/screens/album.vue +++ b/resources/assets/js/components/screens/AlbumScreen.vue @@ -43,7 +43,7 @@ - +
@@ -84,6 +84,7 @@ const { showingControls, songListControlConfig, isPhone, + onPressEnter, playAll, playSelected, toggleControls diff --git a/resources/assets/js/components/screens/AllSongsScreen.vue b/resources/assets/js/components/screens/AllSongsScreen.vue index 352052be..e9655089 100644 --- a/resources/assets/js/components/screens/AllSongsScreen.vue +++ b/resources/assets/js/components/screens/AllSongsScreen.vue @@ -20,7 +20,7 @@ - +
@@ -43,6 +43,7 @@ const { showingControls, songListControlConfig, isPhone, + onPressEnter, playAll, playSelected, toggleControls diff --git a/resources/assets/js/components/screens/artist.vue b/resources/assets/js/components/screens/ArtistScreen.vue similarity index 97% rename from resources/assets/js/components/screens/artist.vue rename to resources/assets/js/components/screens/ArtistScreen.vue index f03ae7a7..1a49a403 100644 --- a/resources/assets/js/components/screens/artist.vue +++ b/resources/assets/js/components/screens/ArtistScreen.vue @@ -48,7 +48,7 @@ - +
@@ -84,6 +84,7 @@ const { showingControls, songListControlConfig, isPhone, + onPressEnter, playAll, playSelected, toggleControls diff --git a/resources/assets/js/components/screens/favorites.vue b/resources/assets/js/components/screens/FavoritesScreen.vue similarity index 81% rename from resources/assets/js/components/screens/favorites.vue rename to resources/assets/js/components/screens/FavoritesScreen.vue index 09eddce5..a86f18ff 100644 --- a/resources/assets/js/components/screens/favorites.vue +++ b/resources/assets/js/components/screens/FavoritesScreen.vue @@ -30,9 +30,16 @@ - + - + @@ -42,7 +49,7 @@   icon to mark a song as favorite. - +
@@ -54,7 +61,7 @@ import { useSongList } from '@/composables' import { defineAsyncComponent, toRef } from 'vue' const ScreenHeader = defineAsyncComponent(() => import('@/components/ui/ScreenHeader.vue')) -const ScreenPlaceholder = defineAsyncComponent(() => import('@/components/ui/screen-placeholder.vue')) +const ScreenEmptyState = defineAsyncComponent(() => import('@/components/ui/ScreenEmptyState.vue')) const { SongList, @@ -67,6 +74,7 @@ const { showingControls, songListControlConfig, isPhone, + onPressEnter, playAll, playSelected, toggleControls @@ -75,4 +83,5 @@ const { const allowDownload = toRef(sharedStore.state, 'allowDownload') const download = () => downloadService.fromFavorites() +const removeSelected = () => selectedSongs.value.length && favoriteStore.unlike(selectedSongs.value) diff --git a/resources/assets/js/components/screens/playlist.vue b/resources/assets/js/components/screens/PlaylistScreen.vue similarity index 86% rename from resources/assets/js/components/screens/playlist.vue rename to resources/assets/js/components/screens/PlaylistScreen.vue index 06752ee1..34a3724f 100644 --- a/resources/assets/js/components/screens/playlist.vue +++ b/resources/assets/js/components/screens/PlaylistScreen.vue @@ -36,11 +36,12 @@ v-if="songs.length" ref="songList" :items="songs" - :playlist="playlist" type="playlist" + @press:delete="removeSelected" + @press:enter="onPressEnter" /> - + @@ -56,20 +57,21 @@ or use the "Add To…" button to fill it up. - +