@@ -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/components/NotificationMenu/NotificationMenu.vue b/webapp/components/NotificationMenu/NotificationMenu.vue
index a8609f582..72f539a42 100644
--- a/webapp/components/NotificationMenu/NotificationMenu.vue
+++ b/webapp/components/NotificationMenu/NotificationMenu.vue
@@ -149,7 +149,7 @@ export default {
return {
notifications: unionBy(
[newNotification],
- previousResult.notifications,
+ previousResult?.notifications,
(notification) => notification.id,
).sort((a, b) => new Date(b.updatedAt) - new Date(a.updatedAt)),
}
diff --git a/webapp/graphql/Messages.js b/webapp/graphql/Messages.js
new file mode 100644
index 000000000..099a7265e
--- /dev/null
+++ b/webapp/graphql/Messages.js
@@ -0,0 +1,15 @@
+import gql from 'graphql-tag'
+
+export const messageQuery = () => {
+ return gql`
+ query ($roomId: ID!) {
+ Message(roomId: $roomId) {
+ id
+ content
+ author {
+ id
+ }
+ }
+ }
+ `
+}
diff --git a/webapp/graphql/PostMutations.js b/webapp/graphql/PostMutations.js
index c3a9369c3..73e9f8ebe 100644
--- a/webapp/graphql/PostMutations.js
+++ b/webapp/graphql/PostMutations.js
@@ -39,6 +39,7 @@ export default () => {
deleted
postType
author {
+ id
name
}
categories {
diff --git a/webapp/graphql/Rooms.js b/webapp/graphql/Rooms.js
new file mode 100644
index 000000000..7bab25509
--- /dev/null
+++ b/webapp/graphql/Rooms.js
@@ -0,0 +1,29 @@
+import gql from 'graphql-tag'
+
+export const roomQuery = () => gql`
+ query {
+ Room {
+ id
+ roomId
+ roomName
+ avatar
+ users {
+ _id
+ id
+ name
+ avatar {
+ url
+ }
+ }
+ }
+ }
+`
+
+export const createRoom = () => gql`
+ mutation ($userId: ID!) {
+ CreateRoom(userId: $userId) {
+ id
+ roomId
+ }
+ }
+`
diff --git a/webapp/graphql/User.js b/webapp/graphql/User.js
index f7fd3c940..fcdac0989 100644
--- a/webapp/graphql/User.js
+++ b/webapp/graphql/User.js
@@ -243,6 +243,7 @@ export const notificationAdded = () => {
${userFragment}
${commentFragment}
${postFragment}
+ ${groupFragment}
subscription notifications($userId: ID!) {
notificationAdded(userId: $userId) {
@@ -251,6 +252,9 @@ export const notificationAdded = () => {
reason
createdAt
updatedAt
+ to {
+ ...user
+ }
from {
__typename
... on Post {
@@ -271,6 +275,12 @@ export const notificationAdded = () => {
}
}
}
+ ... on Group {
+ ...group
+ }
+ }
+ relatedUser {
+ ...user
}
}
}
diff --git a/webapp/layouts/default.spec.js b/webapp/layouts/default.spec.js
index bf54d3581..1b83491d7 100644
--- a/webapp/layouts/default.spec.js
+++ b/webapp/layouts/default.spec.js
@@ -36,6 +36,9 @@ describe('default.vue', () => {
store = new Vuex.Store({
getters: {
'auth/isLoggedIn': () => true,
+ 'chat/showChat': () => {
+ return { showChat: false, roomID: 'u0' }
+ },
},
})
})
diff --git a/webapp/layouts/default.vue b/webapp/layouts/default.vue
index 524a530d1..8b6b80604 100644
--- a/webapp/layouts/default.vue
+++ b/webapp/layouts/default.vue
@@ -13,21 +13,32 @@
+
+
+ RoomID: {{ $store.getters['chat/showChat'].roomID }}
+
+ x
+
+
+
+
+ >
-
diff --git a/webapp/pages/profile/_id/_slug.vue b/webapp/pages/profile/_id/_slug.vue
index 06e95abb4..62d2f1be7 100644
--- a/webapp/pages/profile/_id/_slug.vue
+++ b/webapp/pages/profile/_id/_slug.vue
@@ -79,6 +79,15 @@
@optimistic="optimisticFollow"
@update="updateFollow"
/>
+
+
+
diff --git a/webapp/plugins/vue-advanced-chat.js b/webapp/plugins/vue-advanced-chat.js
new file mode 100644
index 000000000..487f1d213
--- /dev/null
+++ b/webapp/plugins/vue-advanced-chat.js
@@ -0,0 +1,6 @@
+import { register } from 'vue-advanced-chat'
+export default ({ app }) => {
+ 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
diff --git a/webapp/store/chat.js b/webapp/store/chat.js
new file mode 100644
index 000000000..2ee8a47ad
--- /dev/null
+++ b/webapp/store/chat.js
@@ -0,0 +1,22 @@
+export const state = () => {
+ return {
+ showChat: false,
+ roomID: 'u0',
+ }
+}
+
+export const mutations = {
+ SET_OPEN_CHAT(state, ctx) {
+ state.showChat = ctx.showChat || false
+ state.roomID = ctx.roomID || 'u0'
+ },
+}
+
+export const getters = {
+ showChat(state) {
+ return state
+ },
+ roomID(state) {
+ return state
+ },
+}
diff --git a/webapp/yarn.lock b/webapp/yarn.lock
index df00613b7..6b95b979b 100644
--- a/webapp/yarn.lock
+++ b/webapp/yarn.lock
@@ -10503,6 +10503,11 @@ emittery@^0.13.1:
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad"
integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==
+emoji-picker-element@1.12.1:
+ version "1.12.1"
+ resolved "https://registry.yarnpkg.com/emoji-picker-element/-/emoji-picker-element-1.12.1.tgz#854a9bbae4d9a04fa2b5cd0763845921f4904c83"
+ integrity sha512-F9AY/re8uqZmBcCXLHLGvyy7fxuMQdZl9R8OToLRH8Vnns+WMX8RYUbI2nSJklzl5+82qzpYWeus1/puDepWcQ==
+
emoji-regex@^7.0.1:
version "7.0.3"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
@@ -14729,6 +14734,11 @@ linkify-it@~3.0.2:
dependencies:
uc.micro "^1.0.1"
+linkifyjs@2.1.9:
+ version "2.1.9"
+ resolved "https://registry.yarnpkg.com/linkifyjs/-/linkifyjs-2.1.9.tgz#af06e45a2866ff06c4766582590d098a4d584702"
+ integrity sha512-74ivurkK6WHvHFozVaGtQWV38FzBwSTGNmJolEgFp7QgR2bl6ArUWlvT4GcHKbPe1z3nWYi+VUdDZk16zDOVug==
+
listr-silent-renderer@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/listr-silent-renderer/-/listr-silent-renderer-1.1.1.tgz#924b5a3757153770bf1a8e3fbf74b8bbf3f9242e"
@@ -21951,6 +21961,14 @@ vt-pbf@^3.1.1:
"@mapbox/vector-tile" "^1.3.1"
pbf "^3.2.1"
+vue-advanced-chat@^2.0.7:
+ version "2.0.7"
+ resolved "https://registry.yarnpkg.com/vue-advanced-chat/-/vue-advanced-chat-2.0.7.tgz#bd35830c19fc5eb4e26545dc554d88e7808913cc"
+ integrity sha512-s+6v+KtVT46lFM8YohneLLS/vN10sSTAPfZiqAczXf13Q8vQWD9rSeWAokL0zuJeQ+jguNgFI6oN2wbI/RC1iw==
+ dependencies:
+ emoji-picker-element "1.12.1"
+ linkifyjs "2.1.9"
+
vue-apollo@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/vue-apollo/-/vue-apollo-3.0.2.tgz#b198ecfa3765850a0b9f2b84ffaa7fbd8ec15f52"
diff --git a/yarn.lock b/yarn.lock
index 9bf803c68..bae0e9a19 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3164,10 +3164,10 @@ cypress-network-idle@^1.14.2:
resolved "https://registry.yarnpkg.com/cypress-network-idle/-/cypress-network-idle-1.14.2.tgz#0837100861feeb5a18f4c2d9815be079f8590f4d"
integrity sha512-xAdR8dH58KFPv8eCDWjviScITrJOcUpuMXYfYTc175nk2/NvnJ+I6ylSn1CM7yZmoV/gLbFa36QLiH5NfNEaLQ==
-cypress@^12.14.0:
- version "12.14.0"
- resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.14.0.tgz#37a19b85f5e9d881995e9fee1ddf41b3d3a623dd"
- integrity sha512-HiLIXKXZaIT1RT7sw1sVPt+qKtis3uYNm6KwC4qoYjabwLKaqZlyS/P+uVvvlBNcHIwL/BC6nQZajpbUd7hOgQ==
+cypress@^12.17.0:
+ version "12.17.0"
+ resolved "https://registry.yarnpkg.com/cypress/-/cypress-12.17.0.tgz#3a907a41c4afbb44be7b84e822e4914d734a6bb0"
+ integrity sha512-nq0ug8Zrjq/2khHU1PTNxg+3/n1oqtmAFCxwQhS6QzkQ4mR6RLitX+cGIOuIMfnEbDAtVub0hZh661FOA16JxA==
dependencies:
"@cypress/request" "^2.88.10"
"@cypress/xvfb" "^1.2.4"
@@ -3206,7 +3206,7 @@ cypress@^12.14.0:
pretty-bytes "^5.6.0"
proxy-from-env "1.0.0"
request-progress "^3.0.0"
- semver "^7.3.2"
+ semver "^7.5.3"
supports-color "^8.1.1"
tmp "~0.2.1"
untildify "^4.0.0"
@@ -5358,10 +5358,10 @@ semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
-semver@^7.3.2, semver@^7.3.5:
- version "7.5.1"
- resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec"
- integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==
+semver@^7.3.5, semver@^7.5.3:
+ version "7.5.4"
+ resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e"
+ integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
dependencies:
lru-cache "^6.0.0"