mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-12 10:33:49 +00:00
Created SortableBarGraph test
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { UncontrolledTooltip } from 'reactstrap';
|
||||
import { assoc } from 'ramda';
|
||||
import { assoc, map } from 'ramda';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
@@ -22,11 +22,16 @@ const ImportServersBtn = (serversImporter) => class ImportServersBtn extends Rea
|
||||
render() {
|
||||
const { importServersFromFile } = serversImporter;
|
||||
const { onImport, createServers } = this.props;
|
||||
const onChange = (e) =>
|
||||
importServersFromFile(e.target.files[0])
|
||||
.then((servers) => servers.map((server) => assoc('id', uuid(), server)))
|
||||
const assocId = (server) => assoc('id', uuid(), server);
|
||||
const onChange = ({ target }) =>
|
||||
importServersFromFile(target.files[0])
|
||||
.then(map(assocId))
|
||||
.then(createServers)
|
||||
.then(onImport);
|
||||
.then(onImport)
|
||||
.then(() => {
|
||||
// Reset input after processing file
|
||||
target.value = null;
|
||||
});
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
|
||||
Reference in New Issue
Block a user