From d73fd0cbb75d7080f3c55612e727e62e78b6ef8e Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 13 Jul 2023 22:35:48 +0200 Subject: [PATCH 1/3] [bug] chat language is now reactive --- webapp/components/Chat/Chat.vue | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index 8aeb4e7de..855f1e14b 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -114,20 +114,6 @@ export default { text: 'This is the action', }, ], - textMessages: { - ROOMS_EMPTY: this.$t('chat.roomsEmpty'), - ROOM_EMPTY: this.$t('chat.roomEmpty'), - NEW_MESSAGES: this.$t('chat.newMessages'), - MESSAGE_DELETED: this.$t('chat.messageDeleted'), - MESSAGES_EMPTY: this.$t('chat.messagesEmpty'), - CONVERSATION_STARTED: this.$t('chat.conversationStarted'), - TYPE_MESSAGE: this.$t('chat.typeMessage'), - SEARCH: this.$t('chat.search'), - IS_ONLINE: this.$t('chat.isOnline'), - LAST_SEEN: this.$t('chat.lastSeen'), - IS_TYPING: this.$t('chat.isTyping'), - CANCEL_SELECT_MESSAGE: this.$t('chat.cancelSelectMessage'), - }, roomActions: [ /* { @@ -177,6 +163,22 @@ export default { // return this.theme === 'light' ? chatStyle.STYLE.light : chatStyle.STYLE.dark return chatStyle.STYLE.light }, + textMessages() { + return{ + ROOMS_EMPTY: this.$t('chat.roomsEmpty'), + ROOM_EMPTY: this.$t('chat.roomEmpty'), + NEW_MESSAGES: this.$t('chat.newMessages'), + MESSAGE_DELETED: this.$t('chat.messageDeleted'), + MESSAGES_EMPTY: this.$t('chat.messagesEmpty'), + CONVERSATION_STARTED: this.$t('chat.conversationStarted'), + TYPE_MESSAGE: this.$t('chat.typeMessage'), + SEARCH: this.$t('chat.search'), + IS_ONLINE: this.$t('chat.isOnline'), + LAST_SEEN: this.$t('chat.lastSeen'), + IS_TYPING: this.$t('chat.isTyping'), + CANCEL_SELECT_MESSAGE: this.$t('chat.cancelSelectMessage'), + } + } }, methods: { fetchMessages({ room, options = {} }) { From d496aef0a42abb9fdd17a7c8ac95c2653c0172b8 Mon Sep 17 00:00:00 2001 From: Markus Date: Thu, 13 Jul 2023 22:56:38 +0200 Subject: [PATCH 2/3] fixed linting --- webapp/components/Chat/Chat.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index 855f1e14b..eb7d7124a 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -164,7 +164,7 @@ export default { return chatStyle.STYLE.light }, textMessages() { - return{ + return { ROOMS_EMPTY: this.$t('chat.roomsEmpty'), ROOM_EMPTY: this.$t('chat.roomEmpty'), NEW_MESSAGES: this.$t('chat.newMessages'), @@ -178,7 +178,7 @@ export default { IS_TYPING: this.$t('chat.isTyping'), CANCEL_SELECT_MESSAGE: this.$t('chat.cancelSelectMessage'), } - } + }, }, methods: { fetchMessages({ room, options = {} }) { From 54cf5b37a5f353de187a95b7b608791c5ffdfd30 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 14 Jul 2023 11:09:04 +0200 Subject: [PATCH 3/3] order by indexId instead of createdAt --- backend/src/graphql/messages.ts | 2 +- backend/src/schema/types/type/Message.gql | 3 +-- webapp/graphql/Messages.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/backend/src/graphql/messages.ts b/backend/src/graphql/messages.ts index ca5ffb952..26eb32750 100644 --- a/backend/src/graphql/messages.ts +++ b/backend/src/graphql/messages.ts @@ -17,7 +17,7 @@ export const createMessageMutation = () => { export const messageQuery = () => { return gql` query ($roomId: ID!, $first: Int, $offset: Int) { - Message(roomId: $roomId, first: $first, offset: $offset, orderBy: createdAt_desc) { + Message(roomId: $roomId, first: $first, offset: $offset, orderBy: indexId_desc) { _id id indexId diff --git a/backend/src/schema/types/type/Message.gql b/backend/src/schema/types/type/Message.gql index 671c5523a..764181dd9 100644 --- a/backend/src/schema/types/type/Message.gql +++ b/backend/src/schema/types/type/Message.gql @@ -3,8 +3,7 @@ # } enum _MessageOrdering { - createdAt_asc - createdAt_desc + indexId_desc } type Message { diff --git a/webapp/graphql/Messages.js b/webapp/graphql/Messages.js index d017f816c..bede62d01 100644 --- a/webapp/graphql/Messages.js +++ b/webapp/graphql/Messages.js @@ -3,7 +3,7 @@ import gql from 'graphql-tag' export const messageQuery = () => { return gql` query ($roomId: ID!, $first: Int, $offset: Int) { - Message(roomId: $roomId, first: $first, offset: $offset, orderBy: createdAt_desc) { + Message(roomId: $roomId, first: $first, offset: $offset, orderBy: indexId_desc) { _id id indexId