From a2807fe2811e9628b5088dc57e6e93bcbaaf2e7e Mon Sep 17 00:00:00 2001 From: Michael Albert Date: Wed, 15 Apr 2020 10:32:47 +0200 Subject: [PATCH] Allow importing csv files Change-Id: I8f4c417c1762ba6dbc0fa929ecf8262e6e8a2e42 --- package.json | 3 ++- src/components/users.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 6ae07b1..4b8cbaa 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "react": "^16.13.1", "react-admin": "^3.4.0", "react-dom": "^16.13.1", - "react-scripts": "^3.4.1" + "react-scripts": "^3.4.1", + "react-admin-import-csv": "^0.2.5" }, "scripts": { "start": "react-scripts start", diff --git a/src/components/users.js b/src/components/users.js index b690377..573c6ac 100644 --- a/src/components/users.js +++ b/src/components/users.js @@ -21,10 +21,14 @@ import { TextField, TextInput, ReferenceField, + Toolbar, + TopToolbar, SelectInput, regex, Pagination, } from "react-admin"; +import { ImportButton } from "react-admin-import-csv"; +import { CreateButton, ExportButton } from "ra-ui-materialui"; const UserPagination = props => ( @@ -41,6 +45,31 @@ const UserFilter = props => ( ); +const ListActions = props => { + const { + className, + basePath, + total, + resource, + currentSort, + filterValues, + exporter + } = props; + return ( + + + + + + ); +}; + export const UserList = props => ( ( filterDefaultValues={{ guests: true, deactivated: false }} bulkActionButtons={false} pagination={} + actions={} >