Skip to content

Commit 3085b9f

Browse files
authored
Add ability to toggle whether to show locked users (#573)
1 parent b2a3fb0 commit 3085b9f

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

src/i18n/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const en: SynapseTranslationMessages = {
124124
erased: "Erased",
125125
guests: "Show guests",
126126
show_deactivated: "Show deactivated users",
127+
show_locked: "Show locked users",
127128
user_id: "Search user",
128129
displayname: "Displayname",
129130
password: "Password",

src/i18n/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ interface SynapseTranslationMessages extends TranslationMessages {
120120
erased?: string; // TODO: fa, fr, it, zh
121121
guests: string;
122122
show_deactivated: string;
123+
show_locked?: string; // TODO: de, fa, fr, it, zh
123124
user_id: string;
124125
displayname: string;
125126
password: string;

src/resources/users.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ const userFilters = [
9191
<SearchInput source="name" alwaysOn />,
9292
<BooleanInput source="guests" alwaysOn />,
9393
<BooleanInput label="resources.users.fields.show_deactivated" source="deactivated" alwaysOn />,
94+
<BooleanInput label="resources.users.fields.show_locked" source="locked" alwaysOn />,
9495
];
9596

9697
const UserBulkActionButtons = () => (
@@ -108,7 +109,7 @@ export const UserList = (props: ListProps) => (
108109
<List
109110
{...props}
110111
filters={userFilters}
111-
filterDefaultValues={{ guests: true, deactivated: false }}
112+
filterDefaultValues={{ guests: true, deactivated: false, locked: false }}
112113
sort={{ field: "name", order: "ASC" }}
113114
actions={<UserListActions />}
114115
pagination={<UserPagination />}

src/synapse/dataProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ function getSearchOrder(order: "ASC" | "DESC") {
491491
const dataProvider: SynapseDataProvider = {
492492
getList: async (resource, params) => {
493493
console.log("getList " + resource);
494-
const { user_id, name, guests, deactivated, search_term, destination, valid } = params.filter;
494+
const { user_id, name, guests, deactivated, locked, search_term, destination, valid } = params.filter;
495495
const { page, perPage } = params.pagination;
496496
const { field, order } = params.sort;
497497
const from = (page - 1) * perPage;
@@ -504,6 +504,7 @@ const dataProvider: SynapseDataProvider = {
504504
destination: destination,
505505
guests: guests,
506506
deactivated: deactivated,
507+
locked: locked,
507508
valid: valid,
508509
order_by: field,
509510
dir: getSearchOrder(order),

0 commit comments

Comments
 (0)