* Mark category as read

* Fix lint and test

* Fix tests

* Fix test and remove wrong aria

* Address server issues and add mark as read for unreads

* Missing changes

* Fix tests

* fix tests

* Add confirmation popup to mark as read category

* Always use viewMultipleChannels and other fixes

* Remove unneeded code

* Fix test

* Address feedback

* Address feedback

* Fix tests

* Fix test

* Fix tests

* Update aria-haspopup depending on the number of channels to mark as viewed

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
Daniel Espino García
2023-08-14 10:01:02 +02:00
коммит произвёл GitHub
родитель c1c07ba1bb
Коммит e9b3afecc2
60 изменённых файлов: 1151 добавлений и 1557 удалений

Просмотреть файл

@@ -208,6 +208,33 @@ export function makeGetFilteredChannelIdsForCategory(): (state: GlobalState, cat
);
}
// Returns a selector that, given a category, returns the ids of channels visible in that category. The returned channels do not
// include unread channels when the Unreads category is enabled.
export function makeGetUnreadIdsForCategory(): (state: GlobalState, category: ChannelCategory) => string[] {
const getChannelIdsForCategory = makeGetChannelIdsForCategory();
const emptyList: string[] = [];
return createSelector(
'makeGetFilteredChannelIdsForCategory',
getChannelIdsForCategory,
getUnreadChannelIdsSet,
shouldShowUnreadsCategory,
(channelIds, unreadChannelIdsSet, showUnreadsCategory) => {
if (showUnreadsCategory) {
return emptyList;
}
const filtered = channelIds.filter((id) => unreadChannelIdsSet.has(id));
if (filtered.length === 0) {
return emptyList;
}
return filtered.length === channelIds.length ? channelIds : filtered;
},
);
}
export function getDraggingState(state: GlobalState): DraggingState {
return state.views.channelSidebar.draggingState;
}