diff options
author | DorraJaouad <dorra.jaoued7@gmail.com> | 2023-07-20 15:28:16 +0200 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2023-08-03 08:28:11 +0200 |
commit | a89b55124fed73b748111e5064e3fbe9fa7776ea (patch) | |
tree | 61804164c8a233ea20acc847a18be2c9168a359d | |
parent | de304d1e3971e248bb6ed7705f9bfa320bdc4055 (diff) |
Move RoomSelector.vue to src/components
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
-rw-r--r-- | src/collections.js | 2 | ||||
-rw-r--r-- | src/components/LeftSidebar/LeftSidebar.vue | 16 | ||||
-rw-r--r-- | src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue | 11 | ||||
-rw-r--r-- | src/components/LeftSidebar/OpenConversationsList/OpenConversationsList.vue | 15 | ||||
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue | 2 | ||||
-rw-r--r-- | src/components/RoomSelector.spec.js (renamed from src/views/RoomSelector.spec.js) | 3 | ||||
-rw-r--r-- | src/components/RoomSelector.vue (renamed from src/views/RoomSelector.vue) | 6 | ||||
-rw-r--r-- | src/deck.js | 2 | ||||
-rw-r--r-- | src/maps.js | 2 |
9 files changed, 22 insertions, 37 deletions
diff --git a/src/collections.js b/src/collections.js index 40f458d29..037381e5d 100644 --- a/src/collections.js +++ b/src/collections.js @@ -41,7 +41,7 @@ import Vue from 'vue' container.id = 'spreed-room-select' const body = document.getElementById('body-user') body.appendChild(container) - const RoomSelector = () => import('./views/RoomSelector.vue') + const RoomSelector = () => import('./components/RoomSelector.vue') const ComponentVM = new Vue({ render: h => h(RoomSelector, { props: { diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue index 3f10a2660..c66964f75 100644 --- a/src/components/LeftSidebar/LeftSidebar.vue +++ b/src/components/LeftSidebar/LeftSidebar.vue @@ -81,14 +81,6 @@ <template #icon> <DotsVertical :size="20" /> </template> - <NcActionButton close-after-click - @click="showModalListConversations"> - <template #icon> - <List :size="20" /> - </template> - {{ t('spreed','Join open conversations') }} - </NcActionButton> - <NcActionButton v-if="canStartConversations" close-after-click @click="showModalNewConversation"> @@ -97,6 +89,14 @@ </template> {{ t('spreed','Create a new conversation') }} </NcActionButton> + + <NcActionButton close-after-click + @click="showModalListConversations"> + <template #icon> + <List :size="20" /> + </template> + {{ t('spreed','Join open conversations') }} + </NcActionButton> </NcActions> </div> diff --git a/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue b/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue index c6e93eb4d..2f4e8a446 100644 --- a/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue +++ b/src/components/LeftSidebar/NewGroupConversation/NewGroupConversation.vue @@ -293,7 +293,7 @@ export default { }) }, }, - expose: ['showModalForItem','showModal'], + expose: ['showModalForItem', 'showModal'], methods: { showModal() { @@ -482,15 +482,6 @@ export default { margin: 50px auto 0 auto; } } -.toggle { - height: 44px; - width: 44px; - padding: 0; - display: flex; - align-items: center; - justify-content: center; - margin: 0 var(--default-grid-baseline); -} .new-group-conversation { &__header { diff --git a/src/components/LeftSidebar/OpenConversationsList/OpenConversationsList.vue b/src/components/LeftSidebar/OpenConversationsList/OpenConversationsList.vue index e9b68a9bb..e47e0a78c 100644 --- a/src/components/LeftSidebar/OpenConversationsList/OpenConversationsList.vue +++ b/src/components/LeftSidebar/OpenConversationsList/OpenConversationsList.vue @@ -29,7 +29,7 @@ <script> -import RoomSelector from '../../../views/RoomSelector.vue' +import RoomSelector from '../../RoomSelector.vue' export default { @@ -51,11 +51,13 @@ export default { }, dialogTitle() { - return t('spreed', 'Open conversations') + return t('spreed', 'Join open conversations') }, }, + expose: ['showModal'], + methods: { showModal() { this.modal = true @@ -66,13 +68,8 @@ export default { }, openConversation(token) { - this.$router.push({ - name: 'conversation', - params: { - token: `${token}`, - }, - }).catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`)) - + this.$router.push({ name: 'conversation', params: { token } }) + .catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`)) this.closeModal() }, }, diff --git a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue index cdf3b5d2b..e9f1e807f 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue @@ -78,7 +78,7 @@ import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js' import NcModal from '@nextcloud/vue/dist/Components/NcModal.js' -import RoomSelector from '../../../../../views/RoomSelector.vue' +import RoomSelector from '../../../../RoomSelector.vue' export default { name: 'Forwarder', diff --git a/src/views/RoomSelector.spec.js b/src/components/RoomSelector.spec.js index 3524fc9a0..a97e47484 100644 --- a/src/views/RoomSelector.spec.js +++ b/src/components/RoomSelector.spec.js @@ -92,7 +92,6 @@ describe('RoomSelector.vue', () => { // need to wait for re-render, otherwise the list is not rendered yet await flushPromises() - await wrapper.vm.$nextTick() const list = wrapper.findAll('li') expect(list.length).toBe(3) @@ -113,7 +112,6 @@ describe('RoomSelector.vue', () => { // need to wait for re-render, otherwise the list is not rendered yet await flushPromises() - await wrapper.vm.$nextTick() const list = wrapper.findAll('li') expect(list.length).toBe(2) @@ -128,7 +126,6 @@ describe('RoomSelector.vue', () => { { params: { includeStatus: true } } ) await flushPromises() - await wrapper.vm.$nextTick() const eventHandler = jest.fn() wrapper.vm.$root.$on('select', eventHandler) diff --git a/src/views/RoomSelector.vue b/src/components/RoomSelector.vue index b1ab2cbbb..a2b5630e0 100644 --- a/src/views/RoomSelector.vue +++ b/src/components/RoomSelector.vue @@ -82,7 +82,7 @@ import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcModal from '@nextcloud/vue/dist/Components/NcModal.js' import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js' -import ConversationIcon from '../components/ConversationIcon.vue' +import ConversationIcon from './ConversationIcon.vue' import { CONVERSATION } from '../constants.js' import { searchListedConversations, fetchConversations } from '../services/conversationsService.js' @@ -164,8 +164,8 @@ export default { : t('spreed', 'Check spelling or use complete words.') }, }, - async beforeMount() { - await this.fetchRooms() + beforeMount() { + this.fetchRooms() const $store = OCA.Talk?.instance?.$store if ($store) { this.currentRoom = $store.getters.getToken() diff --git a/src/deck.js b/src/deck.js index 7a4203c61..720eac7b7 100644 --- a/src/deck.js +++ b/src/deck.js @@ -27,7 +27,7 @@ import { showSuccess, showError } from '@nextcloud/dialogs' import { translate, translatePlural } from '@nextcloud/l10n' import { generateFilePath, generateUrl } from '@nextcloud/router' -import RoomSelector from './views/RoomSelector.vue' +import RoomSelector from './components/RoomSelector.vue' import { postRichObjectToConversation } from './services/messagesService.js' diff --git a/src/maps.js b/src/maps.js index be5ec22f9..3ced7ccee 100644 --- a/src/maps.js +++ b/src/maps.js @@ -27,7 +27,7 @@ import { showSuccess, showError } from '@nextcloud/dialogs' import { translate, translatePlural } from '@nextcloud/l10n' import { generateFilePath, generateUrl } from '@nextcloud/router' -import RoomSelector from './views/RoomSelector.vue' +import RoomSelector from './components/RoomSelector.vue' import { postRichObjectToConversation } from './services/messagesService.js' |