-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'devel' into CB-5625-show-only-enabled-identity-provider…
…s-in-configuration-section
- Loading branch information
Showing
3 changed files
with
49 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...n-administration/src/Administration/Users/UsersTable/Filters/UsersTableFiltersDetails.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* CloudBeaver - Cloud Database Manager | ||
* Copyright (C) 2020-2024 DBeaver Corp and others | ||
* | ||
* Licensed under the Apache License, Version 2.0. | ||
* you may not use this file except in compliance with the License. | ||
*/ | ||
import { observer } from 'mobx-react-lite'; | ||
|
||
import { AuthRolesResource } from '@cloudbeaver/core-authentication'; | ||
import { Combobox, Group, useResource, useTranslate } from '@cloudbeaver/core-blocks'; | ||
|
||
import { type IUserFilters, USER_ROLE_ALL, USER_STATUSES } from './useUsersTableFilters.js'; | ||
|
||
interface Props { | ||
filters: IUserFilters; | ||
} | ||
|
||
export const UsersTableFiltersDetails = observer<Props>(function UsersTableFiltersDetails({ filters }) { | ||
const translate = useTranslate(); | ||
const authRolesResource = useResource(UsersTableFiltersDetails, AuthRolesResource, undefined); | ||
|
||
return ( | ||
<Group box gap> | ||
<Combobox | ||
value={filters.status} | ||
items={USER_STATUSES} | ||
valueSelector={value => translate(value.label)} | ||
keySelector={value => value.value} | ||
keepSize | ||
onSelect={filters.setStatus} | ||
> | ||
{translate('authentication_user_status')} | ||
</Combobox> | ||
{!!authRolesResource.data.length && ( | ||
<Combobox items={[...authRolesResource.data, USER_ROLE_ALL]} value={filters.role} keepSize onSelect={filters.setRole}> | ||
{translate('authentication_user_role')} | ||
</Combobox> | ||
)} | ||
</Group> | ||
); | ||
}); |