From aae49666e8bd0784c88480e7cfe2770cb35a569d Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Fri, 2 Jun 2023 15:30:52 +0200 Subject: [PATCH 01/11] Added the filter features Signed-off-by: DorraJaouad --- .../LeftSidebar/LeftSidebar.spec.js | 7 +- src/components/LeftSidebar/LeftSidebar.vue | 72 +++++++++++++++++-- 2 files changed, 70 insertions(+), 9 deletions(-) diff --git a/src/components/LeftSidebar/LeftSidebar.spec.js b/src/components/LeftSidebar/LeftSidebar.spec.js index 1114c87b724..d86b90838c5 100644 --- a/src/components/LeftSidebar/LeftSidebar.spec.js +++ b/src/components/LeftSidebar/LeftSidebar.spec.js @@ -13,7 +13,7 @@ import router from '../../__mocks__/router.js' import { searchPossibleConversations, searchListedConversations } from '../../services/conversationsService.js' import { EventBus } from '../../services/EventBus.js' import storeConfig from '../../store/storeConfig.js' -import { findNcListItems } from '../../test-helpers.js' +import { findNcListItems, findNcActionButton } from '../../test-helpers.js' jest.mock('@nextcloud/initial-state', () => ({ loadState: jest.fn(), @@ -48,6 +48,7 @@ describe('LeftSidebar.vue', () => { NcAvatar: true, // to prevent complex dialog logic NewGroupConversation: true, + NcActions: true, }, }) } @@ -701,14 +702,14 @@ describe('LeftSidebar.vue', () => { loadStateSettings.start_conversations = true const wrapper = mountComponent() - const buttonEl = wrapper.findComponent({ name: 'NewGroupConversation' }) + const buttonEl = findNcActionButton(wrapper, 'Create a new conversation') expect(buttonEl.exists()).toBeTruthy() }) test('does not show new conversation button if user cannot start conversations', () => { loadStateSettings.start_conversations = false const wrapper = mountComponent() - const buttonEl = wrapper.findComponent({ name: 'NewGroupConversation' }) + const buttonEl = findNcActionButton(wrapper, 'Create a new conversation') expect(buttonEl.exists()).toBeFalsy() }) }) diff --git a/src/components/LeftSidebar/LeftSidebar.vue b/src/components/LeftSidebar/LeftSidebar.vue index 592d4ce8863..7a6d7ec1704 100644 --- a/src/components/LeftSidebar/LeftSidebar.vue +++ b/src/components/LeftSidebar/LeftSidebar.vue @@ -30,8 +30,39 @@ @submit="onInputEnter" @keydown.enter.native="handleEnter" @abort-search="abortSearch" /> - + + + + + + {{ t('spreed','Filter unread messages') }} + + + + {{ t('spreed','Filter unread mentions') }} + + + + {{ t('spreed','Create a new conversation') }} + + + + + +