From 751c8b60a66d6615abd03816f6c809236f0b55c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 13 Jul 2023 12:02:53 +0200 Subject: [PATCH 001/181] Add headline to chat page --- webapp/locales/de.json | 3 +++ webapp/locales/en.json | 3 +++ webapp/pages/chat.vue | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/webapp/locales/de.json b/webapp/locales/de.json index a9a8e9ed4..450f5b3a0 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -78,6 +78,9 @@ } }, "chat": { + "page": { + "headline": "Chat" + }, "userProfileButton": { "label": "Chat", "tooltip": "Chatte mit „{name}“" diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 9af3e11af..bfb8b34c2 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -78,6 +78,9 @@ } }, "chat": { + "page": { + "headline": "Chat" + }, "userProfileButton": { "label": "Chat", "tooltip": "Chat with “{name}”" diff --git a/webapp/pages/chat.vue b/webapp/pages/chat.vue index 61192ea49..b23a6e8dc 100644 --- a/webapp/pages/chat.vue +++ b/webapp/pages/chat.vue @@ -1,5 +1,8 @@ diff --git a/webapp/graphql/Rooms.js b/webapp/graphql/Rooms.js index e28702f77..c659ba85c 100644 --- a/webapp/graphql/Rooms.js +++ b/webapp/graphql/Rooms.js @@ -27,3 +27,11 @@ export const createRoom = () => gql` } } ` + +export const unreadRoomsQuery = () => { + return gql` + query { + UnreadRooms + } + ` +} From db594650f9308e8c3bdd5e396c087598ae932d82 Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Fri, 14 Jul 2023 18:53:56 +0200 Subject: [PATCH 023/181] feat(webapp): mark messages as seen --- webapp/components/Chat/Chat.vue | 71 +++++++++++++++++++-------------- webapp/graphql/Messages.js | 8 ++++ 2 files changed, 49 insertions(+), 30 deletions(-) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index 95bf5da95..8c4aaff69 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -59,7 +59,7 @@ diff --git a/webapp/store/chat.js b/webapp/store/chat.js index ed6b5256c..1e0b496ac 100644 --- a/webapp/store/chat.js +++ b/webapp/store/chat.js @@ -14,6 +14,9 @@ export const mutations = { UPDATE_ROOM_COUNT(state, count) { state.unreadRoomCount = count }, + UPDATE_ROOM_ID(state, roomid) { + state.roomId = roomid || null + }, } export const getters = { From 26282c67b7bd6d44be3334342d6269068471bf4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 19 Jul 2023 16:41:23 +0200 Subject: [PATCH 143/181] =?UTF-8?q?Make=20user=20search=20in=20chats=20fun?= =?UTF-8?q?ction=20=E2=80=93=20second=20step?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Chat/AddChatRoomByUserSearch.vue | 110 ++++++++++++++++++ webapp/components/Chat/Chat.vue | 2 +- webapp/pages/chat.vue | 18 +-- 3 files changed, 122 insertions(+), 8 deletions(-) create mode 100644 webapp/components/Chat/AddChatRoomByUserSearch.vue diff --git a/webapp/components/Chat/AddChatRoomByUserSearch.vue b/webapp/components/Chat/AddChatRoomByUserSearch.vue new file mode 100644 index 000000000..b5cf0fd4c --- /dev/null +++ b/webapp/components/Chat/AddChatRoomByUserSearch.vue @@ -0,0 +1,110 @@ + + + + + diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index fccaee5b8..68abfe657 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -364,7 +364,7 @@ export default { }, addRoom() { - this.$emit('open-user-search') + this.$emit('open-close-user-search') }, }, } diff --git a/webapp/pages/chat.vue b/webapp/pages/chat.vue index 8d9d55e46..bdc2a1ee2 100644 --- a/webapp/pages/chat.vue +++ b/webapp/pages/chat.vue @@ -1,33 +1,34 @@ From 45dba25a7ad28852dcdf5c8acd9ffc9c8852b371 Mon Sep 17 00:00:00 2001 From: Markus Date: Wed, 19 Jul 2023 17:24:37 +0200 Subject: [PATCH 144/181] [fix] changed css rule for single chat icon --- webapp/components/Chat/Chat.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index f947f4886..139e30290 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -425,7 +425,7 @@ body { } } -.single-chat-bubble { +.ds-flex-item.single-chat-bubble { margin-right: 1em; } From 3d9a9cd5a096d4b1fbbf82b7597db53a03542b57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 19 Jul 2023 17:47:56 +0200 Subject: [PATCH 145/181] Create the chat room on user search in chats function --- .../Chat/AddChatRoomByUserSearch.vue | 58 +------------------ webapp/components/Chat/Chat.vue | 36 +++++++----- webapp/pages/chat.vue | 8 ++- 3 files changed, 28 insertions(+), 74 deletions(-) diff --git a/webapp/components/Chat/AddChatRoomByUserSearch.vue b/webapp/components/Chat/AddChatRoomByUserSearch.vue index b5cf0fd4c..a9a2a5bf6 100644 --- a/webapp/components/Chat/AddChatRoomByUserSearch.vue +++ b/webapp/components/Chat/AddChatRoomByUserSearch.vue @@ -5,28 +5,11 @@ - diff --git a/webapp/pages/chat.vue b/webapp/pages/chat.vue index bdc2a1ee2..a16fca5c5 100644 --- a/webapp/pages/chat.vue +++ b/webapp/pages/chat.vue @@ -3,13 +3,14 @@ {{ $t('chat.page.headline') }} @@ -43,8 +44,9 @@ export default { ...mapMutations({ showChat: 'chat/SET_OPEN_CHAT', }), - loadChatRooms(newChatRoomID) { - console.log('loadChatRooms !!! newChatRoomID: ', newChatRoomID) + addChatRoom(userID) { + console.log('addChatRoom !!! newChatRoomID: ', userID) + this.$refs.chat.newRoom(userID) }, }, } From 419261229346941f99f92dbc487b36795721c290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 19 Jul 2023 17:51:05 +0200 Subject: [PATCH 146/181] Fix linting --- webapp/components/Chat/AddChatRoomByUserSearch.vue | 2 -- webapp/components/Group/AddGroupMember.vue | 2 -- webapp/pages/chat.vue | 3 +-- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/webapp/components/Chat/AddChatRoomByUserSearch.vue b/webapp/components/Chat/AddChatRoomByUserSearch.vue index a9a2a5bf6..0e7b243d8 100644 --- a/webapp/components/Chat/AddChatRoomByUserSearch.vue +++ b/webapp/components/Chat/AddChatRoomByUserSearch.vue @@ -11,12 +11,10 @@ @@ -53,4 +59,10 @@ export default { background-color: white; padding: $space-base; } +.ds-flex.headline { + justify-content: space-between; +} +.ds-flex.headline .close-button { + margin-top: -6px; +} From a82d245f636230be4030f1b75a5703ece532fa3f Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 20 Jul 2023 11:03:20 +0200 Subject: [PATCH 152/181] Change toast error to error.message. --- webapp/components/Chat/Chat.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index d1a60a87d..39dd465e2 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -419,7 +419,7 @@ export default { this.fetchRooms({ room: CreateRoom, options: { refetch: true } }) }) .catch((error) => { - this.$toast.error(error) + this.$toast.error(error.message) }) .finally(() => { // this.loading = false From 13da3ba3f46482c1488fab85300d1075c183255e Mon Sep 17 00:00:00 2001 From: elweyn Date: Thu, 20 Jul 2023 11:35:06 +0200 Subject: [PATCH 153/181] Add returned properties to the CreateRoom mutation, add emit to change the roomID. --- webapp/components/Chat/Chat.vue | 2 ++ webapp/graphql/Rooms.js | 12 ++++++++++++ webapp/pages/chat.vue | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index 39dd465e2..0cc9bc28b 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -417,6 +417,8 @@ export default { }) .then(({ data: { CreateRoom } }) => { this.fetchRooms({ room: CreateRoom, options: { refetch: true } }) + this.roomId = CreateRoom.id + this.$emit('show-chat', CreateRoom.id) }) .catch((error) => { this.$toast.error(error.message) diff --git a/webapp/graphql/Rooms.js b/webapp/graphql/Rooms.js index 757a6cfa4..3433a84a7 100644 --- a/webapp/graphql/Rooms.js +++ b/webapp/graphql/Rooms.js @@ -5,6 +5,18 @@ export const createRoom = () => gql` CreateRoom(userId: $userId) { id roomId + roomName + lastMessageAt + unreadCount + #avatar + users { + _id + id + name + avatar { + url + } + } } } ` diff --git a/webapp/pages/chat.vue b/webapp/pages/chat.vue index acb186f4e..96df8cc6b 100644 --- a/webapp/pages/chat.vue +++ b/webapp/pages/chat.vue @@ -12,6 +12,7 @@ :roomId="getShowChat.showChat ? getShowChat.roomID : null" ref="chat" @toggle-user-search="showUserSearch = !showUserSearch" + :show-room="showRoom" /> @@ -47,6 +48,9 @@ export default { addChatRoom(userID) { this.$refs.chat.newRoom(userID) }, + showRoom(roomId) { + this.showChat({ showChat: true, roomID: roomId }) + } }, } From dee77df5f60da57449faa72645985447d44ba6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 20 Jul 2023 12:02:24 +0200 Subject: [PATCH 154/181] Cleanup --- webapp/components/Chat/AddChatRoomByUserSearch.vue | 1 - webapp/pages/chat.vue | 2 -- 2 files changed, 3 deletions(-) diff --git a/webapp/components/Chat/AddChatRoomByUserSearch.vue b/webapp/components/Chat/AddChatRoomByUserSearch.vue index f88b4f1e6..10a4d2bc4 100644 --- a/webapp/components/Chat/AddChatRoomByUserSearch.vue +++ b/webapp/components/Chat/AddChatRoomByUserSearch.vue @@ -1,6 +1,5 @@