import PropTypes from 'prop-types'; // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import React from 'react'; import {FormattedMessage} from 'react-intl'; import IntegrationOption from './integration_option.jsx'; import IncomingWebhookIcon from 'images/incoming_webhook.jpg'; import OutgoingWebhookIcon from 'images/outgoing_webhook.jpg'; import SlashCommandIcon from 'images/slash_command_icon.jpg'; import OAuthIcon from 'images/oauth_icon.png'; import * as Utils from 'utils/utils.jsx'; export default class Integrations extends React.Component { static get propTypes() { return { team: PropTypes.object, user: PropTypes.object }; } constructor(props) { super(props); this.updateTitle = this.updateTitle.bind(this); } componentDidMount() { this.updateTitle(); } updateTitle() { let currentSiteName = ''; if (global.window.mm_config.SiteName != null) { currentSiteName = global.window.mm_config.SiteName; } document.title = Utils.localizeMessage('admin.sidebar.integrations', 'Integrations') + ' - ' + this.props.team.display_name + ' ' + currentSiteName; } render() { const options = []; const config = window.mm_config; const isSystemAdmin = Utils.isSystemAdmin(this.props.user.roles); if (config.EnableIncomingWebhooks === 'true') { options.push( } description={ } link={'/' + this.props.team.name + '/integrations/incoming_webhooks'} /> ); } if (config.EnableOutgoingWebhooks === 'true') { options.push( } description={ } link={'/' + this.props.team.name + '/integrations/outgoing_webhooks'} /> ); } if (config.EnableCommands === 'true') { options.push( } description={ } link={'/' + this.props.team.name + '/integrations/commands'} /> ); } if (config.EnableOAuthServiceProvider === 'true' && (isSystemAdmin || config.EnableOnlyAdminIntegrations !== 'true')) { options.push( } description={ } link={'/' + this.props.team.name + '/integrations/oauth2-apps'} /> ); } return (

) }} />
{options}
); } }