* Enable import order

* Add new order groups and add consistent-type-imports

* Remove types group, move react to top and fix issues

* Add store and reducers to the redux group and move imports from types folder to the end

* Fix tsc

* Remove react rule

* Fix test

* Fix eslint disable
Этот коммит содержится в:
Daniel Espino García
2023-09-06 12:51:55 +02:00
коммит произвёл GitHub
родитель b2f36c7cdf
Коммит d13429aa92
2342 изменённых файлов: 12353 добавлений и 11153 удалений

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

@@ -1,11 +1,13 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GlobalState} from 'types/store';
import {get} from 'mattermost-redux/selectors/entities/preferences';
import {Preferences} from 'mattermost-redux/constants';
import {get} from 'mattermost-redux/selectors/entities/preferences';
import {getIsMobileView} from 'selectors/views/browser';
import type {GlobalState} from 'types/store';
export function showActionsDropdownPulsatingDot(state: GlobalState): boolean {
if (getIsMobileView(state)) {
return false;

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

@@ -3,9 +3,9 @@
import {cloneDeep} from 'lodash';
import {ResourceToSysConsolePermissionsTable, RESOURCE_KEYS} from 'mattermost-redux/constants/permissions_sysconsole';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {getMySystemPermissions} from 'mattermost-redux/selectors/entities/roles_helpers';
import {ResourceToSysConsolePermissionsTable, RESOURCE_KEYS} from 'mattermost-redux/constants/permissions_sysconsole';
import AdminDefinition from 'components/admin_console/admin_definition.jsx';

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

@@ -1,10 +1,10 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import AdminDefinition from 'components/admin_console/admin_definition.jsx';
import {getAdminDefinition} from 'selectors/admin_console.jsx';
import AdminDefinition from 'components/admin_console/admin_definition.jsx';
describe('Selectors.AdminConsole', () => {
describe('get admin definitions', () => {
it('should return the default admin definition if there is not plugins', () => {

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

@@ -1,10 +1,12 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GlobalState} from 'types/store';
import {suitePluginIds} from 'utils/constants';
import semver from 'semver';
import {suitePluginIds} from 'utils/constants';
import type {GlobalState} from 'types/store';
export function isCallsEnabled(state: GlobalState, minVersion = '0.4.2') {
return Boolean(state.plugins.plugins[suitePluginIds.calls] &&
semver.gte(state.plugins.plugins[suitePluginIds.calls].version || '0.0.0', minVersion));

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

@@ -1,12 +1,12 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Invoice, Subscription} from '@mattermost/types/cloud';
import type {Invoice, Subscription} from '@mattermost/types/cloud';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
export const getExpandSeatsLink: (state: GlobalState) => (licenseId: string) => string = createSelector(
'getExpandSeatsLink',

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

@@ -2,9 +2,10 @@
// See LICENSE.txt for license information.
import mergeObjects from 'packages/mattermost-redux/test/merge_objects';
import {GlobalState} from 'types/store';
import {StoragePrefixes} from 'utils/constants';
import type {GlobalState} from 'types/store';
import {makeGetDrafts, makeGetDraftsByPrefix, makeGetDraftsCount} from './drafts';
const currentUserId = 'currentUserId';

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

@@ -1,19 +1,18 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Preferences} from 'mattermost-redux/constants';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {getMyActiveChannelIds} from 'mattermost-redux/selectors/entities/channels';
import {get, onboardingTourTipsEnabled} from 'mattermost-redux/selectors/entities/preferences';
import {Preferences} from 'mattermost-redux/constants';
import {GlobalState} from 'types/store';
import {DraftInfo, PostDraft} from 'types/store/draft';
import {getIsMobileView} from 'selectors/views/browser';
import {StoragePrefixes} from 'utils/constants';
import {getDraftInfoFromKey} from 'utils/storage_utils';
import {getIsMobileView} from 'selectors/views/browser';
import type {GlobalState} from 'types/store';
import type {DraftInfo, PostDraft} from 'types/store/draft';
export type Draft = DraftInfo & {
key: keyof GlobalState['storage']['storage'];

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

@@ -1,20 +1,21 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type {RecentEmojiData} from '@mattermost/types/emojis';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {getCustomEmojisByName} from 'mattermost-redux/selectors/entities/emojis';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {get} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import {Preferences} from 'utils/constants';
import EmojiMap from 'utils/emoji_map';
import {EmojiIndicesByAlias, Emojis} from 'utils/emoji';
import {GlobalState} from 'types/store';
import {RecentEmojiData} from '@mattermost/types/emojis';
import EmojiMap from 'utils/emoji_map';
import {convertEmojiSkinTone} from 'utils/emoji_utils';
import type {GlobalState} from 'types/store';
export const getEmojiMap = createSelector(
'getEmojiMap',
getCustomEmojisByName,

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

@@ -1,14 +1,14 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {General} from 'mattermost-redux/constants';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getCurrentUserLocale} from 'mattermost-redux/selectors/entities/i18n';
import {General} from 'mattermost-redux/constants';
import * as I18n from 'i18n/i18n';
import {GlobalState} from 'types/store';
import {Translations} from 'types/store/i18n';
import type {GlobalState} from 'types/store';
import type {Translations} from 'types/store/i18n';
// This is a placeholder for if we ever implement browser-locale detection
export function getCurrentLocale(state: GlobalState): string {

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

@@ -2,7 +2,8 @@
// See LICENSE.txt for license information.
import * as PreferencesSelectors from 'mattermost-redux/selectors/entities/preferences';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
import * as Lhs from './lhs';

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

@@ -1,15 +1,17 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GlobalState} from 'types/store';
import {StaticPage} from 'types/store/lhs';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {makeGetDraftsCount} from 'selectors/drafts';
import {
isCollapsedThreadsEnabled,
} from 'mattermost-redux/selectors/entities/preferences';
import {SidebarSize} from 'components/resizable_sidebar/constants';
import {makeGetDraftsCount} from 'selectors/drafts';
import type {SidebarSize} from 'components/resizable_sidebar/constants';
import type {GlobalState} from 'types/store';
import type {StaticPage} from 'types/store/lhs';
export function getIsLhsOpen(state: GlobalState): boolean {
return state.views.lhs.isOpen;

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

@@ -1,13 +1,13 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type {GlobalState} from '@mattermost/types/store';
import {getCurrentTeamId, getTeamByName} from 'mattermost-redux/selectors/entities/teams';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import localStorageStore from 'stores/local_storage_store';
import type {GlobalState} from '@mattermost/types/store';
// getLastViewedChannelName combines data from the Redux store and localStorage to return the
// previously selected channel name, returning the default channel if none exists.
//

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

@@ -3,15 +3,14 @@
import {getPreferenceKey} from 'mattermost-redux/utils/preference_utils';
import TestHelper from 'packages/mattermost-redux/test/test_helper';
import {getShowTaskListBool} from 'selectors/onboarding';
import {OnboardingTaskCategory, OnboardingTaskList} from 'components/onboarding_tasks';
import TestHelper from 'packages/mattermost-redux/test/test_helper';
import {RecommendedNextStepsLegacy, Preferences} from 'utils/constants';
import {getShowTaskListBool} from 'selectors/onboarding';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
describe('selectors/onboarding', () => {
describe('getShowTaskListBool', () => {

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

@@ -5,14 +5,14 @@ import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {makeGetCategory, getBool} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentUser, isFirstAdmin} from 'mattermost-redux/selectors/entities/users';
import {OnboardingTaskCategory, OnboardingTaskList} from 'components/onboarding_tasks';
import {getIsMobileView} from 'selectors/views/browser';
import {GlobalState} from 'types/store';
import {OnboardingTaskCategory, OnboardingTaskList} from 'components/onboarding_tasks';
import {RecommendedNextStepsLegacy, Preferences} from 'utils/constants';
import type {GlobalState} from 'types/store';
const getCategory = makeGetCategory();
export const getABTestPreferences = (() => {
return (state: GlobalState) => getCategory(state, Preferences.AB_TEST_PREFERENCE_VALUE);

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

@@ -1,18 +1,16 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type {AppBinding} from '@mattermost/types/apps';
import {Preferences} from 'mattermost-redux/constants';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {appBarEnabled, getAppBarAppBindings} from 'mattermost-redux/selectors/entities/apps';
import {get} from 'mattermost-redux/selectors/entities/preferences';
import {createShallowSelector} from 'mattermost-redux/utils/helpers';
import {get} from 'mattermost-redux/selectors/entities/preferences';
import {Preferences} from 'mattermost-redux/constants';
import {GlobalState} from 'types/store';
import {AppBinding} from '@mattermost/types/apps';
import {FileDropdownPluginComponent, PluginComponent} from '../types/store/plugins';
import type {GlobalState} from 'types/store';
import type {FileDropdownPluginComponent, PluginComponent} from 'types/store/plugins';
export const getFilesDropdownPluginMenuItems = createSelector(
'getFilesDropdownPluginMenuItems',

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

@@ -1,14 +1,15 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Post} from '@mattermost/types/posts';
import type {Post} from '@mattermost/types/posts';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {getPost} from 'mattermost-redux/selectors/entities/posts';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import {getGlobalItem} from 'selectors/storage';
import {arePreviewsCollapsed} from 'selectors/preferences';
import {getGlobalItem} from 'selectors/storage';
import {StoragePrefixes} from 'utils/constants';
import type {GlobalState} from 'types/store';

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

@@ -3,9 +3,10 @@
import {getBool as getBoolPreference} from 'mattermost-redux/selectors/entities/preferences';
import {GlobalState} from 'types/store';
import {Preferences} from 'utils/constants';
import type {GlobalState} from 'types/store';
export const arePreviewsCollapsed = (state: GlobalState) => {
return getBoolPreference(
state,

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

@@ -1,13 +1,13 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {ProductIdentifier} from '@mattermost/types/products';
import {GlobalState} from 'types/store';
import type {ProductComponent} from '../types/store/plugins';
import type {ProductIdentifier} from '@mattermost/types/products';
import {getCurrentProduct} from 'utils/products';
import type {GlobalState} from 'types/store';
import type {ProductComponent} from 'types/store/plugins';
export function selectCurrentProduct(state: GlobalState, pathname: string): ProductComponent | null {
return getCurrentProduct(selectProducts(state), pathname);
}

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

@@ -2,7 +2,8 @@
// See LICENSE.txt for license information.
import * as Selectors from 'selectors/rhs';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
describe('Selectors.Rhs', () => {
describe('should return the last time a post was selected', () => {

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

@@ -1,19 +1,23 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type {Channel} from '@mattermost/types/channels';
import type {Post, PostType} from '@mattermost/types/posts';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {makeGetChannel} from 'mattermost-redux/selectors/entities/channels';
import {Post, PostType} from '@mattermost/types/posts';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import {Channel} from '@mattermost/types/channels';
import {makeGetGlobalItem, makeGetGlobalItemWithDefault} from 'selectors/storage';
import type {SidebarSize} from 'components/resizable_sidebar/constants';
import {PostTypes, StoragePrefixes} from 'utils/constants';
import {localizeMessage} from 'utils/utils';
import {GlobalState} from 'types/store';
import {RhsState, FakePost, SearchType} from 'types/store/rhs';
import {PostDraft} from 'types/store/draft';
import {SidebarSize} from 'components/resizable_sidebar/constants';
import type {GlobalState} from 'types/store';
import type {PostDraft} from 'types/store/draft';
import type {RhsState, FakePost, SearchType} from 'types/store/rhs';
export function getSelectedPostId(state: GlobalState): Post['id'] {
return state.views.rhs.selectedPostId;

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

@@ -1,9 +1,11 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {getPrefix} from 'utils/storage_utils';
import * as Selectors from 'selectors/storage';
import {GlobalState} from 'types/store';
import {getPrefix} from 'utils/storage_utils';
import type {GlobalState} from 'types/store';
describe('Selectors.Storage', () => {
const testState = {

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

@@ -1,9 +1,9 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Post} from '@mattermost/types/posts';
import {Channel} from '@mattermost/types/channels';
import {Team} from '@mattermost/types/teams';
import type {Channel} from '@mattermost/types/channels';
import type {Post} from '@mattermost/types/posts';
import type {Team} from '@mattermost/types/teams';
import {getRedirectChannelNameForTeam} from 'mattermost-redux/selectors/entities/channels';
import {
@@ -13,10 +13,10 @@ import {
getTeam,
} from 'mattermost-redux/selectors/entities/teams';
import {GlobalState} from 'types/store';
import Constants from 'utils/constants';
import type {GlobalState} from 'types/store';
function getTeamRelativeUrl(team: Team | undefined) {
if (!team) {
return '';

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

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
export function isAddChannelDropdownOpen(state: GlobalState) {
return state.views.addChannelDropdown.isOpen;

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

@@ -3,7 +3,7 @@
import {WindowSizes} from 'utils/constants';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
export function getIsDesktopView(state: GlobalState): boolean {
const windowSize = state.views.browser.windowSize;

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

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
export const getLastPostsApiTimeForChannel = (state: GlobalState, channelId: string) => state.views.channel.lastGetPosts[channelId];
export const getToastStatus = (state: GlobalState) => state.views.channel.toastStatus;

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

@@ -1,7 +1,17 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import type {ChannelCategory} from '@mattermost/types/channel_categories';
import {CategorySorting} from '@mattermost/types/channel_categories';
import type {Channel} from '@mattermost/types/channels';
import type {RelationOneToOne} from '@mattermost/types/utilities';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {
makeGetCategoriesForTeam,
makeGetChannelsByCategory,
makeGetChannelIdsForCategory,
} from 'mattermost-redux/selectors/entities/channel_categories';
import {
getAllChannels,
getCurrentChannelId,
@@ -9,19 +19,11 @@ import {
getUnreadChannelIds,
sortUnreadChannels,
} from 'mattermost-redux/selectors/entities/channels';
import {
makeGetCategoriesForTeam,
makeGetChannelsByCategory,
makeGetChannelIdsForCategory,
} from 'mattermost-redux/selectors/entities/channel_categories';
import {shouldShowUnreadsCategory, isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
import {Channel} from '@mattermost/types/channels';
import {CategorySorting, ChannelCategory} from '@mattermost/types/channel_categories';
import {RelationOneToOne} from '@mattermost/types/utilities';
import {memoizeResult} from 'mattermost-redux/utils/helpers';
import {DraggingState, GlobalState} from 'types/store';
import type {DraggingState, GlobalState} from 'types/store';
export function isUnreadFilterEnabled(state: GlobalState): boolean {
return state.views.channelSidebar.unreadFilterEnabled && !shouldShowUnreadsCategory(state);

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

@@ -1,16 +1,17 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import * as UserSelectors from 'mattermost-redux/selectors/entities/users';
import {CustomStatusDuration} from '@mattermost/types/users';
import {Preferences} from 'mattermost-redux/constants';
import * as GeneralSelectors from 'mattermost-redux/selectors/entities/general';
import * as PreferenceSelectors from 'mattermost-redux/selectors/entities/preferences';
import {Preferences} from 'mattermost-redux/constants';
import * as UserSelectors from 'mattermost-redux/selectors/entities/users';
import configureStore from 'store';
import {makeGetCustomStatus, getRecentCustomStatuses, isCustomStatusEnabled, showStatusDropdownPulsatingDot, showPostHeaderUpdateStatusButton} from 'selectors/views/custom_status';
import configureStore from 'store';
import {TestHelper} from 'utils/test_helper';
import {CustomStatusDuration} from '@mattermost/types/users';
import {addTimeToTimestamp, TimeInformation} from 'utils/utils';
jest.mock('mattermost-redux/selectors/entities/users');

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

@@ -3,19 +3,20 @@
import moment from 'moment-timezone';
import type {UserCustomStatus} from '@mattermost/types/users';
import {CustomStatusDuration} from '@mattermost/types/users';
import {Preferences} from 'mattermost-redux/constants';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {get} from 'mattermost-redux/selectors/entities/preferences';
import {getCurrentTimezone} from 'mattermost-redux/selectors/entities/timezone';
import {getCurrentUser, getUser} from 'mattermost-redux/selectors/entities/users';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {get} from 'mattermost-redux/selectors/entities/preferences';
import {Preferences} from 'mattermost-redux/constants';
import {CustomStatusDuration, UserCustomStatus} from '@mattermost/types/users';
import {getCurrentMomentForTimezone} from 'utils/timezone';
import {isDateWithinDaysRange, TimeInformation} from 'utils/utils';
import {GlobalState} from 'types/store';
import {getCurrentMomentForTimezone} from 'utils/timezone';
import type {GlobalState} from 'types/store';
export function makeGetCustomStatus(): (state: GlobalState, userID?: string) => UserCustomStatus {
return createSelector(

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

@@ -1,7 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {AuthorType, MarketplaceApp, MarketplacePlugin, ReleaseStage} from '@mattermost/types/marketplace';
import {AuthorType, ReleaseStage} from '@mattermost/types/marketplace';
import type {MarketplaceApp, MarketplacePlugin} from '@mattermost/types/marketplace';
import {
getPlugins,
@@ -14,7 +15,7 @@ import {
getError,
} from 'selectors/views/marketplace';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
describe('marketplace', () => {
const samplePlugin: MarketplacePlugin = {

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

@@ -6,7 +6,7 @@ import type {MarketplaceApp, MarketplacePlugin} from '@mattermost/types/marketpl
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {isPlugin} from 'mattermost-redux/utils/marketplace';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
export const getPlugins = (state: GlobalState): MarketplacePlugin[] => state.views.marketplace.plugins;

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

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
export function isShowOnboardingTaskCompletion(state: GlobalState) {
return state.views.onboardingTasks.isShowOnboardingTaskCompletion;

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

@@ -1,8 +1,8 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {isStatusDropdownOpen} from 'selectors/views/status_dropdown';
import {setStatusDropdown} from 'actions/views/status_dropdown';
import {isStatusDropdownOpen} from 'selectors/views/status_dropdown';
import configureStore from 'store';
describe('status_dropdown selector', () => {

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

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
export function isStatusDropdownOpen(state: GlobalState) {
return state.views.statusDropdown.isOpen;

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

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
import * as selectors from './threads';

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

@@ -3,26 +3,27 @@
import moment from 'moment';
import type {Post} from '@mattermost/types/posts';
import type {Team} from '@mattermost/types/teams';
import type {UserThread} from '@mattermost/types/threads';
import {createSelector} from 'mattermost-redux/selectors/create_selector';
import {getCurrentUser} from 'mattermost-redux/selectors/entities/common';
import {makeGetPostsForIds} from 'mattermost-redux/selectors/entities/posts';
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
import {getThreads} from 'mattermost-redux/selectors/entities/threads';
import {isTimezoneEnabled} from 'mattermost-redux/selectors/entities/timezone';
import {getCurrentUser} from 'mattermost-redux/selectors/entities/common';
import {Team} from '@mattermost/types/teams';
import {UserThread} from '@mattermost/types/threads';
import {Post} from '@mattermost/types/posts';
import {DATE_LINE, makeCombineUserActivityPosts, START_OF_NEW_MESSAGES, CREATE_COMMENT} from 'mattermost-redux/utils/post_list';
import {createIdsSelector} from 'mattermost-redux/utils/helpers';
import {DATE_LINE, makeCombineUserActivityPosts, START_OF_NEW_MESSAGES, CREATE_COMMENT} from 'mattermost-redux/utils/post_list';
import {getUserCurrentTimezone} from 'mattermost-redux/utils/timezone_utils';
import {GlobalState} from 'types/store';
import {ViewsState} from 'types/store/views';
import {getIsRhsOpen, getSelectedPostId} from 'selectors/rhs';
import {isFromWebhook} from 'utils/post_utils';
import type {GlobalState} from 'types/store';
import type {ViewsState} from 'types/store/views';
interface PostFilterOptions {
postIds: Array<Post['id']>;
showDate: boolean;