* 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 React, {FormEvent} from 'react';
import {shallow} from 'enzyme';
import React from 'react';
import type {FormEvent} from 'react';
import {FormattedMessage} from 'react-intl';
import AbstractCommand from 'components/integrations/abstract_command';
import {TestHelper} from 'utils/test_helper';
describe('components/integrations/AbstractCommand', () => {

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

@@ -1,22 +1,24 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {ChangeEvent} from 'react';
import {FormattedMessage, MessageDescriptor} from 'react-intl';
import React from 'react';
import type {ChangeEvent} from 'react';
import {FormattedMessage} from 'react-intl';
import type {MessageDescriptor} from 'react-intl';
import {Link} from 'react-router-dom';
import BackstageHeader from 'components/backstage/components/backstage_header';
import {Constants, DeveloperLinks} from 'utils/constants';
import * as Utils from 'utils/utils';
import FormError from 'components/form_error';
import SpinnerButton from 'components/spinner_button';
import LocalizedInput from 'components/localized_input/localized_input';
import ExternalLink from 'components/external_link';
import type {Command} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import BackstageHeader from 'components/backstage/components/backstage_header';
import ExternalLink from 'components/external_link';
import FormError from 'components/form_error';
import LocalizedInput from 'components/localized_input/localized_input';
import SpinnerButton from 'components/spinner_button';
import {Constants, DeveloperLinks} from 'utils/constants';
import {t} from 'utils/i18n';
import {Command} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import * as Utils from 'utils/utils';
const REQUEST_POST = 'P';
const REQUEST_GET = 'G';

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

@@ -1,13 +1,13 @@
// 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 type {Team} from '@mattermost/types/teams';
import ChannelSelect from 'components/channel_select';
import AbstractIncomingWebhook from 'components/integrations/abstract_incoming_webhook';
import {Team} from '@mattermost/types/teams';
type AbstractIncomingWebhookProps = React.ComponentProps<typeof AbstractIncomingWebhook>;

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

@@ -1,17 +1,21 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {ChangeEventHandler, FormEvent, MouseEvent, PureComponent} from 'react';
import {FormattedMessage, MessageDescriptor} from 'react-intl';
import React, {PureComponent} from 'react';
import type {ChangeEventHandler, FormEvent, MouseEvent} from 'react';
import {FormattedMessage} from 'react-intl';
import type {MessageDescriptor} from 'react-intl';
import {Link} from 'react-router-dom';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import BackstageHeader from 'components/backstage/components/backstage_header';
import ChannelSelect from 'components/channel_select';
import FormError from 'components/form_error';
import SpinnerButton from 'components/spinner_button';
import {Team} from '@mattermost/types/teams';
import {localizeMessage} from 'utils/utils';
import {IncomingWebhook} from '@mattermost/types/integrations';
interface State {
displayName: string;

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

@@ -1,19 +1,19 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React from 'react';
import PropTypes from 'prop-types';
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router-dom';
import {Permissions} from 'mattermost-redux/constants';
import {localizeMessage} from 'utils/utils';
import BackstageHeader from 'components/backstage/components/backstage_header';
import FormError from 'components/form_error';
import SpinnerButton from 'components/spinner_button';
import SystemPermissionGate from 'components/permissions_gates/system_permission_gate';
import SpinnerButton from 'components/spinner_button';
import {localizeMessage} from 'utils/utils';
export default class AbstractOAuthApp extends React.PureComponent {
static propTypes = {

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

@@ -1,9 +1,9 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {shallow} from 'enzyme';
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {shallow} from 'enzyme';
import AbstractOAuthApp from 'components/integrations/abstract_oauth_app.jsx';

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

@@ -1,12 +1,13 @@
// 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 type {Team} from '@mattermost/types/teams';
import AbstractOutgoingWebhook from 'components/integrations/abstract_outgoing_webhook';
import ChannelSelect from 'components/channel_select';
import {Team} from '@mattermost/types/teams';
import AbstractOutgoingWebhook from 'components/integrations/abstract_outgoing_webhook';
describe('components/integrations/AbstractOutgoingWebhook', () => {
const team: Team = {

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

@@ -1,19 +1,23 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {ChangeEventHandler, FormEvent, MouseEvent} from 'react';
import {FormattedMessage, MessageDescriptor} from 'react-intl';
import React from 'react';
import type {ChangeEventHandler, FormEvent, MouseEvent} from 'react';
import {FormattedMessage} from 'react-intl';
import type {MessageDescriptor} from 'react-intl';
import {Link} from 'react-router-dom';
import {localizeMessage} from 'utils/utils';
import {Team} from '@mattermost/types/teams';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import BackstageHeader from 'components/backstage/components/backstage_header';
import ChannelSelect from 'components/channel_select';
import ExternalLink from 'components/external_link';
import FormError from 'components/form_error';
import SpinnerButton from 'components/spinner_button';
import ExternalLink from 'components/external_link';
import {DocLinks} from 'utils/constants';
import {OutgoingWebhook} from '@mattermost/types/integrations';
import {localizeMessage} from 'utils/utils';
interface State {
callbackUrls: string;

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

@@ -1,8 +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 AddCommand from 'components/integrations/add_command/add_command';

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

@@ -2,13 +2,14 @@
// See LICENSE.txt for license information.
import React, {useState} from 'react';
import {useIntl} from 'react-intl';
import type {MessageDescriptor} from 'react-intl';
import {useHistory} from 'react-router-dom';
import {useIntl, MessageDescriptor} from 'react-intl';
import {Command} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import type {Command} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import {ActionResult} from 'mattermost-redux/types/actions.js';
import type {ActionResult} from 'mattermost-redux/types/actions.js';
import AbstractCommand from '../abstract_command';

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

@@ -2,12 +2,14 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {bindActionCreators, ActionCreatorsMapObject, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import {ActionFunc} from 'mattermost-redux/types/actions';
import {addCommand} from 'mattermost-redux/actions/integrations';
import type {ActionFunc} from 'mattermost-redux/types/actions';
import AddCommand, {Props} from './add_command';
import AddCommand from './add_command';
import type {Props} from './add_command';
function mapDispatchToProps(dispatch: Dispatch) {
return {

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

@@ -1,8 +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 AddIncomingWebhook from 'components/integrations/add_incoming_webhook/add_incoming_webhook';

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

@@ -3,11 +3,13 @@
import React from 'react';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import AbstractIncomingWebhook from 'components/integrations/abstract_incoming_webhook';
import {getHistory} from 'utils/browser_history';
import {t} from 'utils/i18n';
import AbstractIncomingWebhook from 'components/integrations/abstract_incoming_webhook';
import {Team} from '@mattermost/types/teams';
import {IncomingWebhook} from '@mattermost/types/integrations';
const HEADER = {id: t('integrations.add'), defaultMessage: 'Add'};
const FOOTER = {id: t('add_incoming_webhook.save'), defaultMessage: 'Save'};

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

@@ -2,14 +2,15 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import type {GlobalState} from '@mattermost/types/store';
import {createIncomingHook} from 'mattermost-redux/actions/integrations';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from '@mattermost/types/store';
import {Action, GenericAction} from 'mattermost-redux/types/actions';
import {IncomingWebhook} from '@mattermost/types/integrations';
import type {Action, GenericAction} from 'mattermost-redux/types/actions';
import AddIncomingWebhook from './add_incoming_webhook';

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

@@ -1,8 +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 AddOAuthApp from 'components/integrations/add_oauth_app/add_oauth_app';

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

@@ -4,12 +4,13 @@
import React, {useState} from 'react';
import {useHistory} from 'react-router-dom';
import {OAuthApp} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import type {OAuthApp} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import {ActionResult} from 'mattermost-redux/types/actions.js';
import type {ActionResult} from 'mattermost-redux/types/actions.js';
import {t} from 'utils/i18n';
import AbstractOAuthApp from '../abstract_oauth_app.jsx';
const HEADER = {id: t('add_oauth_app.header'), defaultMessage: 'Add'};

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

@@ -2,12 +2,14 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import {addOAuthApp} from 'mattermost-redux/actions/integrations';
import {ActionFunc} from 'mattermost-redux/types/actions';
import type {ActionFunc} from 'mattermost-redux/types/actions';
import AddOAuthApp, {Props} from './add_oauth_app';
import AddOAuthApp from './add_oauth_app';
import type {Props} from './add_oauth_app';
function mapDispatchToProps(dispatch: Dispatch) {
return {

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

@@ -1,8 +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 AddOutgoingWebhook from 'components/integrations/add_outgoing_webhook/add_outgoing_webhook';

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

@@ -4,14 +4,14 @@
import React, {useState} from 'react';
import {useHistory} from 'react-router-dom';
import {t} from 'utils/i18n';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {ActionResult} from 'mattermost-redux/types/actions';
import AbstractOutgoingWebhook from 'components/integrations/abstract_outgoing_webhook';
import {Team} from '@mattermost/types/teams';
import {OutgoingWebhook} from '@mattermost/types/integrations';
import {ActionResult} from 'mattermost-redux/types/actions';
import {t} from 'utils/i18n';
const HEADER = {id: t('integrations.add'), defaultMessage: 'Add'};
const FOOTER = {id: t('add_outgoing_webhook.save'), defaultMessage: 'Save'};

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

@@ -2,15 +2,17 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import {createOutgoingHook} from 'mattermost-redux/actions/integrations';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {ActionFunc} from 'mattermost-redux/types/actions';
import type {ActionFunc} from 'mattermost-redux/types/actions';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
import AddOutgoingWebhook, {Props} from './add_outgoing_webhook';
import AddOutgoingWebhook from './add_outgoing_webhook';
import type {Props} from './add_outgoing_webhook';
function mapStateToProps(state: GlobalState) {
const config = getConfig(state);

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

@@ -1,8 +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 {TestHelper} from 'utils/test_helper';

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

@@ -1,33 +1,32 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {ChangeEvent, FormEvent} from 'react';
import {Link} from 'react-router-dom';
import React from 'react';
import type {ChangeEvent, FormEvent} from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router-dom';
import * as FileUtils from 'utils/file_utils';
import type {Bot, BotPatch} from '@mattermost/types/bots';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile} from '@mattermost/types/users';
import * as UserUtils from 'mattermost-redux/utils/user_utils';
import {General} from 'mattermost-redux/constants';
import BotDefaultIcon from 'images/bot_default_icon.png';
import type {ActionResult} from 'mattermost-redux/types/actions';
import * as UserUtils from 'mattermost-redux/utils/user_utils';
import BackstageHeader from 'components/backstage/components/backstage_header';
import OverlayTrigger from 'components/overlay_trigger';
import Tooltip from 'components/tooltip';
import SpinnerButton from 'components/spinner_button';
import ExternalLink from 'components/external_link';
import FormError from 'components/form_error';
import OverlayTrigger from 'components/overlay_trigger';
import SpinnerButton from 'components/spinner_button';
import Tooltip from 'components/tooltip';
import BotDefaultIcon from 'images/bot_default_icon.png';
import {getHistory} from 'utils/browser_history';
import {AcceptedProfileImageTypes, Constants, DeveloperLinks, ValidationErrors} from 'utils/constants';
import * as FileUtils from 'utils/file_utils';
import * as Utils from 'utils/utils';
import {Team} from '@mattermost/types/teams';
import {Bot, BotPatch} from '@mattermost/types/bots';
import {UserProfile} from '@mattermost/types/users';
import {ActionResult} from 'mattermost-redux/types/actions';
import ExternalLink from 'components/external_link';
const roleOptionSystemAdmin = 'System Admin';
const roleOptionMember = 'Member';

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

@@ -2,22 +2,23 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
import type {RouteComponentProps} from 'react-router-dom';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import {RouteComponentProps} from 'react-router-dom';
import {updateUserRoles, uploadProfileImage, setDefaultProfileImage, createUserAccessToken} from 'mattermost-redux/actions/users';
import {createBot, patchBot} from 'mattermost-redux/actions/bots';
import {updateUserRoles, uploadProfileImage, setDefaultProfileImage, createUserAccessToken} from 'mattermost-redux/actions/users';
import {Permissions} from 'mattermost-redux/constants';
import {getBotAccounts} from 'mattermost-redux/selectors/entities/bots';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getUser} from 'mattermost-redux/selectors/entities/users';
import {haveISystemPermission} from 'mattermost-redux/selectors/entities/roles';
import {Permissions} from 'mattermost-redux/constants';
import {ActionFunc} from 'mattermost-redux/types/actions';
import {getUser} from 'mattermost-redux/selectors/entities/users';
import type {ActionFunc} from 'mattermost-redux/types/actions';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
import AddBot, {Props} from './add_bot';
import AddBot from './add_bot';
import type {Props} from './add_bot';
type OwnProps = {

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

@@ -1,14 +1,16 @@
// 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 {FormattedMessage} from 'react-intl';
import Markdown from 'components/markdown';
import {TestHelper as UtilsTestHelper} from 'utils/test_helper';
import {generateId} from 'mattermost-redux/utils/helpers';
import Markdown from 'components/markdown';
import {TestHelper as UtilsTestHelper} from 'utils/test_helper';
import Bot from './bot';
describe('components/integrations/bots/Bot', () => {

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

@@ -1,20 +1,22 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {ChangeEvent, SyntheticEvent, ReactNode} from 'react';
import React from 'react';
import type {ChangeEvent, SyntheticEvent, ReactNode} from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router-dom';
import {FormattedMessage} from 'react-intl';
import type {Bot as BotType} from '@mattermost/types/bots';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile, UserAccessToken} from '@mattermost/types/users';
import {ActionResult} from 'mattermost-redux/types/actions';
import {Bot as BotType} from '@mattermost/types/bots';
import {UserProfile, UserAccessToken} from '@mattermost/types/users';
import {Team} from '@mattermost/types/teams';
import type {ActionResult} from 'mattermost-redux/types/actions';
import ConfirmModal from 'components/confirm_modal';
import Markdown from 'components/markdown';
import SaveButton from 'components/save_button';
import WarningIcon from 'components/widgets/icons/fa_warning_icon';
import * as Utils from 'utils/utils';
export function matchesFilter(bot: BotType, filter?: string, owner?: UserProfile): boolean {

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

@@ -1,8 +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 {TestHelper} from 'utils/test_helper';

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

@@ -4,20 +4,20 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Bot as BotType} from '@mattermost/types/bots';
import {RelationOneToOne} from '@mattermost/types/utilities';
import {UserProfile, UserAccessToken} from '@mattermost/types/users';
import {ActionResult} from 'mattermost-redux/types/actions';
import {Team} from '@mattermost/types/teams';
import type {Bot as BotType} from '@mattermost/types/bots';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile, UserAccessToken} from '@mattermost/types/users';
import type {RelationOneToOne} from '@mattermost/types/utilities';
import {getSiteURL} from 'utils/url';
import * as Utils from 'utils/utils';
import Constants from 'utils/constants';
import type {ActionResult} from 'mattermost-redux/types/actions';
import BackstageList from 'components/backstage/components/backstage_list';
import ExternalLink from 'components/external_link';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import ExternalLink from 'components/external_link';
import Constants from 'utils/constants';
import {getSiteURL} from 'utils/url';
import * as Utils from 'utils/utils';
import Bot, {matchesFilter} from './bot';

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

@@ -2,21 +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 type {Bot as BotType} from '@mattermost/types/bots';
import type {GlobalState} from '@mattermost/types/store';
import type {UserProfile} from '@mattermost/types/users';
import {getExternalBotAccounts} from 'mattermost-redux/selectors/entities/bots';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {loadBots, disableBot, enableBot} from 'mattermost-redux/actions/bots';
import {getAppsBotIDs as fetchAppsBotIDs} from 'mattermost-redux/actions/integrations';
import {getAppsBotIDs} from 'mattermost-redux/selectors/entities/integrations';
import {createUserAccessToken, revokeUserAccessToken, enableUserAccessToken, disableUserAccessToken, getUserAccessTokensForUser, getUser} from 'mattermost-redux/actions/users';
import * as UserSelectors from 'mattermost-redux/selectors/entities/users';
import {GlobalState} from '@mattermost/types/store';
import {GenericAction, ActionResult, ActionFunc} from 'mattermost-redux/types/actions';
import {Bot as BotType} from '@mattermost/types/bots';
import {UserProfile} from '@mattermost/types/users';
import {appsEnabled} from 'mattermost-redux/selectors/entities/apps';
import {getExternalBotAccounts} from 'mattermost-redux/selectors/entities/bots';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getAppsBotIDs} from 'mattermost-redux/selectors/entities/integrations';
import * as UserSelectors from 'mattermost-redux/selectors/entities/users';
import type {GenericAction, ActionResult, ActionFunc} from 'mattermost-redux/types/actions';
import Bots from './bots';

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

@@ -4,18 +4,15 @@
import React from 'react';
import {Route, Switch, Redirect} from 'react-router-dom';
import {Team} from '@mattermost/types/teams';
import type {Command} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile} from '@mattermost/types/users';
import type {RelationOneToOne} from '@mattermost/types/utilities';
import {UserProfile} from '@mattermost/types/users';
import {RelationOneToOne} from '@mattermost/types/utilities';
import {Command} from '@mattermost/types/integrations';
import InstalledCommands from 'components/integrations/installed_commands';
import AddCommand from 'components/integrations/add_command';
import EditCommand from 'components/integrations/edit_command';
import ConfirmIntegration from 'components/integrations/confirm_integration';
import EditCommand from 'components/integrations/edit_command';
import InstalledCommands from 'components/integrations/installed_commands';
interface IProps {
component: any;

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

@@ -2,13 +2,14 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {AnyAction, bindActionCreators, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {AnyAction, Dispatch} from 'redux';
import type {GlobalState} from '@mattermost/types/store';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getCommands} from 'mattermost-redux/selectors/entities/integrations';
import {getUsers} from 'mattermost-redux/selectors/entities/users';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from '@mattermost/types/store';
import {loadCommandsAndProfilesForTeam} from 'actions/integration_actions';

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

@@ -1,19 +1,19 @@
// 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 {Router} from 'react-router-dom';
import {getHistory} from 'utils/browser_history';
import {TestHelper} from 'utils/test_helper';
import {renderWithIntlAndStore} from 'tests/react_testing_utils';
import type {Bot} from '@mattermost/types/bots';
import type {IncomingWebhook, OAuthApp, OutgoingWebhook} from '@mattermost/types/integrations';
import type {IDMappedObjects} from '@mattermost/types/utilities';
import ConfirmIntegration from 'components/integrations/confirm_integration/confirm_integration';
import {IncomingWebhook, OAuthApp, OutgoingWebhook} from '@mattermost/types/integrations';
import {Bot} from '@mattermost/types/bots';
import {IDMappedObjects} from '@mattermost/types/utilities';
import {renderWithIntlAndStore} from 'tests/react_testing_utils';
import {getHistory} from 'utils/browser_history';
import {TestHelper} from 'utils/test_helper';
describe('components/integrations/ConfirmIntegration', () => {
const id = 'r5tpgt4iepf45jt768jz84djic';

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

@@ -5,19 +5,19 @@ import React, {useEffect} from 'react';
import {FormattedMessage} from 'react-intl';
import {Link, useHistory} from 'react-router-dom';
import type {Bot} from '@mattermost/types/bots';
import type {Command, IncomingWebhook, OAuthApp, OutgoingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {IDMappedObjects} from '@mattermost/types/utilities';
import BackstageHeader from 'components/backstage/components/backstage_header';
import CopyText from 'components/copy_text';
import ExternalLink from 'components/external_link';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import {Constants, DeveloperLinks, ErrorPageTypes} from 'utils/constants';
import {getSiteURL} from 'utils/url';
import {Team} from '@mattermost/types/teams';
import {Command, IncomingWebhook, OAuthApp, OutgoingWebhook} from '@mattermost/types/integrations';
import {IDMappedObjects} from '@mattermost/types/utilities';
import CopyText from 'components/copy_text';
import BackstageHeader from 'components/backstage/components/backstage_header';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import {Bot} from '@mattermost/types/bots';
import ExternalLink from 'components/external_link';
type Props = {
team: Team;
location: {search: string};

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

@@ -3,10 +3,10 @@
import {connect} from 'react-redux';
import {getCommands, getOAuthApps, getIncomingHooks, getOutgoingHooks} from 'mattermost-redux/selectors/entities/integrations';
import {getBotAccounts} from 'mattermost-redux/selectors/entities/bots';
import {getCommands, getOAuthApps, getIncomingHooks, getOutgoingHooks} from 'mattermost-redux/selectors/entities/integrations';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
import ConfirmIntegration from './confirm_integration';

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

@@ -4,7 +4,7 @@
import React, {useCallback} from 'react';
import {FormattedMessage} from 'react-intl';
import {openModal as openModalAction} from 'actions/views/modals';
import type {openModal as openModalAction} from 'actions/views/modals';
import ConfirmModalRedux from 'components/confirm_modal_redux';
import WarningIcon from 'components/widgets/icons/fa_warning_icon';

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

@@ -1,14 +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 {Team} from '@mattermost/types/teams';
import {Command} from '@mattermost/types/integrations';
import type {Command} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import EditCommand from 'components/integrations/edit_command/edit_command';
import {TestHelper} from 'utils/test_helper';
import EditCommand from 'components/integrations/edit_command/edit_command';
describe('components/integrations/EditCommand', () => {
const getCustomTeamCommands = jest.fn(

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

@@ -4,14 +4,16 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Team} from '@mattermost/types/teams';
import {Command} from '@mattermost/types/integrations';
import {RelationOneToOne} from '@mattermost/types/utilities';
import type {Command} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {RelationOneToOne} from '@mattermost/types/utilities';
import ConfirmModal from 'components/confirm_modal';
import LoadingScreen from 'components/loading_screen';
import {getHistory} from 'utils/browser_history';
import {t} from 'utils/i18n';
import LoadingScreen from 'components/loading_screen';
import ConfirmModal from 'components/confirm_modal';
import AbstractCommand from '../abstract_command';
const HEADER = {id: t('integrations.edit'), defaultMessage: 'Edit'};

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

@@ -2,14 +2,16 @@
// 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 type {Command} from '@mattermost/types/integrations';
import type {GlobalState} from '@mattermost/types/store';
import {editCommand, getCustomTeamCommands} from 'mattermost-redux/actions/integrations';
import {getCommands} from 'mattermost-redux/selectors/entities/integrations';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from '@mattermost/types/store';
import {GenericAction, ActionFunc} from 'mattermost-redux/types/actions';
import {Command} from '@mattermost/types/integrations';
import {getCommands} from 'mattermost-redux/selectors/entities/integrations';
import type {GenericAction, ActionFunc} from 'mattermost-redux/types/actions';
import EditCommand from './edit_command';

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

@@ -1,15 +1,17 @@
// 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 {IncomingWebhook} from '@mattermost/types/integrations';
import {ActionResult} from 'mattermost-redux/types/actions';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import type {ActionResult} from 'mattermost-redux/types/actions';
import EditIncomingWebhook from 'components/integrations/edit_incoming_webhook/edit_incoming_webhook';
import {getHistory} from 'utils/browser_history';
import EditIncomingWebhook from 'components/integrations/edit_incoming_webhook/edit_incoming_webhook';
import {TestHelper} from '../../../utils/test_helper';
import {TestHelper} from 'utils/test_helper';
describe('components/integrations/EditIncomingWebhook', () => {
const hook = {

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

@@ -3,14 +3,16 @@
import React from 'react';
import {Team} from '@mattermost/types/teams';
import {IncomingWebhook} from '@mattermost/types/integrations';
import {ActionResult} from 'mattermost-redux/types/actions';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {ActionResult} from 'mattermost-redux/types/actions';
import AbstractIncomingWebhook from 'components/integrations/abstract_incoming_webhook';
import LoadingScreen from 'components/loading_screen';
import {getHistory} from 'utils/browser_history';
import {t} from 'utils/i18n';
import AbstractIncomingWebhook from 'components/integrations/abstract_incoming_webhook';
import LoadingScreen from 'components/loading_screen';
const HEADER = {id: t('integrations.edit'), defaultMessage: 'Edit'};
const FOOTER = {id: t('update_incoming_webhook.update'), defaultMessage: 'Update'};

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

@@ -2,14 +2,15 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import type {GlobalState} from '@mattermost/types/store';
import {getIncomingHook, updateIncomingHook} from 'mattermost-redux/actions/integrations';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from '@mattermost/types/store';
import {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions';
import {IncomingWebhook} from '@mattermost/types/integrations';
import type {ActionFunc, ActionResult, GenericAction} from 'mattermost-redux/types/actions';
import EditIncomingWebhook from './edit_incoming_webhook';

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

@@ -1,17 +1,16 @@
// 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 {OAuthApp} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import {getHistory} from 'utils/browser_history';
import type {OAuthApp} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import EditOAuthApp from 'components/integrations/edit_oauth_app/edit_oauth_app';
import {getHistory} from 'utils/browser_history';
describe('components/integrations/EditOAuthApp', () => {
const oauthApp: OAuthApp = {
id: 'facxd9wpzpbpfp8pad78xj75pr',

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

@@ -4,13 +4,16 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {OAuthApp} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import {ActionResult} from 'mattermost-redux/types/actions';
import type {OAuthApp} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {ActionResult} from 'mattermost-redux/types/actions';
import ConfirmModal from 'components/confirm_modal';
import LoadingScreen from 'components/loading_screen';
import {getHistory} from 'utils/browser_history';
import LoadingScreen from 'components/loading_screen';
import ConfirmModal from 'components/confirm_modal';
import AbstractOAuthApp from '../abstract_oauth_app.jsx';
const HEADER = {id: 'integrations.edit', defaultMessage: 'Edit'};

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

@@ -5,14 +5,15 @@
// 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 type {OAuthApp} from '@mattermost/types/integrations';
import type {GlobalState} from '@mattermost/types/store';
import {GlobalState} from '@mattermost/types/store';
import {getOAuthApp, editOAuthApp} from 'mattermost-redux/actions/integrations';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {ActionFunc, ActionResult} from 'mattermost-redux/types/actions';
import {OAuthApp} from '@mattermost/types/integrations';
import type {ActionFunc, ActionResult} from 'mattermost-redux/types/actions';
import EditOAuthApp from './edit_oauth_app';

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

@@ -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 {OutgoingWebhook} from '@mattermost/types/integrations';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import EditOutgoingWebhook
from 'components/integrations/edit_outgoing_webhook/edit_outgoing_webhook';

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

@@ -4,15 +4,16 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Team} from '@mattermost/types/teams';
import {OutgoingWebhook} from '@mattermost/types/integrations';
import {ServerError} from '@mattermost/types/errors';
import type {ServerError} from '@mattermost/types/errors';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import {getHistory} from 'utils/browser_history';
import ConfirmModal from 'components/confirm_modal';
import AbstractOutgoingWebhook from 'components/integrations/abstract_outgoing_webhook';
import LoadingScreen from 'components/loading_screen';
import {getHistory} from 'utils/browser_history';
const HEADER = {id: 'integrations.edit', defaultMessage: 'Edit'};
const FOOTER = {id: 'update_outgoing_webhook.update', defaultMessage: 'Update'};
const LOADING = {id: 'update_outgoing_webhook.updating', defaultMessage: 'Updating...'};

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

@@ -2,14 +2,16 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import type {ServerError} from '@mattermost/types/errors';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import type {GlobalState} from '@mattermost/types/store';
import {getOutgoingHook, updateOutgoingHook} from 'mattermost-redux/actions/integrations';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from '@mattermost/types/store';
import {ActionFunc, GenericAction} from 'mattermost-redux/types/actions';
import {OutgoingWebhook} from '@mattermost/types/integrations';
import {ServerError} from '@mattermost/types/errors';
import type {ActionFunc, GenericAction} from 'mattermost-redux/types/actions';
import EditOutgoingWebhook from './edit_outgoing_webhook';

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

@@ -5,7 +5,7 @@ import {connect} from 'react-redux';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
import Integrations from './integrations';

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

@@ -1,12 +1,12 @@
// 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 InstalledCommand from 'components/integrations/installed_command';
import {TestHelper} from '../../utils/test_helper';
import {TestHelper} from 'utils/test_helper';
describe('components/integrations/InstalledCommand', () => {
const team = TestHelper.getTeamMock({name: 'team_name'});

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

@@ -5,11 +5,11 @@ import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router-dom';
import CopyText from 'components/copy_text';
import type {Command} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile} from '@mattermost/types/users';
import {Command} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import {UserProfile} from '@mattermost/types/users';
import CopyText from 'components/copy_text';
import DeleteIntegrationLink from './delete_integration_link';

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

@@ -2,13 +2,15 @@
// 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 type {GlobalState} from '@mattermost/types/store';
import {deleteCommand, regenCommandToken} from 'mattermost-redux/actions/integrations';
import {haveITeamPermission} from 'mattermost-redux/selectors/entities/roles';
import {Permissions} from 'mattermost-redux/constants';
import {GenericAction, ActionResult, ActionFunc} from 'mattermost-redux/types/actions';
import {GlobalState} from '@mattermost/types/store';
import {haveITeamPermission} from 'mattermost-redux/selectors/entities/roles';
import type {GenericAction, ActionResult, ActionFunc} from 'mattermost-redux/types/actions';
import InstalledCommands from './installed_commands';

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

@@ -4,18 +4,21 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {ActionResult} from 'mattermost-redux/types/actions';
import * as Utils from 'utils/utils';
import type {Command} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile} from '@mattermost/types/users';
import type {RelationOneToOne} from '@mattermost/types/utilities';
import type {ActionResult} from 'mattermost-redux/types/actions';
import BackstageList from 'components/backstage/components/backstage_list';
import ExternalLink from 'components/external_link';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import {Team} from '@mattermost/types/teams';
import {UserProfile} from '@mattermost/types/users';
import {RelationOneToOne} from '@mattermost/types/utilities';
import {Command} from '@mattermost/types/integrations';
import InstalledCommand, {matchesFilter} from '../installed_command';
import ExternalLink from 'components/external_link';
import {DeveloperLinks} from 'utils/constants';
import * as Utils from 'utils/utils';
import InstalledCommand, {matchesFilter} from '../installed_command';
type Props = {
team: Team;

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

@@ -1,15 +1,15 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {shallow} from 'enzyme';
import React from 'react';
import {Link} from 'react-router-dom';
import {shallow} from 'enzyme';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import DeleteIntegrationLink from 'components/integrations/delete_integration_link';
import InstalledIncomingWebhook from 'components/integrations/installed_incoming_webhook';
import {IncomingWebhook} from '@mattermost/types/integrations';
describe('components/integrations/InstalledIncomingWebhook', () => {
const incomingWebhook: IncomingWebhook = {
id: '9w96t4nhbfdiij64wfqors4i1r',

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

@@ -5,13 +5,13 @@ import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router-dom';
import {getSiteURL} from 'utils/url';
import type {Channel} from '@mattermost/types/channels';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import CopyText from 'components/copy_text';
import {IncomingWebhook} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import {Channel} from '@mattermost/types/channels';
import {getSiteURL} from 'utils/url';
import DeleteIntegrationLink from './delete_integration_link';

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

@@ -2,19 +2,20 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import type {GlobalState} from '@mattermost/types/store';
import {removeIncomingHook} from 'mattermost-redux/actions/integrations';
import {Permissions} from 'mattermost-redux/constants';
import {getAllChannels} from 'mattermost-redux/selectors/entities/channels';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getIncomingHooks} from 'mattermost-redux/selectors/entities/integrations';
import {haveITeamPermission} from 'mattermost-redux/selectors/entities/roles';
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
import {getUsers} from 'mattermost-redux/selectors/entities/users';
import {GlobalState} from '@mattermost/types/store';
import {haveITeamPermission} from 'mattermost-redux/selectors/entities/roles';
import {Permissions} from 'mattermost-redux/constants';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {ActionResult, GenericAction} from 'mattermost-redux/types/actions';
import type {ActionResult, GenericAction} from 'mattermost-redux/types/actions';
import {loadIncomingHooksAndProfilesForTeam} from 'actions/integration_actions.jsx';

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

@@ -4,21 +4,21 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import InstalledIncomingWebhook, {matchesFilter} from 'components/integrations/installed_incoming_webhook';
import type {Channel} from '@mattermost/types/channels';
import type {IncomingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile} from '@mattermost/types/users';
import type {IDMappedObjects} from '@mattermost/types/utilities';
import {Team} from '@mattermost/types/teams';
import {Channel} from '@mattermost/types/channels';
import {IncomingWebhook} from '@mattermost/types/integrations';
import {ActionResult} from 'mattermost-redux/types/actions';
import {UserProfile} from '@mattermost/types/users';
import {IDMappedObjects} from '@mattermost/types/utilities';
import type {ActionResult} from 'mattermost-redux/types/actions';
import BackstageList from 'components/backstage/components/backstage_list';
import ExternalLink from 'components/external_link';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import InstalledIncomingWebhook, {matchesFilter} from 'components/integrations/installed_incoming_webhook';
import {Constants, DeveloperLinks} from 'utils/constants';
import * as Utils from 'utils/utils';
import ExternalLink from 'components/external_link';
type Props = {
team: Team;

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

@@ -5,11 +5,12 @@ import {connect} from 'react-redux';
import {getUser} from 'mattermost-redux/selectors/entities/users';
import {GlobalState} from 'types/store';
import {getDisplayNameByUser} from 'utils/utils';
import InstalledOAuthApp, {InstalledOAuthAppProps} from './installed_oauth_app';
import type {GlobalState} from 'types/store';
import InstalledOAuthApp from './installed_oauth_app';
import type {InstalledOAuthAppProps} from './installed_oauth_app';
function mapStateToProps(state: GlobalState, ownProps: InstalledOAuthAppProps) {
const oauthApp = ownProps.oauthApp || {};

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

@@ -1,8 +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 DeleteIntegrationLink from 'components/integrations/delete_integration_link';
import InstalledOAuthApp from 'components/integrations/installed_oauth_app/installed_oauth_app';

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

@@ -5,13 +5,14 @@ import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router-dom';
import {OAuthApp} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import type {OAuthApp} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import * as Utils from 'utils/utils';
import CopyText from 'components/copy_text';
import FormError from 'components/form_error';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import CopyText from 'components/copy_text';
import * as Utils from 'utils/utils';
import DeleteIntegrationLink from '../delete_integration_link';

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

@@ -2,19 +2,18 @@
// 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 type {GlobalState} from '@mattermost/types/store';
import {regenOAuthAppSecret, deleteOAuthApp} from 'mattermost-redux/actions/integrations';
import {getAppsOAuthAppIDs, getOAuthApps} from 'mattermost-redux/selectors/entities/integrations';
import {haveISystemPermission} from 'mattermost-redux/selectors/entities/roles';
import {Permissions} from 'mattermost-redux/constants';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {GlobalState} from '@mattermost/types/store';
import {getAppsOAuthAppIDs, getOAuthApps} from 'mattermost-redux/selectors/entities/integrations';
import {haveISystemPermission} from 'mattermost-redux/selectors/entities/roles';
import {getCurrentTeam} from 'mattermost-redux/selectors/entities/teams';
import {GenericAction} from 'mattermost-redux/types/actions';
import type {GenericAction} from 'mattermost-redux/types/actions';
import {loadOAuthAppsAndProfiles} from 'actions/integration_actions';

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

@@ -1,11 +1,11 @@
// 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 InstalledOAuthApps from 'components/integrations/installed_oauth_apps/installed_oauth_apps';
import BackstageList from 'components/backstage/components/backstage_list';
import InstalledOAuthApps from 'components/integrations/installed_oauth_apps/installed_oauth_apps';
describe('components/integrations/InstalledOAuthApps', () => {
const oauthApps = {

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

@@ -4,16 +4,17 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {OAuthApp} from '@mattermost/types/integrations';
import {localizeMessage} from 'utils/utils';
import type {OAuthApp} from '@mattermost/types/integrations';
import BackstageList from 'components/backstage/components/backstage_list';
import ExternalLink from 'components/external_link';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import {DeveloperLinks} from 'utils/constants';
import {localizeMessage} from 'utils/utils';
import InstalledOAuthApp from '../installed_oauth_app';
import {matchesFilter} from '../installed_oauth_app/installed_oauth_app';
import ExternalLink from 'components/external_link';
import {DeveloperLinks} from 'utils/constants';
type Props = {

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

@@ -1,17 +1,18 @@
// 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 {Link} from 'react-router-dom';
import {OutgoingWebhook} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import {UserProfile} from '@mattermost/types/users';
import {Channel} from '@mattermost/types/channels';
import type {Channel} from '@mattermost/types/channels';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile} from '@mattermost/types/users';
import DeleteIntegrationLink from 'components/integrations/delete_integration_link';
import InstalledOutgoingWebhook, {matchesFilter} from 'components/integrations/installed_outgoing_webhook';
import {TestHelper} from 'utils/test_helper';
describe('components/integrations/InstalledOutgoingWebhook', () => {

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

@@ -5,12 +5,12 @@ import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router-dom';
import CopyText from 'components/copy_text';
import type {Channel} from '@mattermost/types/channels';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile} from '@mattermost/types/users';
import {OutgoingWebhook} from '@mattermost/types/integrations';
import {Team} from '@mattermost/types/teams';
import {UserProfile} from '@mattermost/types/users';
import {Channel} from '@mattermost/types/channels';
import CopyText from 'components/copy_text';
import DeleteIntegrationLink from './delete_integration_link';

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

@@ -2,22 +2,24 @@
// See LICENSE.txt for license information.
import {connect} from 'react-redux';
import {ActionCreatorsMapObject, bindActionCreators, Dispatch} from 'redux';
import {bindActionCreators} from 'redux';
import type {ActionCreatorsMapObject, Dispatch} from 'redux';
import * as Actions from 'mattermost-redux/actions/integrations';
import {getOutgoingHooks} from 'mattermost-redux/selectors/entities/integrations';
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
import {getAllChannels} from 'mattermost-redux/selectors/entities/channels';
import {getUsers} from 'mattermost-redux/selectors/entities/users';
import {haveITeamPermission} from 'mattermost-redux/selectors/entities/roles';
import {Permissions} from 'mattermost-redux/constants';
import {getAllChannels} from 'mattermost-redux/selectors/entities/channels';
import {getConfig} from 'mattermost-redux/selectors/entities/general';
import {getOutgoingHooks} from 'mattermost-redux/selectors/entities/integrations';
import {haveITeamPermission} from 'mattermost-redux/selectors/entities/roles';
import {getCurrentTeamId} from 'mattermost-redux/selectors/entities/teams';
import {getUsers} from 'mattermost-redux/selectors/entities/users';
import {loadOutgoingHooksAndProfilesForTeam} from 'actions/integration_actions';
import {GlobalState} from 'types/store';
import type {GlobalState} from 'types/store';
import InstalledOutgoingWebhook, {Props} from './installed_outgoing_webhooks';
import InstalledOutgoingWebhook from './installed_outgoing_webhooks';
import type {Props} from './installed_outgoing_webhooks';
function mapStateToProps(state: GlobalState) {
const config = getConfig(state);

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

@@ -1,12 +1,15 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import React, {ComponentProps} from 'react';
import {shallow} from 'enzyme';
import React from 'react';
import type {ComponentProps} from 'react';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import InstalledOutgoingWebhooks from 'components/integrations/installed_outgoing_webhooks/installed_outgoing_webhooks';
import {TestHelper} from 'utils/test_helper';
import {OutgoingWebhook} from '@mattermost/types/integrations';
describe('components/integrations/InstalledOutgoingWebhooks', () => {
const teamId = 'testteamid';

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

@@ -4,19 +4,19 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {localizeMessage} from 'utils/utils';
import {Constants, DeveloperLinks} from 'utils/constants';
import type {Channel} from '@mattermost/types/channels';
import type {OutgoingWebhook} from '@mattermost/types/integrations';
import type {Team} from '@mattermost/types/teams';
import type {UserProfile} from '@mattermost/types/users';
import type {IDMappedObjects} from '@mattermost/types/utilities';
import BackstageList from 'components/backstage/components/backstage_list';
import InstalledOutgoingWebhook, {matchesFilter} from 'components/integrations/installed_outgoing_webhook';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import {UserProfile} from '@mattermost/types/users';
import {Team} from '@mattermost/types/teams';
import {OutgoingWebhook} from '@mattermost/types/integrations';
import {IDMappedObjects} from '@mattermost/types/utilities';
import {Channel} from '@mattermost/types/channels';
import ExternalLink from 'components/external_link';
import FormattedMarkdownMessage from 'components/formatted_markdown_message';
import InstalledOutgoingWebhook, {matchesFilter} from 'components/integrations/installed_outgoing_webhook';
import {Constants, DeveloperLinks} from 'utils/constants';
import {localizeMessage} from 'utils/utils';
export type Props = {

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

@@ -4,22 +4,20 @@
import React from 'react';
import {FormattedMessage} from 'react-intl';
import {Team} from '@mattermost/types/teams';
import type {Team} from '@mattermost/types/teams';
import {Permissions} from 'mattermost-redux/constants';
import BotAccountsIcon from 'images/bot_default_icon.png';
import ExternalLink from 'components/external_link';
import SystemPermissionGate from 'components/permissions_gates/system_permission_gate';
import TeamPermissionGate from 'components/permissions_gates/team_permission_gate';
import * as Utils from 'utils/utils';
import BotAccountsIcon from 'images/bot_default_icon.png';
import IncomingWebhookIcon from 'images/incoming_webhook.jpg';
import OAuthIcon from 'images/oauth_icon.png';
import OutgoingWebhookIcon from 'images/outgoing_webhook.jpg';
import SlashCommandIcon from 'images/slash_command_icon.jpg';
import SystemPermissionGate from 'components/permissions_gates/system_permission_gate';
import TeamPermissionGate from 'components/permissions_gates/team_permission_gate';
import ExternalLink from 'components/external_link';
import * as Utils from 'utils/utils';
import IntegrationOption from './integration_option';