diff options
author | marco <marcoambrosini@pm.me> | 2022-02-04 17:48:46 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2022-03-21 14:08:25 +0300 |
commit | 1f6bf9c3848d4ef84dde083a9b91440ee396b293 (patch) | |
tree | 0858ca26ef6477972ff179ae4bdb852e465c8bec /src | |
parent | 83900e1cf065eb068d6c4bccaeadae72b185e506 (diff) |
Fix forwarder
Signed-off-by: marco <marcoambrosini@pm.me>
Diffstat (limited to 'src')
3 files changed, 26 insertions, 7 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.spec.js b/src/components/MessagesList/MessagesGroup/Message/Message.spec.js index 0314fc86f..6e486fec4 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.spec.js +++ b/src/components/MessagesList/MessagesGroup/Message/Message.spec.js @@ -74,6 +74,13 @@ describe('Message.vue', () => { systemMessage: '', messageType: 'comment', } + + // Dummy message getter so that the message component is always + // properly mounted. + testStoreConfig.modules.messagesStore.getters.message + = jest.fn().mockReturnValue(() => { + return {} + }) }) afterEach(() => { diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index 4e7397ba5..87cc928e3 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -115,6 +115,8 @@ the main body of the message as well as a quote. </div> <MessageButtonsBar v-if="hasMessageButtonsBar" v-show="showMessageButtonsBar" + ref="messageButtonsBar" + :message-object="messageObject" v-bind="$props" :previous-message-id="previousMessageId" :participant="participant" /> @@ -124,9 +126,6 @@ the main body of the message as well as a quote. <span>{{ t('spreed', 'Unread messages') }}</span> </div> </div> - <Forwarder v-if="showForwarder" - :message-object="messageObject" - @close="showForwarder = false" /> </li> </template> @@ -151,7 +150,6 @@ import { CONVERSATION } from '../../../../constants' import moment from '@nextcloud/moment' import Location from './MessagePart/Location' import Contact from './MessagePart/Contact.vue' -import Forwarder from './MessagePart/Forwarder' import MessageButtonsBar from './MessageButtonsBar/MessageButtonsBar.vue' export default { @@ -169,7 +167,6 @@ export default { Check, CheckAll, Reload, - Forwarder, MessageButtonsBar, }, @@ -317,8 +314,6 @@ export default { isDeleting: false, // whether the message was seen, only used if this was marked as last read message seen: false, - // Shows/hides the message forwarder component - showForwarder: false, isActionMenuOpen: false, } }, diff --git a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue index bd7da0df5..a515de508 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue @@ -83,6 +83,9 @@ </ActionButton> </template> </Actions> + <Forwarder v-if="showForwarder" + :message-object="messageObject" + @close="showForwarder = false" /> </div> </template> @@ -103,6 +106,7 @@ import { showWarning, TOAST_DEFAULT_TIMEOUT, } from '@nextcloud/dialogs' +import Forwarder from '../MessagePart/Forwarder' export default { name: 'MessageButtonsBar', @@ -114,6 +118,7 @@ export default { EyeOffOutline, Share, ActionSeparator, + Forwarder, }, props: { @@ -132,6 +137,11 @@ export default { required: true, }, + messageObject: { + type: Object, + required: true, + }, + actorId: { type: String, required: true, @@ -207,6 +217,13 @@ export default { }, }, + data() { + return { + // Shows/hides the message forwarder component + showForwarder: false, + } + }, + computed: { conversation() { return this.$store.getters.conversation(this.token) |