diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index 5798ad1ac..c10183481 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -30,12 +30,12 @@ import { roomQuery } from '~/graphql/Rooms' import { messageQuery } from '~/graphql/Messages' export default { - name: 'Chat', - props: { - theme: { - type: String, - } + name: 'Chat', + props: { + theme: { + type: String, }, + }, data() { return { currentUserId: '1234', @@ -126,27 +126,27 @@ export default { methods: { fetchMessages({ room, options = {} }) { - console.log(room, options) + // console.log(room, options) this.messagesLoaded = false setTimeout(async () => { if (options.reset) { - console.log('reset messages') + // console.log('reset messages') this.messages = [] // this.addMessages(true) } else { try { const { - data: { Message }, - } = await this.$apollo.query({ + data: { Message }, + } = await this.$apollo.query({ query: messageQuery(), variables: { roomId: room.id, - } + }, }) - console.log('Messages', Message) - this.messages = Message + // console.log('Messages', Message) + this.messages = Message } catch (error) { - console.log('Error', error) - this.messages = [] //this.addMessages(true) + // console.log('Error', error) + this.messages = [] // this.addMessages(true) this.$toast.error(error.message) } } @@ -217,10 +217,8 @@ export default { if (!Room) { this.rooms = [] return - } - + } this.rooms = Room - }, error(error) { this.rooms = [] diff --git a/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue b/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue new file mode 100644 index 000000000..3384c55b6 --- /dev/null +++ b/webapp/components/ChatNotificationMenu/ChatNotificationMenu.vue @@ -0,0 +1,67 @@ + + + + + diff --git a/webapp/components/HeaderMenu/HeaderMenu.vue b/webapp/components/HeaderMenu/HeaderMenu.vue index b5622d7ed..bef73186b 100644 --- a/webapp/components/HeaderMenu/HeaderMenu.vue +++ b/webapp/components/HeaderMenu/HeaderMenu.vue @@ -92,6 +92,10 @@ + + + + @@ -265,6 +269,7 @@ import SearchField from '~/components/features/SearchField/SearchField.vue' import NotificationMenu from '~/components/NotificationMenu/NotificationMenu' import links from '~/constants/links.js' import PageParamsLink from '~/components/_new/features/PageParamsLink/PageParamsLink.vue' +import ChatNotificationMenu from '~/components/ChatNotificationMenu/ChatNotificationMenu' export default { components: { @@ -278,6 +283,7 @@ export default { NotificationMenu, PageParamsLink, SearchField, + ChatNotificationMenu, }, props: { showMobileMenu: { type: Boolean, default: false }, diff --git a/webapp/graphql/Messages.js b/webapp/graphql/Messages.js index 9ecd49dd2..099a7265e 100644 --- a/webapp/graphql/Messages.js +++ b/webapp/graphql/Messages.js @@ -2,7 +2,7 @@ import gql from 'graphql-tag' export const messageQuery = () => { return gql` - query($roomId: ID!) { + query ($roomId: ID!) { Message(roomId: $roomId) { id content @@ -13,4 +13,3 @@ export const messageQuery = () => { } ` } - diff --git a/webapp/graphql/Rooms.js b/webapp/graphql/Rooms.js index 4f4c67449..e8f1d9f6f 100644 --- a/webapp/graphql/Rooms.js +++ b/webapp/graphql/Rooms.js @@ -1,12 +1,12 @@ import gql from 'graphql-tag' export const roomQuery = () => gql` - query { - Room { - id - users { - id - } - } + query { + Room { + id + users { + id } + } + } ` diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 29448fa10..e3cd54aa3 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -692,7 +692,8 @@ }, "group": "Beschreibung", "headerMenuButton": { - "tooltip": "Meine Benachrichtigungen" + "tooltip": "Meine Benachrichtigungen", + "chat": "Meine Chat" }, "markAllAsRead": "Markiere alle als gelesen", "pageLink": "Alle Benachrichtigungen", diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 13a040d36..26564850f 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -692,7 +692,8 @@ }, "group": "Description", "headerMenuButton": { - "tooltip": "My notifications" + "tooltip": "My notifications", + "chat": "My Chat" }, "markAllAsRead": "Mark all as read", "pageLink": "All notifications", diff --git a/webapp/pages/chat.vue b/webapp/pages/chat.vue index 6ea3f47b3..ad824a67d 100644 --- a/webapp/pages/chat.vue +++ b/webapp/pages/chat.vue @@ -1,9 +1,9 @@ diff --git a/webapp/plugins/vue-advanced-chat.js b/webapp/plugins/vue-advanced-chat.js index 6d5187789..487f1d213 100644 --- a/webapp/plugins/vue-advanced-chat.js +++ b/webapp/plugins/vue-advanced-chat.js @@ -1,7 +1,6 @@ import { register } from 'vue-advanced-chat' export default ({ app }) => { - if(process.client){ - register() - } + if (process.client) { + register() + } } - diff --git a/webapp/static/img/empty/chat-bubble.svg b/webapp/static/img/empty/chat-bubble.svg new file mode 100644 index 000000000..b840e9c37 --- /dev/null +++ b/webapp/static/img/empty/chat-bubble.svg @@ -0,0 +1 @@ + \ No newline at end of file