mirror of
https://github.com/etkecc/synapse-admin.git
synced 2024-11-21 15:25:22 +03:00
Add ability to toggle whether to show locked users
This is almost copy of https://github.com/Awesome-Technologies/synapse-admin/pull/573 PR, authored by @huw1990
This commit is contained in:
parent
7747dc7f28
commit
50c96cfd77
6 changed files with 8 additions and 3 deletions
2
.github/workflows/workflow.yml
vendored
2
.github/workflows/workflow.yml
vendored
|
@ -4,7 +4,7 @@ on:
|
|||
branches: [ "main" ]
|
||||
env:
|
||||
upstream_version: v0.10.3
|
||||
etke_version: etke3
|
||||
etke_version: etke4
|
||||
bunny_version: v0.1.0
|
||||
permissions:
|
||||
checks: write
|
||||
|
|
|
@ -26,6 +26,7 @@ The following changes are already implemented:
|
|||
* [Prevent admins from deleting themselves](https://github.com/etkecc/synapse-admin/pull/1)
|
||||
* [Fix user's default tab not being shown](https://github.com/etkecc/synapse-admin/pull/8)
|
||||
* [Add identifier when authorizing with password](https://github.com/Awesome-Technologies/synapse-admin/pull/601)
|
||||
* [Add ability to toggle whether to show locked users](https://github.com/Awesome-Technologies/synapse-admin/pull/573)
|
||||
|
||||
_the list will be updated as new changes are added_
|
||||
|
||||
|
|
|
@ -124,6 +124,7 @@ const en: SynapseTranslationMessages = {
|
|||
erased: "Erased",
|
||||
guests: "Show guests",
|
||||
show_deactivated: "Show deactivated users",
|
||||
show_locked: "Show locked users",
|
||||
user_id: "Search user",
|
||||
displayname: "Displayname",
|
||||
password: "Password",
|
||||
|
|
1
src/i18n/index.d.ts
vendored
1
src/i18n/index.d.ts
vendored
|
@ -120,6 +120,7 @@ interface SynapseTranslationMessages extends TranslationMessages {
|
|||
erased?: string; // TODO: fa, fr, it, zh
|
||||
guests: string;
|
||||
show_deactivated: string;
|
||||
show_locked?: string; // TODO: de, fa, fr, it, zh
|
||||
user_id: string;
|
||||
displayname: string;
|
||||
password: string;
|
||||
|
|
|
@ -98,6 +98,7 @@ const userFilters = [
|
|||
<SearchInput source="name" alwaysOn />,
|
||||
<BooleanInput source="guests" alwaysOn />,
|
||||
<BooleanInput label="resources.users.fields.show_deactivated" source="deactivated" alwaysOn />,
|
||||
<BooleanInput label="resources.users.fields.show_locked" source="locked" alwaysOn />,
|
||||
];
|
||||
|
||||
const UserPreventSelfDelete: React.FC<{ children: React.ReactNode, ownUserIsSelected: boolean }> = (props) => {
|
||||
|
@ -150,7 +151,7 @@ export const UserList = (props: ListProps) => (
|
|||
<List
|
||||
{...props}
|
||||
filters={userFilters}
|
||||
filterDefaultValues={{ guests: true, deactivated: false }}
|
||||
filterDefaultValues={{ guests: true, deactivated: false, locked: false }}
|
||||
sort={{ field: "name", order: "ASC" }}
|
||||
actions={<UserListActions />}
|
||||
pagination={<UserPagination />}
|
||||
|
|
|
@ -491,7 +491,7 @@ function getSearchOrder(order: "ASC" | "DESC") {
|
|||
const dataProvider: SynapseDataProvider = {
|
||||
getList: async (resource, params) => {
|
||||
console.log("getList " + resource);
|
||||
const { user_id, name, guests, deactivated, search_term, destination, valid } = params.filter;
|
||||
const { user_id, name, guests, deactivated, locked, search_term, destination, valid } = params.filter;
|
||||
const { page, perPage } = params.pagination;
|
||||
const { field, order } = params.sort;
|
||||
const from = (page - 1) * perPage;
|
||||
|
@ -504,6 +504,7 @@ const dataProvider: SynapseDataProvider = {
|
|||
destination: destination,
|
||||
guests: guests,
|
||||
deactivated: deactivated,
|
||||
locked: locked,
|
||||
valid: valid,
|
||||
order_by: field,
|
||||
dir: getSearchOrder(order),
|
||||
|
|
Loading…
Reference in a new issue