mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-29 18:22:53 +00:00
This PR has the initial version of the new sidebar targeted for the next major redesign of the app. This PR includes the following changes - Components in the `layouts-next` and `base-next` directories in `dashboard/components` - Two generic components `Avatar` and `Icon` - `SidebarGroup` component to manage expandable sidebar groups with nested navigation items. This includes handling active states, transitions, and permissions. - `SidebarGroupHeader` component to display the header of each navigation group with optional icons and active state indication. - `SidebarGroupLeaf` component for individual navigation items within a group, supporting icons and active state. - `SidebarGroupSeparator` component to visually separate nested navigation items. (They look a lot like header) - `SidebarGroupEmptyLeaf` component to render empty state of any navigation groups. ---- Co-authored-by: Pranav <pranav@chatwoot.com> Co-authored-by: Pranav <pranavrajs@gmail.com>
47 lines
1.1 KiB
JavaScript
47 lines
1.1 KiB
JavaScript
import { getters } from '../../customViews';
|
|
import { contactViewList, customViewList } from './fixtures';
|
|
|
|
describe('#getters', () => {
|
|
it('getCustomViewsByFilterType', () => {
|
|
const state = { contact: { records: contactViewList } };
|
|
expect(getters.getCustomViewsByFilterType(state)(1)).toEqual([
|
|
{
|
|
name: 'Custom view 1',
|
|
filter_type: 1,
|
|
query: {
|
|
payload: [
|
|
{
|
|
attribute_key: 'name',
|
|
filter_operator: 'equal_to',
|
|
values: ['john doe'],
|
|
query_operator: null,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
]);
|
|
});
|
|
|
|
it('getUIFlags', () => {
|
|
const state = {
|
|
uiFlags: {
|
|
isFetching: true,
|
|
isCreating: false,
|
|
isDeleting: false,
|
|
},
|
|
};
|
|
expect(getters.getUIFlags(state)).toEqual({
|
|
isFetching: true,
|
|
isCreating: false,
|
|
isDeleting: false,
|
|
});
|
|
});
|
|
|
|
it('getActiveConversationFolder', () => {
|
|
const state = { activeConversationFolder: customViewList[0] };
|
|
expect(getters.getActiveConversationFolder(state)).toEqual(
|
|
customViewList[0]
|
|
);
|
|
});
|
|
});
|