summaryrefslogtreecommitdiffstats
path: root/web/react/components/delete_channel_modal.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-03-14 08:50:46 -0400
committerChristopher Speller <crspeller@gmail.com>2016-03-16 18:02:55 -0400
commit12896bd23eeba79884245c1c29fdc568cf21a7fa (patch)
tree4e7f83d3e2564b9b89d669e9f7905ff11768b11a /web/react/components/delete_channel_modal.jsx
parent29fe6a3d13c9c7aa490fffebbe5d1b5fdf1e3090 (diff)
downloadchat-12896bd23eeba79884245c1c29fdc568cf21a7fa.tar.gz
chat-12896bd23eeba79884245c1c29fdc568cf21a7fa.tar.bz2
chat-12896bd23eeba79884245c1c29fdc568cf21a7fa.zip
Converting to Webpack. Stage 1.
Diffstat (limited to 'web/react/components/delete_channel_modal.jsx')
-rw-r--r--web/react/components/delete_channel_modal.jsx109
1 files changed, 0 insertions, 109 deletions
diff --git a/web/react/components/delete_channel_modal.jsx b/web/react/components/delete_channel_modal.jsx
deleted file mode 100644
index 70e7a67a8..000000000
--- a/web/react/components/delete_channel_modal.jsx
+++ /dev/null
@@ -1,109 +0,0 @@
-// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import * as AsyncClient from '../utils/async_client.jsx';
-import * as Client from '../utils/client.jsx';
-const Modal = ReactBootstrap.Modal;
-import TeamStore from '../stores/team_store.jsx';
-import Constants from '../utils/constants.jsx';
-
-import {FormattedMessage} from 'mm-intl';
-
-import {browserHistory} from 'react-router';
-
-export default class DeleteChannelModal extends React.Component {
- constructor(props) {
- super(props);
-
- this.handleDelete = this.handleDelete.bind(this);
- }
-
- handleDelete() {
- if (this.props.channel.id.length !== 26) {
- return;
- }
-
- browserHistory.push(TeamStore.getCurrentTeamUrl() + '/channels/town-square');
- Client.deleteChannel(
- this.props.channel.id,
- () => {
- AsyncClient.getChannels(true);
- },
- (err) => {
- AsyncClient.dispatchError(err, 'handleDelete');
- }
- );
- }
-
- render() {
- let channelTerm = (
- <FormattedMessage
- id='delete_channel.channel'
- defaultMessage='channel'
- />
- );
- if (this.props.channel.type === Constants.PRIVATE_CHANNEL) {
- channelTerm = (
- <FormattedMessage
- id='delete_channel.group'
- defaultMessage='group'
- />
- );
- }
-
- return (
- <Modal
- show={this.props.show}
- onHide={this.props.onHide}
- >
- <Modal.Header closeButton={true}>
- <h4 className='modal-title'>
- <FormattedMessage
- id='delete_channel.confirm'
- defaultMessage='Confirm DELETE Channel'
- />
- </h4>
- </Modal.Header>
- <Modal.Body>
- <FormattedMessage
- id='delete_channel.question'
- defaultMessage='Are you sure you wish to delete the {display_name} {term}?'
- values={{
- display_name: this.props.channel.display_name,
- term: (channelTerm)
- }}
- />
- </Modal.Body>
- <Modal.Footer>
- <button
- type='button'
- className='btn btn-default'
- onClick={this.props.onHide}
- >
- <FormattedMessage
- id='delete_channel.cancel'
- defaultMessage='Cancel'
- />
- </button>
- <button
- type='button'
- className='btn btn-danger'
- data-dismiss='modal'
- onClick={this.handleDelete}
- >
- <FormattedMessage
- id='delete_channel.del'
- defaultMessage='Delete'
- />
- </button>
- </Modal.Footer>
- </Modal>
- );
- }
-}
-
-DeleteChannelModal.propTypes = {
- show: React.PropTypes.bool.isRequired,
- onHide: React.PropTypes.func.isRequired,
- channel: React.PropTypes.object.isRequired
-};