From d038b001d41e4a6e584b9314a0db0329e36d22fa Mon Sep 17 00:00:00 2001 From: Phan An Date: Sat, 8 Oct 2022 12:54:25 +0200 Subject: [PATCH] feat: revamp the router and routing logic (#1519) --- .eslintrc | 1 - resources/assets/js/App.vue | 18 +- resources/assets/js/__tests__/UnitTestCase.ts | 12 +- resources/assets/js/__tests__/stubs.ts | 1 + resources/assets/js/app.ts | 5 +- .../assets/js/components/album/AlbumCard.vue | 6 +- .../components/album/AlbumContextMenu.spec.ts | 9 +- .../js/components/album/AlbumContextMenu.vue | 31 +- .../js/components/album/AlbumInfo.spec.ts | 3 +- .../assets/js/components/album/AlbumInfo.vue | 12 +- .../js/components/artist/ArtistCard.vue | 12 +- .../artist/ArtistContextMenu.spec.ts | 3 +- .../components/artist/ArtistContextMenu.vue | 27 +- .../js/components/artist/ArtistInfo.spec.ts | 3 +- .../js/components/artist/ArtistInfo.vue | 12 +- .../layout/app-footer/FooterExtraControls.vue | 7 +- .../js/components/layout/app-footer/index.vue | 8 +- .../layout/main-wrapper/MainContent.vue | 22 +- .../layout/main-wrapper/Sidebar.vue | 20 +- .../playlist/CreatePlaylistForm.vue | 8 +- .../PlaylistFolderContextMenu.spec.ts | 5 +- .../playlist/PlaylistFolderContextMenu.vue | 4 +- .../playlist/PlaylistSidebarItem.vue | 11 +- .../CreateSmartPlaylistForm.vue | 26 +- .../screens/AlbumListScreen.spec.ts | 23 +- .../js/components/screens/AlbumScreen.spec.ts | 11 +- .../js/components/screens/AlbumScreen.vue | 24 +- .../components/screens/AllSongsScreen.spec.ts | 13 +- .../js/components/screens/AllSongsScreen.vue | 10 +- .../screens/ArtistListScreen.spec.ts | 23 +- .../components/screens/ArtistScreen.spec.ts | 11 +- .../js/components/screens/ArtistScreen.vue | 28 +- .../screens/FavoritesScreen.spec.ts | 12 +- .../js/components/screens/HomeScreen.spec.ts | 27 +- .../components/screens/PlaylistScreen.spec.ts | 10 +- .../js/components/screens/PlaylistScreen.vue | 36 +- .../js/components/screens/QueueScreen.vue | 21 +- .../screens/RecentlyPlayedScreen.spec.ts | 7 +- .../components/screens/SettingsScreen.spec.ts | 5 +- .../js/components/screens/SettingsScreen.vue | 5 +- .../screens/home/RecentlyPlayedSongs.spec.ts | 3 +- .../screens/home/RecentlyPlayedSongs.vue | 5 +- .../screens/search/SearchExcerptsScreen.vue | 10 +- .../search/SearchSongResultsScreen.spec.ts | 8 +- .../search/SearchSongResultsScreen.vue | 14 +- .../assets/js/components/song/AddToMenu.vue | 5 +- .../components/song/SongContextMenu.spec.ts | 5 +- .../js/components/song/SongContextMenu.vue | 7 +- .../js/components/ui/AlbumArtistThumbnail.vue | 4 +- .../assets/js/components/ui/Equalizer.vue | 2 +- .../js/components/ui/SearchForm.spec.ts | 3 +- .../assets/js/components/ui/SearchForm.vue | 6 +- .../js/components/ui/YouTubeVideoItem.vue | 9 +- .../components/ui/upload/UploadItem.spec.ts | 3 +- .../js/components/ui/upload/UploadItem.vue | 3 +- .../js/components/user/UserCard.spec.ts | 3 +- .../assets/js/components/user/UserCard.vue | 8 +- .../components/utils/GlobalEventListeners.vue | 16 +- resources/assets/js/composables/useScreen.ts | 13 +- .../assets/js/composables/useSongList.ts | 10 +- resources/assets/js/composables/useUpload.ts | 16 +- resources/assets/js/config/events.ts | 1 - resources/assets/js/config/index.ts | 2 +- resources/assets/js/config/routes.ts | 93 ++++++ resources/assets/js/config/upload.types.ts | 15 - resources/assets/js/router.ts | 124 ++++--- resources/assets/js/services/index.ts | 1 + .../js/services/playbackService.spec.ts | 5 - .../assets/js/services/playbackService.ts | 112 +++---- resources/assets/js/services/uploadService.ts | 17 +- .../assets/js/services/youTubeService.spec.ts | 3 - .../assets/js/services/youTubeService.ts | 3 - resources/assets/js/stores/songStore.ts | 5 +- resources/assets/js/symbols.ts | 7 +- resources/assets/js/types.d.ts | 4 - resources/assets/js/utils/common.ts | 8 - resources/assets/js/utils/eventBus.ts | 2 +- resources/assets/js/utils/visualizer.ts | 2 +- resources/views/base.blade.php | 2 +- vite.config.js | 3 - yarn.lock | 314 +++++++++--------- 81 files changed, 776 insertions(+), 632 deletions(-) create mode 100644 resources/assets/js/config/routes.ts diff --git a/.eslintrc b/.eslintrc index 7a09041a..1044ba11 100644 --- a/.eslintrc +++ b/.eslintrc @@ -19,7 +19,6 @@ "@typescript-eslint" ], "globals": { - "KOEL_ENV": "readonly", "FileReader": "readonly", "defineProps": "readonly", "defineEmits": "readonly", diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index 1b4bb05f..06b4af75 100644 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -4,7 +4,7 @@ -
+
@@ -19,17 +19,17 @@
-