diff options
author | 94117nl <rttededersixtwo@gmail.com> | 2017-08-03 15:24:30 -0500 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2017-08-03 16:24:30 -0400 |
commit | 304377c427d8db950fa436e2059e770baaf67405 (patch) | |
tree | e8373c8f020655b5d7a0eb3832e4fddecca08ad9 /webapp/components/integrations/components/commands_container.jsx | |
parent | 3174c9a07d780eb8f6e2fce8266013f393de40dd (diff) | |
download | chat-304377c427d8db950fa436e2059e770baaf67405.tar.gz chat-304377c427d8db950fa436e2059e770baaf67405.tar.bz2 chat-304377c427d8db950fa436e2059e770baaf67405.zip |
PLT-6455 Migrate installed_oauth_apps.jsx to be pure and use Redux (#7059)
* Migrate installed_oauth_apps.jsx to be pure and use Redux
* Props docs typo, add test, remove commands_container, bump yarn.lock
Diffstat (limited to 'webapp/components/integrations/components/commands_container.jsx')
-rw-r--r-- | webapp/components/integrations/components/commands_container.jsx | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/webapp/components/integrations/components/commands_container.jsx b/webapp/components/integrations/components/commands_container.jsx deleted file mode 100644 index 338d95fa0..000000000 --- a/webapp/components/integrations/components/commands_container.jsx +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import IntegrationStore from 'stores/integration_store.jsx'; -import UserStore from 'stores/user_store.jsx'; - -import {loadTeamCommands} from 'actions/integration_actions.jsx'; - -import PropTypes from 'prop-types'; - -import React from 'react'; - -export default class CommandsContainer extends React.Component { - static get propTypes() { - return { - team: PropTypes.object, - user: PropTypes.object, - children: PropTypes.node.isRequired, - isAdmin: PropTypes.bool - }; - } - - constructor(props) { - super(props); - - this.handleIntegrationChange = this.handleIntegrationChange.bind(this); - this.handleUserChange = this.handleUserChange.bind(this); - - const teamId = this.props.team ? this.props.team.id : ''; - - this.state = { - commands: IntegrationStore.getCommands(teamId) || [], - loading: !IntegrationStore.hasReceivedCommands(teamId), - users: UserStore.getProfiles() - }; - } - - componentDidMount() { - IntegrationStore.addChangeListener(this.handleIntegrationChange); - UserStore.addChangeListener(this.handleUserChange); - - if (window.mm_config.EnableCommands === 'true') { - loadTeamCommands((() => this.setState({loading: false}))); - } - } - - componentWillUnmount() { - IntegrationStore.removeChangeListener(this.handleIntegrationChange); - UserStore.removeChangeListener(this.handleUserChange); - } - - handleIntegrationChange() { - const teamId = this.props.team.id; - - this.setState({ - commands: IntegrationStore.getCommands(teamId) - }); - } - - handleUserChange() { - this.setState({users: UserStore.getProfiles()}); - } - - render() { - return ( - <div> - {React.cloneElement(this.props.children, { - commands: this.state.commands, - users: this.state.users, - loading: this.state.loading, - team: this.props.team, - user: this.props.user, - isAdmin: this.props.isAdmin - })} - </div> - ); - } -} |