Skip to content

Commit

Permalink
CB-4541 feat: tree filter (#2908)
Browse files Browse the repository at this point in the history
* CB-4541 feat: tree filter

* CB-4541 feat: tree empty placeholders

* CB-4541 fix: settings overflow scroll effect

* CB-4541 fix: settings groups size

* CB-4541 fix: sync groups when filtering

* CB-4541 chore: performance optimization

* chore: review fixes

* chore: replace inline styles

* chore: replace inline styles

* chore: hide extra settings from UI

* chore: hide groups view from settings

* fix: add override options to devtools

* fix: trim filter in settings search

* chore: localization

---------

Co-authored-by: Evgenia Bezborodova <[email protected]>
Co-authored-by: kseniaguzeeva <[email protected]>
Co-authored-by: mr-anton-t <[email protected]>
  • Loading branch information
4 people authored Sep 25, 2024
1 parent 5f53e0f commit 8f54e75
Show file tree
Hide file tree
Showing 130 changed files with 1,028 additions and 306 deletions.
2 changes: 0 additions & 2 deletions config/sample-databases/DefaultConfiguration/cloudbeaver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
plugin.sql-editor.maxFileSize: 10240,
plugin.log-viewer.disabled: false,
plugin.log-viewer.logBatchSize: 1000,
plugin.log-viewer.maxFailedRequests: 3,
plugin.log-viewer.maxLogRecords: 2000,
plugin.log-viewer.refreshTimeout: 3000,
sql.proposals.insert.table.alias: PLAIN
},

Expand Down
2 changes: 0 additions & 2 deletions config/sample-databases/SQLiteConfiguration/cloudbeaver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
plugin.sql-editor.maxFileSize: 10240,
plugin.log-viewer.disabled: false,
plugin.log-viewer.logBatchSize: 1000,
plugin.log-viewer.maxFailedRequests: 3,
plugin.log-viewer.maxLogRecords: 2000,
plugin.log-viewer.refreshTimeout: 3000,
sql.proposals.insert.table.alias: PLAIN
},

