2017-03-03 20:09:08 +00:00
|
|
|
import React, {PureComponent, PropTypes} from 'react';
|
|
|
|
import autobind from 'autobind-decorator';
|
2016-11-16 17:18:39 +00:00
|
|
|
import {Dropdown, DropdownButton, DropdownItem, DropdownDivider} from '../base/dropdown';
|
2017-03-08 05:52:17 +00:00
|
|
|
import Link from '../base/link';
|
2016-11-07 20:24:38 +00:00
|
|
|
|
2017-03-03 20:09:08 +00:00
|
|
|
@autobind
|
2017-03-08 05:52:17 +00:00
|
|
|
class ImportExport extends PureComponent {
|
2017-03-03 20:09:08 +00:00
|
|
|
render () {
|
|
|
|
const {
|
|
|
|
handleImport,
|
|
|
|
handleExportAll,
|
|
|
|
handleExportWorkspace
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
2017-04-04 23:38:17 +00:00
|
|
|
<p className="no-margin-top">
|
2017-03-03 20:09:08 +00:00
|
|
|
Import format will be automatically detected (<strong>Insomnia, Postman v2, HAR, Curl</strong>)
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
Don't see your format here?
|
|
|
|
{' '}
|
|
|
|
<Link href="https://insomnia.rest/documentation/import-export">Add Your Own</Link>.
|
|
|
|
</p>
|
|
|
|
<div className="pad-top">
|
|
|
|
<Dropdown outline>
|
|
|
|
<DropdownButton className="btn btn--clicky">
|
|
|
|
Export Data <i className="fa fa-caret-down"></i>
|
|
|
|
</DropdownButton>
|
|
|
|
<DropdownDivider>Choose Export Type</DropdownDivider>
|
|
|
|
<DropdownItem onClick={handleExportWorkspace}>
|
|
|
|
<i className="fa fa-home"></i>
|
|
|
|
Current Workspace
|
|
|
|
</DropdownItem>
|
|
|
|
<DropdownItem onClick={handleExportAll}>
|
|
|
|
<i className="fa fa-empty"></i>
|
|
|
|
All Workspaces
|
|
|
|
</DropdownItem>
|
|
|
|
</Dropdown>
|
|
|
|
|
|
|
|
<button className="btn btn--clicky" onClick={handleImport}>
|
|
|
|
Import Data
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<p className="italic faint">
|
|
|
|
* Tip: You can also paste Curl commands into the URL bar
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2016-11-07 20:24:38 +00:00
|
|
|
|
2017-03-08 05:52:17 +00:00
|
|
|
ImportExport.propTypes = {
|
2016-11-16 17:18:39 +00:00
|
|
|
handleImport: PropTypes.func.isRequired,
|
|
|
|
handleExportAll: PropTypes.func.isRequired,
|
2017-03-03 20:09:08 +00:00
|
|
|
handleExportWorkspace: PropTypes.func.isRequired
|
2016-11-07 20:24:38 +00:00
|
|
|
};
|
|
|
|
|
2017-03-08 05:52:17 +00:00
|
|
|
export default ImportExport;
|