* 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,13 +1,13 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {mount} from 'enzyme';
import type {ReactWrapper} from 'enzyme';
import React from 'react';
import {mount, ReactWrapper} from 'enzyme';
import * as reactRedux from 'react-redux';
import {act} from 'tests/react_testing_utils';
import mockStore from 'tests/test_store';
import {CloudProducts, LicenseSkus} from 'utils/constants';
import ADLDAPUpsellBanner from './ad_ldap_upsell_banner';

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

@@ -1,26 +1,25 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {memo, useEffect, useState} from 'react';
import {useDispatch, useSelector} from 'react-redux';
import moment from 'moment';
import React, {memo, useEffect, useState} from 'react';
import {useIntl} from 'react-intl';
import {useDispatch, useSelector} from 'react-redux';
import StartTrialBtn from 'components/learn_more_trial_modal/start_trial_btn';
import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink';
import type {GlobalState} from '@mattermost/types/store';
import {isAdmin} from 'mattermost-redux/utils/user_utils';
import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';
import {getPrevTrialLicense} from 'mattermost-redux/actions/admin';
import {getLicense} from 'mattermost-redux/selectors/entities/general';
import {checkHadPriorTrial, isCurrentLicenseCloud, getSubscriptionProduct as selectSubscriptionProduct} from 'mattermost-redux/selectors/entities/cloud';
import {getBrowserTimezone} from 'utils/timezone';
import {CloudProducts, LicenseSkus} from 'utils/constants';
import {getLicense} from 'mattermost-redux/selectors/entities/general';
import {getCurrentUser} from 'mattermost-redux/selectors/entities/users';
import {isAdmin} from 'mattermost-redux/utils/user_utils';
import CloudStartTrialButton from 'components/cloud_start_trial/cloud_start_trial_btn';
import useOpenSalesLink from 'components/common/hooks/useOpenSalesLink';
import StartTrialBtn from 'components/learn_more_trial_modal/start_trial_btn';
import {GlobalState} from '@mattermost/types/store';
import {CloudProducts, LicenseSkus} from 'utils/constants';
import {getBrowserTimezone} from 'utils/timezone';
function ADLDAPUpsellBanner() {
const [show, setShow] = useState(true);

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

@@ -2,19 +2,22 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux';
import {bindActionCreators} from 'redux';
import type {Dispatch, ActionCreatorsMapObject} from 'redux';
import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions';
import type {GetGroupsForUserParams, GetGroupsParams, Group, GroupSearchParams} from '@mattermost/types/groups';
import {GlobalState} from 'types/store';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import {makeGetAllAssociatedGroupsForReference, makeGetMyAllowReferencedGroups, searchAllowReferencedGroups, searchMyAllowReferencedGroups, searchArchivedGroups, getArchivedGroups} from 'mattermost-redux/selectors/entities/groups';
import {getGroups, getGroupsByUserIdPaginated, searchGroups} from 'mattermost-redux/actions/groups';
import {GetGroupsForUserParams, GetGroupsParams, Group, GroupSearchParams} from '@mattermost/types/groups';
import {ModalIdentifiers} from 'utils/constants';
import {isModalOpen} from 'selectors/views/modals';
import {makeGetAllAssociatedGroupsForReference, makeGetMyAllowReferencedGroups, searchAllowReferencedGroups, searchMyAllowReferencedGroups, searchArchivedGroups, getArchivedGroups} from 'mattermost-redux/selectors/entities/groups';
import {getCurrentUserId} from 'mattermost-redux/selectors/entities/users';
import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions';
import {setModalSearchTerm} from 'actions/views/search';
import {isModalOpen} from 'selectors/views/modals';
import {ModalIdentifiers} from 'utils/constants';
import type {GlobalState} from 'types/store';
import UserGroupsModal from './user_groups_modal';

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

@@ -4,8 +4,8 @@
import React, {useCallback} from 'react';
import {useIntl} from 'react-intl';
import MenuWrapper from 'components/widgets/menu/menu_wrapper';
import Menu from 'components/widgets/menu/menu';
import MenuWrapper from 'components/widgets/menu/menu_wrapper';
type Props = {
selectedFilter: string;

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

@@ -2,16 +2,17 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux';
import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions';
import {GlobalState} from 'types/store';
import {bindActionCreators} from 'redux';
import type {Dispatch, ActionCreatorsMapObject} from 'redux';
import {archiveGroup, restoreGroup} from 'mattermost-redux/actions/groups';
import {ModalData} from 'types/actions';
import {openModal} from 'actions/views/modals';
import {getGroupListPermissions} from 'mattermost-redux/selectors/entities/roles';
import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions';
import {openModal} from 'actions/views/modals';
import type {ModalData} from 'types/actions';
import type {GlobalState} from 'types/store';
import UserGroupsList from './user_groups_list';

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

@@ -1,11 +1,10 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {shallow} from 'enzyme';
import React from 'react';
import {shallow} from 'enzyme';
import {Group, GroupPermissions} from '@mattermost/types/groups';
import type {Group, GroupPermissions} from '@mattermost/types/groups';
import UserGroupsList from './user_groups_list';

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

@@ -2,24 +2,27 @@
// See LICENSE.txt for license information.
import React, {useCallback, useEffect, useRef, useState} from 'react';
import {FormattedMessage} from 'react-intl';
import {VariableSizeList, ListChildComponentProps} from 'react-window';
import type {ListChildComponentProps} from 'react-window';
import {VariableSizeList} from 'react-window';
import InfiniteLoader from 'react-window-infinite-loader';
import type {Group, GroupPermissions} from '@mattermost/types/groups';
import type {ActionResult} from 'mattermost-redux/types/actions';
import LoadingScreen from 'components/loading_screen';
import NoResultsIndicator from 'components/no_results_indicator';
import {NoResultsVariant} from 'components/no_results_indicator/types';
import LoadingScreen from 'components/loading_screen';
import MenuWrapper from 'components/widgets/menu/menu_wrapper';
import Menu from 'components/widgets/menu/menu';
import * as Utils from 'utils/utils';
import {ActionResult} from 'mattermost-redux/types/actions';
import {ModalData} from 'types/actions';
import {ModalIdentifiers} from 'utils/constants';
import ViewUserGroupModal from 'components/view_user_group_modal';
import Menu from 'components/widgets/menu/menu';
import MenuWrapper from 'components/widgets/menu/menu_wrapper';
import {ModalIdentifiers} from 'utils/constants';
import * as Utils from 'utils/utils';
import type {ModalData} from 'types/actions';
import {Group, GroupPermissions} from '@mattermost/types/groups';
import ADLDAPUpsellBanner from '../ad_ldap_upsell_banner';
export type Props = {

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

@@ -1,10 +1,10 @@
// 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 {Group} from '@mattermost/types/groups';
import type {Group} from '@mattermost/types/groups';
import UserGroupsModal from './user_groups_modal';

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

@@ -2,24 +2,23 @@
// See LICENSE.txt for license information.
import React, {useCallback, useEffect, useMemo, useState} from 'react';
import {Modal} from 'react-bootstrap';
import Constants from 'utils/constants';
import * as Utils from 'utils/utils';
import {GetGroupsForUserParams, GetGroupsParams, Group, GroupSearchParams} from '@mattermost/types/groups';
import type {GetGroupsForUserParams, GetGroupsParams, Group, GroupSearchParams} from '@mattermost/types/groups';
import './user_groups_modal.scss';
import Input from 'components/widgets/inputs/input/input';
import NoResultsIndicator from 'components/no_results_indicator';
import {NoResultsVariant} from 'components/no_results_indicator/types';
import Input from 'components/widgets/inputs/input/input';
import Constants from 'utils/constants';
import * as Utils from 'utils/utils';
import UserGroupsList from './user_groups_list';
import UserGroupsFilter from './user_groups_filter/user_groups_filter';
import UserGroupsModalHeader from './user_groups_modal_header';
import ADLDAPUpsellBanner from './ad_ldap_upsell_banner';
import {usePagingMeta} from './hooks';
import UserGroupsFilter from './user_groups_filter/user_groups_filter';
import UserGroupsList from './user_groups_list';
import UserGroupsModalHeader from './user_groups_modal_header';
const GROUPS_PER_PAGE = 60;

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

@@ -2,16 +2,17 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators, Dispatch, ActionCreatorsMapObject} from 'redux';
import {bindActionCreators} from 'redux';
import type {Dispatch, ActionCreatorsMapObject} from 'redux';
import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions';
import {GlobalState} from 'types/store';
import {ModalData} from 'types/actions';
import {Permissions} from 'mattermost-redux/constants';
import {openModal} from 'actions/views/modals';
import {haveISystemPermission} from 'mattermost-redux/selectors/entities/roles';
import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions';
import {openModal} from 'actions/views/modals';
import type {ModalData} from 'types/actions';
import type {GlobalState} from 'types/store';
import UserGroupsModalHeader from './user_groups_modal_header';

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

@@ -1,9 +1,8 @@
// 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 UserGroupsModalHeader from './user_groups_modal_header';

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

@@ -2,15 +2,15 @@
// See LICENSE.txt for license information.
import React, {useCallback} from 'react';
import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl';
import CreateUserGroupsModal from 'components/create_user_groups_modal';
import {ModalData} from 'types/actions';
import {ModalIdentifiers} from 'utils/constants';
import type {ModalData} from 'types/actions';
export type Props = {
canCreateCustomGroups: boolean;
onExited: () => void;