Skip to content

Commit

Permalink
chore: hide extra settings from UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed Sep 18, 2024
1 parent 7e55a6d commit e2862c0
Show file tree
Hide file tree
Showing 22 changed files with 148 additions and 159 deletions.
28 changes: 13 additions & 15 deletions webapp/packages/core-connections/src/ConnectionsSettingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
* you may not use this file except in compliance with the License.
*/
import { Dependency, injectable } from '@cloudbeaver/core-di';
import { ESettingsValueType, SettingsManagerService, SettingsProvider, SettingsProviderService } from '@cloudbeaver/core-settings';
import { SettingsManagerService, SettingsProvider, SettingsProviderService } from '@cloudbeaver/core-settings';
import { schema, schemaExtra } from '@cloudbeaver/core-utils';

import { CONNECTIONS_SETTINGS_GROUP } from './CONNECTIONS_SETTINGS_GROUP';

const settingsSchema = schema.object({
'core.connections.disabled': schemaExtra.stringedBoolean().default(false),
});
Expand All @@ -34,17 +32,17 @@ export class ConnectionsSettingsService extends Dependency {
}

private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
{
group: CONNECTIONS_SETTINGS_GROUP,
key: 'core.connections.disabled',
access: {
scope: ['server'],
},
name: 'core_connections_settings_disable',
description: 'core_connections_settings_disable_description',
type: ESettingsValueType.Checkbox,
},
]);
// this.settingsManagerService.registerSettings(this.settings, () => [
// {
// group: CONNECTIONS_SETTINGS_GROUP,
// key: 'core.connections.disabled',
// access: {
// scope: ['server'],
// },
// name: 'core_connections_settings_disable',
// description: 'core_connections_settings_disable_description',
// type: ESettingsValueType.Checkbox,
// },
// ]);
}
}
23 changes: 10 additions & 13 deletions webapp/packages/core-events/src/EventsSettingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { Dependency, injectable } from '@cloudbeaver/core-di';
import {
createSettingsAliasResolver,
ESettingsValueType,
ROOT_SETTINGS_LAYER,
SettingsManagerService,
SettingsProvider,
Expand All @@ -17,8 +16,6 @@ import {
} from '@cloudbeaver/core-settings';
import { schema } from '@cloudbeaver/core-utils';

import { NOTIFICATIONS_SETTINGS_GROUP } from './NOTIFICATIONS_SETTINGS_GROUP';

const settingsSchema = schema.object({
'plugin.notifications.notificationsPool': schema.coerce.number().default(20),
'plugin.notifications.maxPersistentAllow': schema.coerce.number().default(5),
Expand Down Expand Up @@ -66,16 +63,16 @@ export class EventsSettingsService extends Dependency {
// name: 'Max persistent notifications count',
// type: ESettingsValueType.Input,
// },
{
group: NOTIFICATIONS_SETTINGS_GROUP,
key: 'plugin.notifications.notificationsPool',
access: {
scope: ['client'],
},
name: 'core_events_notifications_settings_pool_size',
description: 'core_events_notifications_settings_pool_size_description',
type: ESettingsValueType.Input,
},
// {
// group: NOTIFICATIONS_SETTINGS_GROUP,
// key: 'plugin.notifications.notificationsPool',
// access: {
// scope: ['client'],
// },
// name: 'core_events_notifications_settings_pool_size',
// description: 'core_events_notifications_settings_pool_size_description',
// type: ESettingsValueType.Input,
// },
]);
}
}
67 changes: 32 additions & 35 deletions webapp/packages/core-navigation-tree/src/NavTreeSettingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { Dependency, injectable } from '@cloudbeaver/core-di';
import {
createSettingsAliasResolver,
ESettingsValueType,
ROOT_SETTINGS_LAYER,
SettingsManagerService,
SettingsProvider,
Expand All @@ -17,8 +16,6 @@ import {
} from '@cloudbeaver/core-settings';
import { schema, schemaExtra } from '@cloudbeaver/core-utils';

import { NAVIGATION_TREE_SETTINGS_GROUP } from './NAVIGATION_TREE_SETTINGS_GROUP';

const settingsSchema = schema.object({
'core.navigation-tree.childrenLimit': schema.coerce.number().min(10).max(1000).default(100),
'core.navigation-tree.editing': schemaExtra.stringedBoolean().default(true),
Expand Down Expand Up @@ -63,37 +60,37 @@ export class NavTreeSettingsService extends Dependency {
}

private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
{
key: 'core.navigation-tree.childrenLimit',
access: {
scope: ['server'],
},
group: NAVIGATION_TREE_SETTINGS_GROUP,
name: 'core_navigation_tree_settings_children_limit',
description: 'core_navigation_tree_settings_children_limit_description',
type: ESettingsValueType.Input,
},
{
group: NAVIGATION_TREE_SETTINGS_GROUP,
key: 'core.navigation-tree.editing',
access: {
scope: ['server'],
},
name: 'core_navigation_tree_settings_editing',
description: 'core_navigation_tree_settings_editing_description',
type: ESettingsValueType.Checkbox,
},
{
group: NAVIGATION_TREE_SETTINGS_GROUP,
key: 'core.navigation-tree.deleting',
access: {
scope: ['server'],
},
name: 'core_navigation_tree_settings_deleting',
description: 'core_navigation_tree_settings_deleting_description',
type: ESettingsValueType.Checkbox,
},
]);
// this.settingsManagerService.registerSettings(this.settings, () => [
// {
// key: 'core.navigation-tree.childrenLimit',
// access: {
// scope: ['server'],
// },
// group: NAVIGATION_TREE_SETTINGS_GROUP,
// name: 'core_navigation_tree_settings_children_limit',
// description: 'core_navigation_tree_settings_children_limit_description',
// type: ESettingsValueType.Input,
// },
// {
// group: NAVIGATION_TREE_SETTINGS_GROUP,
// key: 'core.navigation-tree.editing',
// access: {
// scope: ['server'],
// },
// name: 'core_navigation_tree_settings_editing',
// description: 'core_navigation_tree_settings_editing_description',
// type: ESettingsValueType.Checkbox,
// },
// {
// group: NAVIGATION_TREE_SETTINGS_GROUP,
// key: 'core.navigation-tree.deleting',
// access: {
// scope: ['server'],
// },
// name: 'core_navigation_tree_settings_deleting',
// description: 'core_navigation_tree_settings_deleting_description',
// type: ESettingsValueType.Checkbox,
// },
// ]);
}
}
4 changes: 2 additions & 2 deletions webapp/packages/core-navigation-tree/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
export default [
['core_navigation_tree_navigation_tree_settings_group', 'Navigation Tree'],
['core_navigation_tree_settings_children_limit', 'Amount of children to load'],
['core_navigation_tree_settings_children_limit_description', 'Amount of children to load in a single request'],
['core_navigation_tree_settings_children_limit', 'Amount of nodes to load'],
['core_navigation_tree_settings_children_limit_description', 'Amount of nodes to load in a single request'],
['core_navigation_tree_settings_editing', 'Editing'],
['core_navigation_tree_settings_editing_description', 'Allow editing nodes such as renaming'],
['core_navigation_tree_settings_deleting', 'Deleting'],
Expand Down
4 changes: 2 additions & 2 deletions webapp/packages/core-navigation-tree/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
export default [
['core_navigation_tree_navigation_tree_settings_group', 'Arborescence de navigation'],
['core_navigation_tree_settings_children_limit', 'Amount of children to load'],
['core_navigation_tree_settings_children_limit_description', 'Amount of children to load in a single request'],
['core_navigation_tree_settings_children_limit', 'Amount of nodes to load'],
['core_navigation_tree_settings_children_limit_description', 'Amount of nodes to load in a single request'],
['core_navigation_tree_settings_editing', 'Editing'],
['core_navigation_tree_settings_editing_description', 'Allow editing nodes such as renaming'],
['core_navigation_tree_settings_deleting', 'Deleting'],
Expand Down
4 changes: 2 additions & 2 deletions webapp/packages/core-navigation-tree/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
export default [
['core_navigation_tree_navigation_tree_settings_group', 'Navigation Tree'],
['core_navigation_tree_settings_children_limit', 'Amount of children to load'],
['core_navigation_tree_settings_children_limit_description', 'Amount of children to load in a single request'],
['core_navigation_tree_settings_children_limit', 'Amount of nodes to load'],
['core_navigation_tree_settings_children_limit_description', 'Amount of nodes to load in a single request'],
['core_navigation_tree_settings_editing', 'Editing'],
['core_navigation_tree_settings_editing_description', 'Allow editing nodes such as renaming'],
['core_navigation_tree_settings_deleting', 'Deleting'],
Expand Down
4 changes: 2 additions & 2 deletions webapp/packages/core-navigation-tree/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
export default [
['core_navigation_tree_navigation_tree_settings_group', '导航树'],
['core_navigation_tree_settings_children_limit', 'Amount of children to load'],
['core_navigation_tree_settings_children_limit_description', 'Amount of children to load in a single request'],
['core_navigation_tree_settings_children_limit', 'Amount of nodes to load'],
['core_navigation_tree_settings_children_limit_description', 'Amount of nodes to load in a single request'],
['core_navigation_tree_settings_editing', 'Editing'],
['core_navigation_tree_settings_editing_description', 'Allow editing nodes such as renaming'],
['core_navigation_tree_settings_deleting', 'Deleting'],
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/plugin-connection-search/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/
export default [
['plugin_connection_search_action_search_label', 'Find Local Database'],
['plugin_connection_search_settings_disable', 'Disable connections search'],
['plugin_connection_search_settings_disable', 'Disable "{alias:plugin_connection_search_action_search_label}"'],
['plugin_connection_search_settings_disable_description', 'Disable the ability to search connections on a specific address'],
];
2 changes: 1 addition & 1 deletion webapp/packages/plugin-connection-search/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/
export default [
['plugin_connection_search_action_search_label', 'Trouver une base de données locale'],
['plugin_connection_search_settings_disable', 'Disable connections search'],
['plugin_connection_search_settings_disable', 'Disable "{alias:plugin_connection_search_action_search_label}"'],
['plugin_connection_search_settings_disable_description', 'Disable the ability to search connections on a specific address'],
];
2 changes: 1 addition & 1 deletion webapp/packages/plugin-connection-search/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/
export default [
['plugin_connection_search_action_search_label', 'Find Local Database'],
['plugin_connection_search_settings_disable', 'Disable connections search'],
['plugin_connection_search_settings_disable', 'Disable "{alias:plugin_connection_search_action_search_label}"'],
['plugin_connection_search_settings_disable_description', 'Disable the ability to search connections on a specific address'],
];
2 changes: 1 addition & 1 deletion webapp/packages/plugin-connection-search/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/
export default [
['plugin_connection_search_action_search_label', '查找本地数据库'],
['plugin_connection_search_settings_disable', 'Disable connections search'],
['plugin_connection_search_settings_disable', 'Disable "{alias:plugin_connection_search_action_search_label}"'],
['plugin_connection_search_settings_disable_description', 'Disable the ability to search connections on a specific address'],
];
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { CONNECTIONS_SETTINGS_GROUP } from '@cloudbeaver/core-connections';
import { Dependency, injectable } from '@cloudbeaver/core-di';
import { ESettingsValueType, SettingsManagerService, SettingsProvider, SettingsProviderService } from '@cloudbeaver/core-settings';
import { SettingsManagerService, SettingsProvider, SettingsProviderService } from '@cloudbeaver/core-settings';
import { schema, schemaExtra } from '@cloudbeaver/core-utils';

const defaultSettings = schema.object({
Expand All @@ -34,17 +33,18 @@ export class PluginConnectionsSettingsService extends Dependency {
}

private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
{
key: 'plugin.connections.hideConnectionViewForUsers',
type: ESettingsValueType.Checkbox,
access: {
scope: ['server'],
},
name: 'settings_connections_hide_connections_view_name',
description: 'settings_connections_hide_connections_view_description',
group: CONNECTIONS_SETTINGS_GROUP,
},
]);
// todo: probably not working as a separate setting
// this.settingsManagerService.registerSettings(this.settings, () => [
// {
// key: 'plugin.connections.hideConnectionViewForUsers',
// type: ESettingsValueType.Checkbox,
// access: {
// scope: ['server'],
// },
// name: 'settings_connections_hide_connections_view_name',
// description: 'settings_connections_hide_connections_view_description',
// group: CONNECTIONS_SETTINGS_GROUP,
// },
// ]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,26 @@ export class LogViewerSettingsService extends Dependency {

private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
{
group: LOG_VIEWER_SETTINGS_GROUP,
key: 'plugin.log-viewer.maxLogRecords',
access: {
scope: ['client'],
},
type: ESettingsValueType.Input,
name: 'plugin_log_viewer_settings_max_log_records',
description: 'plugin_log_viewer_settings_max_log_records_description',
},
{
group: LOG_VIEWER_SETTINGS_GROUP,
key: 'plugin.log-viewer.logBatchSize',
access: {
scope: ['client'],
},
type: ESettingsValueType.Input,
name: 'plugin_log_viewer_settings_log_batch_size',
description: 'plugin_log_viewer_settings_log_batch_size_description',
},
// {
// group: LOG_VIEWER_SETTINGS_GROUP,
// key: 'plugin.log-viewer.maxLogRecords',
// access: {
// scope: ['client'],
// },
// type: ESettingsValueType.Input,
// name: 'plugin_log_viewer_settings_max_log_records',
// description: 'plugin_log_viewer_settings_max_log_records_description',
// },
// {
// group: LOG_VIEWER_SETTINGS_GROUP,
// key: 'plugin.log-viewer.logBatchSize',
// access: {
// scope: ['client'],
// },
// type: ESettingsValueType.Input,
// name: 'plugin_log_viewer_settings_log_batch_size',
// description: 'plugin_log_viewer_settings_log_batch_size_description',
// },
{
key: 'plugin.log-viewer.disabled',
access: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export class NavigationTreeSettingsService extends Dependency {

private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
{
group: NAVIGATION_TREE_SETTINGS_GROUP,
key: 'plugin.navigation-tree.disabled',
access: {
scope: ['server'],
},
type: ESettingsValueType.Checkbox,
name: 'plugin_navigation_tree_settings_disable',
description: 'plugin_navigation_tree_settings_disable_description',
},
// {
// group: NAVIGATION_TREE_SETTINGS_GROUP,
// key: 'plugin.navigation-tree.disabled',
// access: {
// scope: ['server'],
// },
// type: ESettingsValueType.Checkbox,
// name: 'plugin_navigation_tree_settings_disable',
// description: 'plugin_navigation_tree_settings_disable_description',
// },
]);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ export class ResourceManagerScriptsSettingsService extends Dependency {

private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
{
group: RESOURCE_MANAGER_SETTINGS_GROUP,
key: 'plugin.resource-manager-scripts.disabled',
access: {
scope: ['server'],
},
type: ESettingsValueType.Checkbox,
name: 'plugin_resource_manager_scripts_disable',
description: 'plugin_resource_manager_scripts_disable_description',
},
// {
// group: RESOURCE_MANAGER_SETTINGS_GROUP,
// key: 'plugin.resource-manager-scripts.disabled',
// access: {
// scope: ['server'],
// },
// type: ESettingsValueType.Checkbox,
// name: 'plugin_resource_manager_scripts_disable',
// description: 'plugin_resource_manager_scripts_disable_description',
// },
]);
}
}
Loading

0 comments on commit e2862c0

Please sign in to comment.