Expand Down
12 changes: 11 additions & 1 deletion webapp/packages/core-app/src/Body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ export const Body = observer(function Body() {
return (
<DNDProvider>
<Loader className={s(styles, { loader: true })} suspense>
<div ref={ref} className={s(styles, { bodyContent: true }, `theme-${themeService.currentTheme.id}`)}>
<div
ref={ref}
className={s(
styles,
{ bodyContent: true },
`theme-${themeService.currentTheme.id}`,
'theme-typography--body2',
'theme-background-surface',
'theme-text-on-surface',
)}
>
<Loader className={s(styles, { loader: true })} suspense>
{Screen && <Screen {...screenService.routerService.params} />}
</Loader>
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@cloudbeaver/core-settings": "^0",
"@cloudbeaver/tests-runner": "^0",
"@jest/globals": "^29",
"@testing-library/jest-dom": "^6",
"@types/jest": "^29",
"msw": "^2",
"typescript": "^5"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export class AuthSettingsService {
private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
// {
// key: 'disableAnonymousAccess',
// key: 'core.authentication.disableAnonymousAccess',
// access: {
// scope: ['server'],
// },
// type: ESettingsValueType.Checkbox,
// name: 'settings_authentication_disable_anonymous_access_name',
// description: 'settings_authentication_disable_anonymous_access_description',
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
"@cloudbeaver/core-utils": "^0",
"@cloudbeaver/tests-runner": "^0",
"@jest/globals": "^29",
"@testing-library/jest-dom": "^6",
"@testing-library/react": "^16",
"@types/jest": "^29",
"@types/react": "^18",
"mobx": "^6",
"react": "^18",
Expand Down
4 changes: 2 additions & 2 deletions webapp/packages/core-blocks/src/localization/useTranslate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* you may not use this file except in compliance with the License.
*/
import { useService } from '@cloudbeaver/core-di';
import { LocalizationService, type TLocalizationToken } from '@cloudbeaver/core-localization';
import { LocalizationService, type TranslateFn } from '@cloudbeaver/core-localization';

export function useTranslate(): <T extends TLocalizationToken | undefined>(token: T, fallback?: T, args?: Record<string | number, any>) => T {
export function useTranslate(): TranslateFn {
const localizationService = useService(LocalizationService);

return localizationService.translate;
Expand Down
2 changes: 1 addition & 1 deletion webapp/packages/core-browser-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@cloudbeaver/core-settings": "^0",
"@cloudbeaver/tests-runner": "^0",
"@jest/globals": "^29",
"@testing-library/jest-dom": "^6",
"@types/jest": "^29",
"typescript": "^5"
}
}
20 changes: 12 additions & 8 deletions webapp/packages/core-connections/src/ConnectionsSettingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@ export class ConnectionsSettingsService extends Dependency {
}

private registerSettings() {
this.settingsManagerService.registerSettings(this.settings, () => [
// {
// group: CONNECTIONS_SETTINGS_GROUP,
// key: 'disabled',
// name: 'Disable',
// 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,
// },
// ]);
}
}
3 changes: 3 additions & 0 deletions webapp/packages/core-connections/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,7 @@ export default [
['connections_network_handler_ssh_tunnel_advanced_settings', 'Erweiterte Einstellungen'],
['connections_not_found', 'Es wurden keine Datenbankverbindungen gefunden'],
['connections_connection_autocommit', 'Auto commit'],

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
];
3 changes: 3 additions & 0 deletions webapp/packages/core-connections/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,7 @@ export default [
'cloud_connections_access_placeholder',
'Cloud connections are visible to all users. Access management can be configured in "AWS Management Console".',
],

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
];
3 changes: 3 additions & 0 deletions webapp/packages/core-connections/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,7 @@ export default [
'cloud_connections_access_placeholder',
'Les connexions cloud sont visibles par tous les utilisateurs. La gestion des accès peut être configurée dans la "AWS Management Console".',
],

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
];
3 changes: 3 additions & 0 deletions webapp/packages/core-connections/src/locales/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,7 @@ export default [
'cloud_connections_access_placeholder',
'Connessioni Cloud sono visibili a tutti gli utenti. Il gestore degli accessi può essere configurato in "AWS Management Console".',
],

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
];
3 changes: 3 additions & 0 deletions webapp/packages/core-connections/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,7 @@ export default [
['connections_not_found', 'Подключения к базам данных не найдены'],

['cloud_connections_access_placeholder', 'Облачные подключения видны всем пользователям. Вы можете настроить доступ в "Консоль Управления AWS".'],

['core_connections_settings_disable', 'Отключить'],
['core_connections_settings_disable_description', 'Отключить возможность создания новых подключений'],
];
3 changes: 3 additions & 0 deletions webapp/packages/core-connections/src/locales/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,7 @@ export default [
['connections_not_found', '未找到数据库连接'],

['cloud_connections_access_placeholder', '云连接对所有用户可见。可以在“AWS管理控制台”中配置访问管理。'],

['core_connections_settings_disable', 'Disable'],
['core_connections_settings_disable_description', 'Disable the ability to create new connections'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-di/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"peerDependencies": {},
"devDependencies": {
"@jest/globals": "^29",
"@types/jest": "^29",
"@types/react": "^18",
"typescript": "^5"
}
Expand Down
3 changes: 2 additions & 1 deletion webapp/packages/core-events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"dependencies": {
"@cloudbeaver/core-di": "^0",
"@cloudbeaver/core-executor": "^0",
"@cloudbeaver/core-localization": "^0",
"@cloudbeaver/core-sdk": "^0",
"@cloudbeaver/core-settings": "^0",
"@cloudbeaver/core-utils": "^0",
Expand All @@ -35,7 +36,7 @@
"@cloudbeaver/core-settings": "^0",
"@cloudbeaver/tests-runner": "^0",
"@jest/globals": "^29",
"@testing-library/jest-dom": "^6",
"@types/jest": "^29",
"typescript": "^5"
}
}
13 changes: 10 additions & 3 deletions webapp/packages/core-events/src/EventsSettingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,21 @@ export class EventsSettingsService extends Dependency {
this.settingsManagerService.registerSettings(this.settings, () => [
// {
// group: NOTIFICATIONS_SETTINGS_GROUP,
// key: 'maxPersistentAllow',
// key: 'plugin.notifications.maxPersistentAllow',
// access: {
// scope: ['client'],
// },
// name: 'Max persistent notifications count',
// type: ESettingsValueType.Input,
// },
// {
// group: NOTIFICATIONS_SETTINGS_GROUP,
// key: 'notificationsPool',
// name: 'Max notifications count',
// 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,
// },
]);
Expand Down
35 changes: 35 additions & 0 deletions webapp/packages/core-events/src/LocaleService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* 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 { Bootstrap, injectable } from '@cloudbeaver/core-di';
import { LocalizationService } from '@cloudbeaver/core-localization';

@injectable()
export class LocaleService extends Bootstrap {
constructor(private readonly localizationService: LocalizationService) {
super();
}

override register(): void {
this.localizationService.addProvider(this.provider.bind(this));
}

private async provider(locale: string) {
switch (locale) {
case 'ru':
return (await import('./locales/ru.js')).default;
case 'it':
return (await import('./locales/it.js')).default;
case 'zh':
return (await import('./locales/zh.js')).default;
case 'fr':
return (await import('./locales/fr.js')).default;
default:
return (await import('./locales/en.js')).default;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { ROOT_SETTINGS_GROUP } from '@cloudbeaver/core-settings';
import { INTERFACE_SETTINGS_GROUP } from '@cloudbeaver/core-settings';

export const NOTIFICATIONS_SETTINGS_GROUP = ROOT_SETTINGS_GROUP.createSubGroup('core_events_notifications_settings_group');
export const NOTIFICATIONS_SETTINGS_GROUP = INTERFACE_SETTINGS_GROUP.createSubGroup('core_events_notifications_settings_group');
12 changes: 12 additions & 0 deletions webapp/packages/core-events/src/locales/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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.
*/
export default [
['core_events_notifications_settings_group', 'Notifications'],
['core_events_notifications_settings_pool_size', 'Max notifications count'],
['core_events_notifications_settings_pool_size_description', 'Exceeding this amount, the oldest notifications will be deleted'],
];
12 changes: 12 additions & 0 deletions webapp/packages/core-events/src/locales/fr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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.
*/
export default [
['core_events_notifications_settings_group', 'Notifications'],
['core_events_notifications_settings_pool_size', 'Max notifications count'],
['core_events_notifications_settings_pool_size_description', 'Exceeding this amount, the oldest notifications will be deleted'],
];
12 changes: 12 additions & 0 deletions webapp/packages/core-events/src/locales/it.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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.
*/
export default [
['core_events_notifications_settings_group', 'Notifications'],
['core_events_notifications_settings_pool_size', 'Max notifications count'],
['core_events_notifications_settings_pool_size_description', 'Exceeding this amount, the oldest notifications will be deleted'],
];
12 changes: 12 additions & 0 deletions webapp/packages/core-events/src/locales/ru.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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.
*/
export default [
['core_events_notifications_settings_group', 'Уведомления'],
['core_events_notifications_settings_pool_size', 'Максимальное количество уведомлений'],
['core_events_notifications_settings_pool_size_description', 'Превышение этого количества приведет к удалению самых старых уведомлений'],
];
12 changes: 12 additions & 0 deletions webapp/packages/core-events/src/locales/zh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* 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.
*/
export default [
['core_events_notifications_settings_group', 'Notifications'],
['core_events_notifications_settings_pool_size', 'Max notifications count'],
['core_events_notifications_settings_pool_size_description', 'Exceeding this amount, the oldest notifications will be deleted'],
];
1 change: 1 addition & 0 deletions webapp/packages/core-events/src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export const coreEventsManifest: PluginManifest = {
() => import('./NotificationService.js').then(m => m.NotificationService),
() => import('./ExceptionsCatcherService.js').then(m => m.ExceptionsCatcherService),
() => import('./EventsSettingsService.js').then(m => m.EventsSettingsService),
() => import('./LocaleService.js').then(m => m.LocaleService),
],
};
3 changes: 3 additions & 0 deletions webapp/packages/core-events/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
{
"path": "../core-localization/tsconfig.json"
},
{
"path": "../core-localization/tsconfig.json"
},
{
"path": "../core-root/tsconfig.json"
},
Expand Down
10 changes: 10 additions & 0 deletions webapp/packages/core-localization/src/TranslateFn.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* 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 type { TLocalizationToken } from './TLocalizationToken.js';

export type TranslateFn = <T extends TLocalizationToken | undefined>(token: T, fallback?: T, args?: Record<string | number, any>) => T;
1 change: 1 addition & 0 deletions webapp/packages/core-localization/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ export * from './LocalizationService.js';
export * from './Locale.js';
export * from './TLocalizationToken.js';
export * from './DEFAULT_LOCALE.js';
export * from './TranslateFn.js';
2 changes: 1 addition & 1 deletion webapp/packages/core-navigation-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@cloudbeaver/core-view": "^0",
"@cloudbeaver/tests-runner": "^0",
"@jest/globals": "^29",
"@testing-library/jest-dom": "^6",
"@types/jest": "^29",
"typescript": "^5"
}
}
Loading

0 comments on commit 8f54e75

Please sign in to comment.