mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
fix: remove admin settings (#1798)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
import { createSettingsGroup, FormFieldType, SettingsData } from '@cloudbeaver/core-settings';
|
||||
import { createSettingsGroup, SettingsData } from '@cloudbeaver/core-settings';
|
||||
|
||||
export const AUTH_SETTINGS_GROUP = createSettingsGroup('settings_authentication');
|
||||
|
||||
@@ -13,12 +13,13 @@ export const settings: SettingsData = {
|
||||
scopeType: 'core',
|
||||
scope: 'authentication',
|
||||
settingsData: [
|
||||
{
|
||||
key: 'disableAnonymousAccess',
|
||||
type: FormFieldType.Checkbox,
|
||||
name: 'settings_authentication_disable_anonymous_access_name',
|
||||
description: 'settings_authentication_disable_anonymous_access_description',
|
||||
groupId: AUTH_SETTINGS_GROUP.id,
|
||||
},
|
||||
// TODO: it's administrator settings
|
||||
// {
|
||||
// key: 'disableAnonymousAccess',
|
||||
// type: FormFieldType.Checkbox,
|
||||
// name: 'settings_authentication_disable_anonymous_access_name',
|
||||
// description: 'settings_authentication_disable_anonymous_access_description',
|
||||
// groupId: AUTH_SETTINGS_GROUP.id,
|
||||
// },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ export const settings: SettingsData = {
|
||||
type: FormFieldType.Combobox,
|
||||
name: 'settings_theming_default_theme_name',
|
||||
description: 'settings_theming_default_theme_description',
|
||||
options: themes.map(theme => ({ id: theme.id, name: theme.name })),
|
||||
options: themes.map(theme => ({ id: theme.id, name: theme.name })), // TODO: must be taken from ThemeService service, themes is default themes
|
||||
groupId: THEME_SETTINGS_GROUP.id,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
import { createSettingsGroup, FormFieldType, type SettingsData } from '@cloudbeaver/core-settings';
|
||||
import { createSettingsGroup, type SettingsData } from '@cloudbeaver/core-settings';
|
||||
|
||||
export const CONNECTIONS_SETTINGS_GROUP = createSettingsGroup('settings_connections');
|
||||
|
||||
@@ -13,12 +13,13 @@ export const settings: SettingsData = {
|
||||
scopeType: 'plugin',
|
||||
scope: 'connections',
|
||||
settingsData: [
|
||||
{
|
||||
key: 'hideConnectionViewForUsers',
|
||||
type: FormFieldType.Checkbox,
|
||||
name: 'settings_connections_hide_connections_view_name',
|
||||
description: 'settings_connections_hide_connections_view_description',
|
||||
groupId: CONNECTIONS_SETTINGS_GROUP.id,
|
||||
},
|
||||
// TODO: it's administrator settings
|
||||
// {
|
||||
// key: 'hideConnectionViewForUsers',
|
||||
// type: FormFieldType.Checkbox,
|
||||
// name: 'settings_connections_hide_connections_view_name',
|
||||
// description: 'settings_connections_hide_connections_view_description',
|
||||
// groupId: CONNECTIONS_SETTINGS_GROUP.id,
|
||||
// },
|
||||
],
|
||||
};
|
||||
|
||||
@@ -40,6 +40,10 @@ export const SettingsGroup = observer<Props>(function SettingsGroup({ group }) {
|
||||
options: settingsItem.options?.map(option => ({ ...option, name: translate(option.name) })),
|
||||
}));
|
||||
|
||||
if (settings.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return styled(BASE_CONTAINERS_STYLES)(
|
||||
<Group gap vertical>
|
||||
<GroupTitle keepSize large>
|
||||
|
||||
@@ -28,13 +28,13 @@ export const SettingsPanelForm = observer(function SettingsPanelForm() {
|
||||
const style = useStyles(BASE_CONTAINERS_STYLES, styles);
|
||||
|
||||
const settingsManagerService = useService(SettingsManagerService);
|
||||
const groups = Array.from(settingsManagerService.groups);
|
||||
const groups = Array.from(settingsManagerService.groups.values());
|
||||
|
||||
return styled(style)(
|
||||
<content>
|
||||
<ColoredContainer gap overflow parent>
|
||||
<Container medium gap vertical overflow>
|
||||
{groups.map(([_, group]) => (
|
||||
{groups.map(group => (
|
||||
<SettingsGroup key={group.id} group={group} />
|
||||
))}
|
||||
</Container>
|
||||
|
||||
Reference in New Issue
Block a user