Add low priority filter pill to the room list UI (#30060)
* Add low priority filter pill to the UI * Fix tests
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 78 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 74 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
@@ -50,6 +50,7 @@ const filterKeyToNameMap: Map<FilterKey, TranslationKey> = new Map([
|
|||||||
[FilterKey.MentionsFilter, _td("room_list|filters|mentions")],
|
[FilterKey.MentionsFilter, _td("room_list|filters|mentions")],
|
||||||
[FilterKey.InvitesFilter, _td("room_list|filters|invites")],
|
[FilterKey.InvitesFilter, _td("room_list|filters|invites")],
|
||||||
[FilterKey.FavouriteFilter, _td("room_list|filters|favourite")],
|
[FilterKey.FavouriteFilter, _td("room_list|filters|favourite")],
|
||||||
|
[FilterKey.LowPriorityFilter, _td("room_list|filters|low_priority")],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2119,6 +2119,7 @@
|
|||||||
"filters": {
|
"filters": {
|
||||||
"favourite": "Favourites",
|
"favourite": "Favourites",
|
||||||
"invites": "Invites",
|
"invites": "Invites",
|
||||||
|
"low_priority": "Low priority",
|
||||||
"mentions": "Mentions",
|
"mentions": "Mentions",
|
||||||
"people": "People",
|
"people": "People",
|
||||||
"rooms": "Rooms",
|
"rooms": "Rooms",
|
||||||
|
|||||||
@@ -66,9 +66,17 @@ describe("RoomListViewModel", () => {
|
|||||||
mockAndCreateRooms();
|
mockAndCreateRooms();
|
||||||
const { result: vm } = renderHook(() => useRoomListViewModel());
|
const { result: vm } = renderHook(() => useRoomListViewModel());
|
||||||
// should have 6 filters
|
// should have 6 filters
|
||||||
expect(vm.current.primaryFilters).toHaveLength(6);
|
expect(vm.current.primaryFilters).toHaveLength(7);
|
||||||
// check the order
|
// check the order
|
||||||
for (const [i, name] of ["Unreads", "People", "Rooms", "Mentions", "Invites", "Favourites"].entries()) {
|
for (const [i, name] of [
|
||||||
|
"Unreads",
|
||||||
|
"People",
|
||||||
|
"Rooms",
|
||||||
|
"Mentions",
|
||||||
|
"Invites",
|
||||||
|
"Favourites",
|
||||||
|
"Low priority",
|
||||||
|
].entries()) {
|
||||||
expect(vm.current.primaryFilters[i].name).toEqual(name);
|
expect(vm.current.primaryFilters[i].name).toEqual(name);
|
||||||
expect(vm.current.primaryFilters[i].active).toEqual(false);
|
expect(vm.current.primaryFilters[i].active).toEqual(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -175,6 +175,19 @@ exports[`<RoomListPanel /> should not render the RoomListSearch component when U
|
|||||||
Favourites
|
Favourites
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
<li
|
||||||
|
aria-selected="false"
|
||||||
|
role="option"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
aria-selected="false"
|
||||||
|
class="_chat-filter_5qdp0_8"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
Low priority
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div
|
<div
|
||||||
class="mx_RoomListSkeleton"
|
class="mx_RoomListSkeleton"
|
||||||
@@ -424,6 +437,19 @@ exports[`<RoomListPanel /> should render the RoomListSearch component when UICom
|
|||||||
Favourites
|
Favourites
|
||||||
</button>
|
</button>
|
||||||
</li>
|
</li>
|
||||||
|
<li
|
||||||
|
aria-selected="false"
|
||||||
|
role="option"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
aria-selected="false"
|
||||||
|
class="_chat-filter_5qdp0_8"
|
||||||
|
role="button"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
Low priority
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div
|
<div
|
||||||
class="mx_RoomListSkeleton"
|
class="mx_RoomListSkeleton"
|
||||||
|
|||||||