Enable import order (#24091)
* 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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
b2f36c7cdf
Коммит
d13429aa92
@@ -1,18 +1,20 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React, {ComponentProps} from 'react';
|
||||
import React from 'react';
|
||||
import type {ComponentProps} from 'react';
|
||||
|
||||
import GuestTag from 'components/widgets/tag/guest_tag';
|
||||
import type {ChannelType} from '@mattermost/types/channels';
|
||||
import type {UserCustomStatus} from '@mattermost/types/users';
|
||||
|
||||
import {shallowWithIntl} from 'tests/helpers/intl-test-helper';
|
||||
import ChannelHeader from 'components/channel_header/channel_header';
|
||||
import ChannelInfoButton from 'components/channel_header/channel_info_button';
|
||||
import Markdown from 'components/markdown';
|
||||
import GuestTag from 'components/widgets/tag/guest_tag';
|
||||
|
||||
import {shallowWithIntl} from 'tests/helpers/intl-test-helper';
|
||||
import Constants, {RHSStates} from 'utils/constants';
|
||||
import {TestHelper} from '../../utils/test_helper';
|
||||
import {ChannelType} from '@mattermost/types/channels';
|
||||
import {UserCustomStatus} from '@mattermost/types/users';
|
||||
import {TestHelper} from 'utils/test_helper';
|
||||
|
||||
describe('components/ChannelHeader', () => {
|
||||
const baseProps: ComponentProps<typeof ChannelHeader> = {
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React, {MouseEvent, ReactNode, RefObject} from 'react';
|
||||
import {Overlay} from 'react-bootstrap';
|
||||
import {FormattedMessage, injectIntl, IntlShape} from 'react-intl';
|
||||
import classNames from 'classnames';
|
||||
import React from 'react';
|
||||
import type {MouseEvent, ReactNode, RefObject} from 'react';
|
||||
import {Overlay} from 'react-bootstrap';
|
||||
import {FormattedMessage, injectIntl} from 'react-intl';
|
||||
import type {IntlShape} from 'react-intl';
|
||||
|
||||
import GuestTag from 'components/widgets/tag/guest_tag';
|
||||
import BotTag from 'components/widgets/tag/bot_tag';
|
||||
import type {Channel, ChannelMembership, ChannelNotifyProps} from '@mattermost/types/channels';
|
||||
import type {UserCustomStatus, UserProfile} from '@mattermost/types/users';
|
||||
|
||||
import {Permissions} from 'mattermost-redux/constants';
|
||||
import {memoizeResult} from 'mattermost-redux/utils/helpers';
|
||||
import {displayUsername, isGuest} from 'mattermost-redux/utils/user_utils';
|
||||
|
||||
import EditChannelHeaderModal from 'components/edit_channel_header_modal';
|
||||
import Markdown from 'components/markdown';
|
||||
import OverlayTrigger, {BaseOverlayTrigger} from 'components/overlay_trigger';
|
||||
import Tooltip from 'components/tooltip';
|
||||
import StatusIcon from 'components/status_icon';
|
||||
import ArchiveIcon from 'components/widgets/icons/archive_icon';
|
||||
import SharedChannelIndicator from 'components/shared_channel_indicator';
|
||||
import ChannelPermissionGate from 'components/permissions_gates/channel_permission_gate';
|
||||
import {ChannelHeaderDropdown} from 'components/channel_header_dropdown';
|
||||
import MenuWrapper from 'components/widgets/menu/menu_wrapper';
|
||||
|
||||
import Popover from 'components/widgets/popover';
|
||||
import CallButton from 'plugins/call_button';
|
||||
import CustomStatusEmoji from 'components/custom_status/custom_status_emoji';
|
||||
import CustomStatusText from 'components/custom_status/custom_status_text';
|
||||
import EditChannelHeaderModal from 'components/edit_channel_header_modal';
|
||||
import LocalizedIcon from 'components/localized_icon';
|
||||
import Markdown from 'components/markdown';
|
||||
import OverlayTrigger from 'components/overlay_trigger';
|
||||
import type {BaseOverlayTrigger} from 'components/overlay_trigger';
|
||||
import ChannelPermissionGate from 'components/permissions_gates/channel_permission_gate';
|
||||
import SharedChannelIndicator from 'components/shared_channel_indicator';
|
||||
import StatusIcon from 'components/status_icon';
|
||||
import Timestamp from 'components/timestamp';
|
||||
import ChannelHeaderPlug from 'plugins/channel_header_plug';
|
||||
import Tooltip from 'components/tooltip';
|
||||
import ArchiveIcon from 'components/widgets/icons/archive_icon';
|
||||
import MenuWrapper from 'components/widgets/menu/menu_wrapper';
|
||||
import Popover from 'components/widgets/popover';
|
||||
import BotTag from 'components/widgets/tag/bot_tag';
|
||||
import GuestTag from 'components/widgets/tag/guest_tag';
|
||||
|
||||
import CallButton from 'plugins/call_button';
|
||||
import ChannelHeaderPlug from 'plugins/channel_header_plug';
|
||||
import {
|
||||
Constants,
|
||||
ModalIdentifiers,
|
||||
NotificationLevels,
|
||||
RHSStates,
|
||||
} from 'utils/constants';
|
||||
import {handleFormattedTextClick, localizeMessage, isEmptyObject, toTitleCase} from 'utils/utils';
|
||||
import {t} from 'utils/i18n';
|
||||
import {handleFormattedTextClick, localizeMessage, isEmptyObject, toTitleCase} from 'utils/utils';
|
||||
|
||||
import {UserCustomStatus, UserProfile} from '@mattermost/types/users';
|
||||
import {Channel, ChannelMembership, ChannelNotifyProps} from '@mattermost/types/channels';
|
||||
import {RhsState} from 'types/store/rhs';
|
||||
|
||||
import {ModalData} from 'types/actions';
|
||||
|
||||
import LocalizedIcon from 'components/localized_icon';
|
||||
import type {ModalData} from 'types/actions';
|
||||
import type {RhsState} from 'types/store/rhs';
|
||||
|
||||
import ChannelInfoButton from './channel_info_button';
|
||||
import HeaderIconWrapper from './components/header_icon_wrapper';
|
||||
|
||||
@@ -2,18 +2,17 @@
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React, {useCallback} from 'react';
|
||||
|
||||
import {useDispatch, useSelector} from 'react-redux';
|
||||
|
||||
import styled from 'styled-components';
|
||||
|
||||
import {Channel} from '@mattermost/types/channels';
|
||||
import {getIsRhsOpen, getRhsState} from 'selectors/rhs';
|
||||
import type {Channel} from '@mattermost/types/channels';
|
||||
|
||||
import {closeRightHandSide, showChannelInfo} from 'actions/views/rhs';
|
||||
import {getIsRhsOpen, getRhsState} from 'selectors/rhs';
|
||||
|
||||
import {RHSStates} from 'utils/constants';
|
||||
import {RhsState} from 'types/store/rhs';
|
||||
|
||||
import type {RhsState} from 'types/store/rhs';
|
||||
|
||||
import HeaderIconWrapper from './components/header_icon_wrapper';
|
||||
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import {shallow} from 'enzyme';
|
||||
import React from 'react';
|
||||
|
||||
import HeaderIconWrapper from 'components/channel_header/components/header_icon_wrapper';
|
||||
import FlagIcon from 'components/widgets/icons/flag_icon';
|
||||
import MentionsIcon from 'components/widgets/icons/mentions_icon';
|
||||
import PinIcon from 'components/widgets/icons/pin_icon';
|
||||
import SearchIcon from 'components/widgets/icons/search_icon';
|
||||
|
||||
import HeaderIconWrapper from 'components/channel_header/components/header_icon_wrapper';
|
||||
|
||||
describe('components/channel_header/components/HeaderIconWrapper', () => {
|
||||
function emptyFunction() {} //eslint-disable-line no-empty-function
|
||||
const mentionsIcon = (
|
||||
|
||||
@@ -4,17 +4,18 @@
|
||||
import React from 'react';
|
||||
import {FormattedMessage} from 'react-intl';
|
||||
|
||||
import OverlayTrigger from 'components/overlay_trigger';
|
||||
import Tooltip from 'components/tooltip';
|
||||
import NewChannelWithBoardTourTip from 'components/app_bar/new_channel_with_board_tour_tip';
|
||||
import KeyboardShortcutSequence, {
|
||||
KEYBOARD_SHORTCUTS,
|
||||
KeyboardShortcutDescriptor,
|
||||
} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
||||
import type {
|
||||
KeyboardShortcutDescriptor} from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence';
|
||||
import OverlayTrigger from 'components/overlay_trigger';
|
||||
import Tooltip from 'components/tooltip';
|
||||
|
||||
import {localizeMessage} from 'utils/utils';
|
||||
import {Constants, suitePluginIds} from 'utils/constants';
|
||||
import {t} from 'utils/i18n';
|
||||
import {localizeMessage} from 'utils/utils';
|
||||
|
||||
type Props = {
|
||||
ariaLabel?: boolean;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
|
||||
import {connect} from 'react-redux';
|
||||
import {withRouter} from 'react-router-dom';
|
||||
import {bindActionCreators} from 'redux';
|
||||
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
|
||||
|
||||
import {
|
||||
favoriteChannel,
|
||||
@@ -30,6 +31,7 @@ import {
|
||||
getUser,
|
||||
makeGetProfilesInChannel,
|
||||
} from 'mattermost-redux/selectors/entities/users';
|
||||
import type {Action} from 'mattermost-redux/types/actions';
|
||||
import {getUserIdFromChannelName} from 'mattermost-redux/utils/channel_utils';
|
||||
|
||||
import {goToLastViewedChannel} from 'actions/views/channel';
|
||||
@@ -40,18 +42,18 @@ import {
|
||||
closeRightHandSide,
|
||||
showChannelMembers,
|
||||
} from 'actions/views/rhs';
|
||||
import {makeGetCustomStatus, isCustomStatusEnabled, isCustomStatusExpired} from 'selectors/views/custom_status';
|
||||
import {getIsRhsOpen, getRhsState} from 'selectors/rhs';
|
||||
import {isModalOpen} from 'selectors/views/modals';
|
||||
import {getAnnouncementBarCount} from 'selectors/views/announcement_bar';
|
||||
import {makeGetCustomStatus, isCustomStatusEnabled, isCustomStatusExpired} from 'selectors/views/custom_status';
|
||||
import {isModalOpen} from 'selectors/views/modals';
|
||||
|
||||
import {ModalIdentifiers} from 'utils/constants';
|
||||
import {isFileAttachmentsEnabled} from 'utils/file_utils';
|
||||
|
||||
import {GlobalState} from 'types/store';
|
||||
import type {GlobalState} from 'types/store';
|
||||
|
||||
import {Action} from 'mattermost-redux/types/actions';
|
||||
|
||||
import ChannelHeader, {Props} from './channel_header';
|
||||
import ChannelHeader from './channel_header';
|
||||
import type {Props} from './channel_header';
|
||||
|
||||
const EMPTY_CHANNEL = {};
|
||||
const EMPTY_CHANNEL_STATS = {member_count: 0, guest_count: 0, pinnedpost_count: 0, files_count: 0};
|
||||
|
||||
Ссылка в новой задаче
Block a user