const ui = {
createUserButton: byRole('button', { name: 'users.create_user' }),
- localAndManagedFilter: byRole('button', { name: 'all' }),
- managedFilter: byRole('button', { name: 'managed' }),
- localFilter: byRole('button', { name: 'local' }),
+ localAndManagedFilter: byRole('radio', { name: 'all' }),
+ managedFilter: byRole('radio', { name: 'managed' }),
+ localFilter: byRole('radio', { name: 'local' }),
showMore: byRole('button', { name: 'show_more' }),
aliceUpdateGroupButton: byRole('button', { name: 'users.update_users_groups.alice.merveille' }),
aliceUpdateButton: byRole('button', { name: 'users.manage_user.alice.merveille' }),
import * as React from 'react';
import { translate } from '../../helpers/l10n';
import { Provider } from '../../types/types';
-import ButtonToggle from './ButtonToggle';
interface ManagedFilterProps {
manageProvider: Provider | undefined;
loading: boolean;
managed: boolean | undefined;
- miui?: boolean;
setManaged: (managed: boolean | undefined) => void;
}
export function ManagedFilter(props: Readonly<ManagedFilterProps>) {
- const { manageProvider, loading, managed, miui } = props;
+ const { manageProvider, loading, managed } = props;
if (manageProvider === undefined) {
return null;
return (
<div className="sw-mr-4">
- {miui ? (
- <ToggleButton
- value={managed ?? 'all'}
- disabled={loading}
- options={[
- { label: translate('all'), value: 'all' },
- { label: translate('managed'), value: true },
- { label: translate('local'), value: false },
- ]}
- onChange={(filterOption) => {
- if (filterOption === 'all') {
- props.setManaged(undefined);
- } else {
- props.setManaged(filterOption);
- }
- }}
- />
- ) : (
- <ButtonToggle
- value={managed ?? 'all'}
- disabled={loading}
- options={[
- { label: translate('all'), value: 'all' },
- { label: translate('managed'), value: true },
- { label: translate('local'), value: false },
- ]}
- onCheck={(filterOption) => {
- if (filterOption === 'all') {
- props.setManaged(undefined);
- } else {
- props.setManaged(filterOption as boolean);
- }
- }}
- />
- )}
+ <ToggleButton
+ value={managed ?? 'all'}
+ disabled={loading}
+ options={[
+ { label: translate('all'), value: 'all' },
+ { label: translate('managed'), value: true },
+ { label: translate('local'), value: false },
+ ]}
+ onChange={(filterOption) => {
+ if (filterOption === 'all') {
+ props.setManaged(undefined);
+ } else {
+ props.setManaged(filterOption);
+ }
+ }}
+ />
</div>
);
}