From 9b07ba6efe53d55257eb20414122159c9162dc1e Mon Sep 17 00:00:00 2001 From: synan798 Date: Sun, 8 Dec 2024 15:21:48 +0100 Subject: [PATCH 01/25] added working playlist view --- components/playlists/PlaylistBox.vue | 37 +++++++++++++++++ components/playlists/PlaylistView.vue | 60 +++++++++++++++++++++++++++ components/profile/Friendlist.vue | 8 ++-- pages/playlists.vue | 25 +++++++++++ types/api/playlists.ts | 10 +++++ 5 files changed, 136 insertions(+), 4 deletions(-) create mode 100644 components/playlists/PlaylistBox.vue create mode 100644 components/playlists/PlaylistView.vue create mode 100644 pages/playlists.vue create mode 100644 types/api/playlists.ts diff --git a/components/playlists/PlaylistBox.vue b/components/playlists/PlaylistBox.vue new file mode 100644 index 0000000..593043e --- /dev/null +++ b/components/playlists/PlaylistBox.vue @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/components/playlists/PlaylistView.vue b/components/playlists/PlaylistView.vue new file mode 100644 index 0000000..ebeddc3 --- /dev/null +++ b/components/playlists/PlaylistView.vue @@ -0,0 +1,60 @@ + + + diff --git a/components/profile/Friendlist.vue b/components/profile/Friendlist.vue index 491f1a7..25bf86e 100644 --- a/components/profile/Friendlist.vue +++ b/components/profile/Friendlist.vue @@ -22,18 +22,18 @@ async function getFriendships() { }); } -function addFriend() { +/*function addFriend() { const newFriend = { friend_username: "sfsdf", } friends.value.push(newFriend) -} +}*/ \ No newline at end of file diff --git a/pages/playlists.vue b/pages/playlists.vue new file mode 100644 index 0000000..0621356 --- /dev/null +++ b/pages/playlists.vue @@ -0,0 +1,25 @@ + + + \ No newline at end of file diff --git a/types/api/playlists.ts b/types/api/playlists.ts new file mode 100644 index 0000000..cac3d37 --- /dev/null +++ b/types/api/playlists.ts @@ -0,0 +1,10 @@ +import type * as url from "node:url"; + +export interface GetPlaylistResponse { + id: number, + spotifyId: string, + name: string, + cover: url.URL | null, + enabled: boolean, + categories: string[] +} \ No newline at end of file From e1769180011f05b6ecd62f9311d9c4c2949de643 Mon Sep 17 00:00:00 2001 From: synan798 Date: Sun, 8 Dec 2024 16:11:11 +0100 Subject: [PATCH 02/25] added scroll effect for long names --- components/playlists/PlaylistBox.vue | 77 ++++++++++++++++++++------- components/playlists/PlaylistView.vue | 3 -- 2 files changed, 59 insertions(+), 21 deletions(-) diff --git a/components/playlists/PlaylistBox.vue b/components/playlists/PlaylistBox.vue index 593043e..07360f2 100644 --- a/components/playlists/PlaylistBox.vue +++ b/components/playlists/PlaylistBox.vue @@ -13,25 +13,66 @@ + + + + + \ No newline at end of file diff --git a/components/playlists/PlaylistView.vue b/components/playlists/PlaylistView.vue index ebeddc3..2a64d3e 100644 --- a/components/playlists/PlaylistView.vue +++ b/components/playlists/PlaylistView.vue @@ -1,10 +1,8 @@ + + diff --git a/layouts/FooterView.vue b/layouts/FooterView.vue index 6381c9d..18f46f4 100644 --- a/layouts/FooterView.vue +++ b/layouts/FooterView.vue @@ -7,7 +7,7 @@
-
+
From 4f9a03b23a0ac4e2490d8f9edb573d54eced293d Mon Sep 17 00:00:00 2001 From: synan798 Date: Tue, 10 Dec 2024 08:45:48 +0100 Subject: [PATCH 04/25] resized PlaylistsBoxes and added 'Add Playlists' button --- components/playlists/PlaylistBox.vue | 50 +++++++++++---------------- components/playlists/PlaylistView.vue | 22 +++--------- 2 files changed, 25 insertions(+), 47 deletions(-) diff --git a/components/playlists/PlaylistBox.vue b/components/playlists/PlaylistBox.vue index cd9923e..21b836c 100644 --- a/components/playlists/PlaylistBox.vue +++ b/components/playlists/PlaylistBox.vue @@ -7,7 +7,12 @@ }, name: { type: String, - default: 'Playlist' + default: 'Playlist', + required: true + }, + controlElement: { + type: String, + default: null } }); @@ -15,58 +20,43 @@ \ No newline at end of file From b9c61240442702a4ed02f19ebc502136ce4ed79a Mon Sep 17 00:00:00 2001 From: synan798 Date: Wed, 11 Dec 2024 12:21:59 +0100 Subject: [PATCH 09/25] added modal for accepting friend requests --- components/UsersView.vue | 23 ++++-- components/home/Users/UserBox.vue | 26 ++++-- components/profile/Friendlist.vue | 8 +- components/profile/UserModal.vue | 132 ++++++++++++++++++++++++++++++ types/components/users.view.ts | 3 +- 5 files changed, 176 insertions(+), 16 deletions(-) create mode 100644 components/profile/UserModal.vue diff --git a/components/UsersView.vue b/components/UsersView.vue index 482aae8..0193f57 100644 --- a/components/UsersView.vue +++ b/components/UsersView.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/components/profile/Friendlist.vue b/components/profile/Friendlist.vue index fe08485..dcd4287 100644 --- a/components/profile/Friendlist.vue +++ b/components/profile/Friendlist.vue @@ -4,6 +4,7 @@ import { UserViewType } from "@/types/components/users.view"; const requests: Ref = useState("incoming_friendships", () => []) const friends: Ref = useState("accepted_friendships", () => []) +const sentRequests: Ref = useState("outgoing_friendships", () => []) const session = useSupabaseSession() @@ -22,6 +23,7 @@ async function getFriendships() { .then((data) => { requests.value = data.filter((item) => item.request_type == FriendshipType.INCOMING && item.status === FriendshipStatus.PENDING) friends.value = data.filter((item) => item.status === FriendshipStatus.ACCEPTED) + sentRequests.value = data.filter((item) => item.request_type == FriendshipType.OUTGOING && item.status === FriendshipStatus.PENDING) }); } @@ -35,7 +37,8 @@ const addFriend = async () => { } }); console.log('Friend request sent successfully:', data); - newFriendError.value = ''; + newFriendError.value = ''; + await getFriendships(); } catch (err) { if (err.response) { newFriendError.value = "Please check your input." @@ -51,7 +54,8 @@ const addFriend = async () => { \ No newline at end of file diff --git a/components/profile/UserModal.vue b/components/profile/UserModal.vue index a2e8a46..e0de945 100644 --- a/components/profile/UserModal.vue +++ b/components/profile/UserModal.vue @@ -1,6 +1,8 @@ \ No newline at end of file diff --git a/components/profile/Friendlist.vue b/components/profile/Friendlist.vue index dcd4287..da5daa2 100644 --- a/components/profile/Friendlist.vue +++ b/components/profile/Friendlist.vue @@ -53,9 +53,9 @@ const addFriend = async () => { \ No newline at end of file diff --git a/components/profile/Friendlist.vue b/components/profile/Friendlist.vue index da5daa2..7835034 100644 --- a/components/profile/Friendlist.vue +++ b/components/profile/Friendlist.vue @@ -38,6 +38,7 @@ const addFriend = async () => { }); console.log('Friend request sent successfully:', data); newFriendError.value = ''; + newFriend.value = '' await getFriendships(); } catch (err) { if (err.response) { diff --git a/components/profile/UserModal.vue b/components/profile/UserModal.vue index 386b405..cb96b0b 100644 --- a/components/profile/UserModal.vue +++ b/components/profile/UserModal.vue @@ -64,12 +64,6 @@ async function handleFriendship(action: FriendshipAction) { } console.log('emit: user-modal') emit('refresh') - if (action === FriendshipAction.ACCEPT) { - console.log() - } - else { - console.log("Decline") - } }; async function getFriendInformation() { @@ -95,6 +89,9 @@ async function getFriendInformation() {
+
+ +
From 9050e6f26b6bd6bff74d773db31c28df2041ac08 Mon Sep 17 00:00:00 2001 From: synan798 Date: Wed, 11 Dec 2024 22:38:59 +0100 Subject: [PATCH 15/25] fixed vue warning --- components/home/Users/UserBox.vue | 46 +++++++++++++++++-------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/components/home/Users/UserBox.vue b/components/home/Users/UserBox.vue index 9add244..8905ef2 100644 --- a/components/home/Users/UserBox.vue +++ b/components/home/Users/UserBox.vue @@ -45,28 +45,32 @@ const showModal = ref(false); \ No newline at end of file From 93cec65b84806aa49959882560475bcc76b61fd2 Mon Sep 17 00:00:00 2001 From: synan798 Date: Wed, 11 Dec 2024 22:57:03 +0100 Subject: [PATCH 16/25] fixed ESLint warnings --- components/home/Users/UserBox.vue | 6 ++++-- pages/index.vue | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/home/Users/UserBox.vue b/components/home/Users/UserBox.vue index 8905ef2..23bc568 100644 --- a/components/home/Users/UserBox.vue +++ b/components/home/Users/UserBox.vue @@ -46,12 +46,14 @@ const showModal = ref(false);