// 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'); export default class TeamImportTab extends React.Component { constructor(props) { super(props); this.onImportFailure = this.onImportFailure.bind(this); this.onImportSuccess = this.onImportSuccess.bind(this); this.doImportSlack = this.doImportSlack.bind(this); this.state = { status: 'ready', link: '' }; } onImportFailure() { this.setState({status: 'fail', link: ''}); } onImportSuccess(data) { this.setState({status: 'done', link: 'data:application/octet-stream;charset=utf-8,' + encodeURIComponent(data)}); } doImportSlack(file) { this.setState({status: 'in-progress', link: ''}); utils.importSlack(file, this.onImportSuccess, this.onImportFailure); } render() { var uploadHelpText = (
Importing...
); break; case 'done': messageSection = (Import successful: View Summary
); break; case 'fail': messageSection = (Import failure: View Summary
); break; } return (