From e482952c2fd18b3ec2bf525493ad222fe3553a62 Mon Sep 17 00:00:00 2001 From: Troplo Date: Thu, 4 Feb 2021 18:23:11 +1100 Subject: [PATCH] 1.0.0-prerelease4 --- package.json | 2 + src/components/Badges.vue | 9 +- src/components/ChatMenu.vue | 14 --- src/components/Navbar.vue | 23 ++-- src/components/NoItems.vue | 10 +- src/components/SidebarChat.vue | 20 +--- src/components/SidebarChatComp.vue | 10 +- src/locales/en.json | 4 +- src/main.js | 4 + src/router/index.js | 33 +++++- src/store/index.js | 8 +- src/views/Avatar.vue | 145 +++++++++++++++++++++++++ src/views/Chat.vue | 2 +- src/views/ChatMessage.vue | 17 +-- src/views/ForumThread.vue | 2 +- src/views/Teams.vue | 163 ++++++++++++++++++++++++++++- src/views/User.vue | 15 ++- yarn.lock | 12 +++ 18 files changed, 418 insertions(+), 75 deletions(-) create mode 100644 src/views/Avatar.vue diff --git a/package.json b/package.json index b86c6c5..faca069 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "crypto-random-string": "^3.3.0", "dotenv-webpack": "^6.0.0", "lodash.throttle": "^4.1.1", + "nprogress": "^0.2.0", "socket.io": "^3.1.0", "tiptap": "^1.32.0", "tiptap-extensions": "^1.35.0", @@ -27,6 +28,7 @@ "vue-i18n": "^8.17.3", "vue-keypress": "^2.1.1", "vue-matomo": "^3.14.0-0", + "vue-nprogress": "^0.2.0", "vue-router": "^3.2.0", "vue-socket.io": "^3.0.10", "vuex": "^3.4.0" diff --git a/src/components/Badges.vue b/src/components/Badges.vue index 04fae23..defa549 100644 --- a/src/components/Badges.vue +++ b/src/components/Badges.vue @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/src/components/SidebarChat.vue b/src/components/SidebarChat.vue index b14f5a3..11f1c6c 100644 --- a/src/components/SidebarChat.vue +++ b/src/components/SidebarChat.vue @@ -1,13 +1,6 @@ diff --git a/src/components/SidebarChatComp.vue b/src/components/SidebarChatComp.vue index aa5a3ef..cca38ee 100644 --- a/src/components/SidebarChatComp.vue +++ b/src/components/SidebarChatComp.vue @@ -12,7 +12,8 @@
u.username !== this.$store.state.username) + .filter(u => u.username !== this.$store.state.user.username) .map(u => { return { letter: u.username[0].toUpperCase(), - color: u.color }; }) .slice(0, 4); @@ -73,7 +73,7 @@ export default { }, methods: { goToConversation () { - this.$router.push("/chat/" + this.conversation.id); + this.$router.push("/chat/conversation/" + this.conversation.id); } } }; diff --git a/src/locales/en.json b/src/locales/en.json index ebeb0c4..d12210e 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -165,7 +165,8 @@ "down": "There has appeared to be an issue communicating with Kaverti, please try again later.", "canaryBuild": "You are using the Canary client, if you are expecting a stable experience, please use the regular one on Kaverti.com.", "logout": "You have been logged out of Kaverti.", - "register": "You have been registered to Kaverti, Welcome!" + "register": "You have been registered to Kaverti, Welcome!", + "emailVerify": "Please verify your email to get full access to Kaverti!" }, "generic": { "name": "Kaverti", @@ -299,5 +300,6 @@ "close": "Close", "tos": "Terms of Service", "gotIt": "Got it!", + "OK": "OK", "errorModalTitle": "Something went wrong..." } \ No newline at end of file diff --git a/src/main.js b/src/main.js index 019f8c2..0b6101d 100644 --- a/src/main.js +++ b/src/main.js @@ -15,6 +15,9 @@ import json from 'highlight.js/lib/languages/json'; const hljsTheme = createHljsTheme(); import io from 'socket.io-client' import VueSocketIO from "vue-socket.io"; +import NProgress from "vue-nprogress"; +Vue.use(NProgress) +const nprogress = new NProgress() Vue.use( new VueSocketIO({ debug: true, @@ -57,6 +60,7 @@ Vue.filter('formatDate', function(value) { } }) new Vue({ + nprogress, router, store, i18n, diff --git a/src/router/index.js b/src/router/index.js index 11d3717..285c06a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,7 +1,9 @@ import Vue from 'vue' import VueRouter from 'vue-router' - +import NProgress from 'nprogress' +import 'nprogress/nprogress.css'; Vue.use(VueRouter) +NProgress.configure({ showSpinner: false }); function route(view){ return() => import(`@/views/${view}.vue`) @@ -42,6 +44,23 @@ const routes = [ name: 'Teams', component: route('Teams') }, + { + path: '/character', + redirect: '/avatar', + name: 'Character', + component: route('Avatar') + }, + { + path: '/avatar', + redirect: '/avatar/hats', + name: 'Avatar', + component: route('Avatar') + }, + { + path: '/avatar/:category', + name: 'Avatar', + component: route('Avatar') + }, { path: '/t/:username', component: route('Team'), children: [ { path: 'posts', component: route('UserPosts') }, { path: 'threads', component: route('UserThreads') }, @@ -147,4 +166,16 @@ const router = new VueRouter({ routes }) +router.beforeResolve((to, from, next) => { + // If this isn't an initial page load. + if (to.name) { + // Start the route progress bar. + NProgress.start() + } + next() +}) + +router.afterEach(() => { + NProgress.done() +}) export default router diff --git a/src/store/index.js b/src/store/index.js index 2eb0e09..4ff9c7a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -8,7 +8,7 @@ export default new Vuex.Store({ wind: false, enableBrokenRoutes: false, client: { - clientVersion: '1.0.0-prerelease3', + clientVersion: '1.0.0-prerelease4', latestClientVersion: '', latestAPIVersion: '', bannerText: '', @@ -47,7 +47,8 @@ export default new Vuex.Store({ developerMode: false, executive: false, description: '', - conversations: [] + conversations: [], + currentConversation: 0 } }, mutations: { @@ -169,6 +170,9 @@ export default new Vuex.Store({ conversation.name = name; state.user.conversations.splice(index, 1, conversation); + }, + setCurrentConversation (state, id) { + state.user.currentConversation = id } }, actions: { diff --git a/src/views/Avatar.vue b/src/views/Avatar.vue new file mode 100644 index 0000000..0cbe50d --- /dev/null +++ b/src/views/Avatar.vue @@ -0,0 +1,145 @@ + + + + + \ No newline at end of file diff --git a/src/views/Chat.vue b/src/views/Chat.vue index d75612e..3c5d95a 100644 --- a/src/views/Chat.vue +++ b/src/views/Chat.vue @@ -1,5 +1,5 @@ @@ -334,19 +335,19 @@ export default { mounted () { this.pageLoad(); - this.$io.on('message', message => { + this.$socket.on('message', message => { if(message.ConversationId !== +this.$route.params.id) return; this.messages.push(message); this.scrollToBottom(); this.updateLastRead(); }); - this.$io.on('startTyping', ({ userId }) => { + this.$socket.on('startTyping', ({ userId }) => { let user = this.users.find(u => u.id === userId); this.typingUsers.push(user); this.scrollToBottom(); }); - this.$io.on('stopTyping', ({ userId }) => { + this.$socket.on('stopTyping', ({ userId }) => { let index = this.typingUsers.findIndex(u => u.id === userId); this.typingUsers.splice(index, 1); }); diff --git a/src/views/ForumThread.vue b/src/views/ForumThread.vue index 66ed4fe..24174e5 100644 --- a/src/views/ForumThread.vue +++ b/src/views/ForumThread.vue @@ -221,7 +221,7 @@ export default { ], content: '

What do you have to say

' }), - postModal: true + postModal: false } }, methods: { diff --git a/src/views/Teams.vue b/src/views/Teams.vue index a333130..4bf7bb9 100644 --- a/src/views/Teams.vue +++ b/src/views/Teams.vue @@ -1,5 +1,162 @@ \ No newline at end of file + + \ No newline at end of file diff --git a/src/views/User.vue b/src/views/User.vue index c287cf0..24e975f 100644 --- a/src/views/User.vue +++ b/src/views/User.vue @@ -6,11 +6,11 @@