From c143d88ab02c3baee08af18aa3fa00c9671f866d Mon Sep 17 00:00:00 2001
From: dklimpel <5740567+dklimpel@users.noreply.github.com>
Date: Tue, 3 Aug 2021 14:25:54 +0200
Subject: [PATCH] Add `creation_ts` to list users
---
README.md | 2 +-
src/components/users.js | 78 +++++++++++++++++++++++++++++++++--------
2 files changed, 65 insertions(+), 15 deletions(-)
diff --git a/README.md b/README.md
index 69f574d..d91bcef 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
This project is built using [react-admin](https://marmelab.com/react-admin/).
-It needs at least Synapse v1.34.0 for all functions to work as expected!
+It needs at least Synapse v1.40.0 for all functions to work as expected!
You get your server version with the request `/_synapse/admin/v1/server_version`.
See also [Synapse version API](https://matrix-org.github.io/synapse/develop/admin_api/version_api.html).
diff --git a/src/components/users.js b/src/components/users.js
index de415d2..e6491b7 100644
--- a/src/components/users.js
+++ b/src/components/users.js
@@ -1,4 +1,6 @@
import React, { cloneElement, Fragment } from "react";
+import { connect } from "react-redux";
+import { Chip } from "@material-ui/core";
import Avatar from "@material-ui/core/Avatar";
import PersonPinIcon from "@material-ui/icons/PersonPin";
import ContactMailIcon from "@material-ui/icons/ContactMail";
@@ -121,17 +123,38 @@ const UserPagination = props => (
);
-const UserFilter = props => (
-
-
-
-
-
-);
+const UserFilter = props => {
+ const translate = useTranslate();
+ return (
+
+
+
+
+
+
+
+
+ );
+};
const UserBulkActionButtons = props => (
@@ -149,8 +172,13 @@ const AvatarField = ({ source, className, record = {} }) => (
);
-export const UserList = props => {
+const FilterableUserList = ({ userFilters, dispatch, ...props }) => {
const classes = useStyles();
+ const filter = userFilters;
+ const adminFilter = filter && filter.admin ? true : false;
+ const isGuestFilter = filter && filter.is_guest ? true : false;
+ const creationTimeFilter = filter && filter.creation_ts ? true : false;
+
return (
{
/>
-
-
+ {adminFilter && }
+ {isGuestFilter && }
+ {creationTimeFilter && (
+
+ )}
);
};
+function mapStateToProps(state) {
+ return {
+ userFilters: state.admin.resources.users.list.params.displayedFilters,
+ };
+}
+
+export const UserList = connect(mapStateToProps)(FilterableUserList);
// https://matrix.org/docs/spec/appendices#user-identifiers
const validateUser = regex(