// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. var utils = require('../utils/utils.jsx'); var SettingUpload = require('./setting_upload.jsx'); module.exports = React.createClass({ displayName: 'Import Tab', getInitialState: function() { return {status: 'ready', link: ''}; }, onImportFailure: function() { this.setState({status: 'fail', link: ''}); }, onImportSuccess: function(data) { this.setState({status: 'done', link: 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(data)}); }, doImportSlack: function(file) { this.setState({status: 'in-progress', link: ''}); utils.importSlack(file, this.onImportSuccess, this.onImportFailure); }, render: function() { var uploadHelpText = (

Slack does now allow you to export any of your files or images stored in slack. Private channels and direct message channels are also not exported. Therefore, no files, images, or private channels will be imported.
Slack bot posts are not imported.
Unable to import Slack channels that are not valid Mattermost channels. (ex underscores)
); var uploadSection = ( ); var messageSection; switch (this.state.status) { case 'ready': messageSection = ''; break; case 'in-progress': messageSection = (

Importing...

); break; case 'done': messageSection = (

Import successful: View Summary

); break; case 'fail': messageSection = (

Import failure: View Summary

); break; } return (

Import

Import

{uploadSection}
{messageSection}
); } });