mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-5016 add disable import option to global config (#3058)
* CB-5016 add disable import option to global config * CB-5016 refactor: move logic from DataViewerSettingService to DataImportSettingsService * CB-5016 refactor: simplify * CB-5016 refactor: move disable import locale token to data-import-plugin * CB-5016 refactor: ru locale --------- Co-authored-by: Evgenia <139753579+EvgeniaBzzz@users.noreply.github.com> Co-authored-by: alex <48489896+devnaumov@users.noreply.github.com>
This commit is contained in:
co-authored by
Evgenia
alex
parent
a23c2c2a55
commit
cee8f00b9e
@@ -6,8 +6,9 @@
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
import { injectable } from '@cloudbeaver/core-di';
|
||||
import { SettingsProvider, SettingsProviderService } from '@cloudbeaver/core-settings';
|
||||
import { ESettingsValueType, SettingsManagerService, SettingsProvider, SettingsProviderService } from '@cloudbeaver/core-settings';
|
||||
import { schema, schemaExtra } from '@cloudbeaver/core-utils';
|
||||
import { DATA_EDITOR_SETTINGS_GROUP } from '@cloudbeaver/plugin-data-viewer';
|
||||
|
||||
const defaultSettings = schema.object({
|
||||
'plugin.data-import.disabled': schemaExtra.stringedBoolean().default(false),
|
||||
@@ -22,7 +23,23 @@ export class DataImportSettingsService {
|
||||
}
|
||||
readonly settings: SettingsProvider<typeof defaultSettings>;
|
||||
|
||||
constructor(private readonly settingsProviderService: SettingsProviderService) {
|
||||
constructor(
|
||||
private readonly settingsProviderService: SettingsProviderService,
|
||||
private readonly settingsManagerService: SettingsManagerService,
|
||||
) {
|
||||
this.settings = this.settingsProviderService.createSettings(defaultSettings);
|
||||
|
||||
this.settingsManagerService.registerSettings(this.settings, () => [
|
||||
{
|
||||
group: DATA_EDITOR_SETTINGS_GROUP,
|
||||
key: 'plugin.data-import.disabled',
|
||||
type: ESettingsValueType.Checkbox,
|
||||
name: 'plugin_data_import_disable_data_import_name',
|
||||
description: 'plugin_data_import_disable_data_import_description',
|
||||
access: {
|
||||
scope: ['server'],
|
||||
},
|
||||
},
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,6 @@ export default [
|
||||
['plugin_data_import_process_success', 'Data imported successfully'],
|
||||
['plugin_data_import_process_fail', 'Data import failed'],
|
||||
['plugin_data_import_process_file_processing_step_message', 'File uploaded, processing...'],
|
||||
['plugin_data_import_disable_data_import_name', 'Disable Import'],
|
||||
['plugin_data_import_disable_data_import_description', 'Disable importing of data in Data Viewer for non-admin users'],
|
||||
];
|
||||
|
||||
@@ -11,4 +11,6 @@ export default [
|
||||
['plugin_data_import_process_success', 'Données importées avec succès'],
|
||||
['plugin_data_import_process_fail', "Échec de l'importation des données"],
|
||||
['plugin_data_import_process_file_processing_step_message', 'Fichier téléchargé, en cours de traitement...'],
|
||||
['plugin_data_import_disable_data_import_name', 'Disable Import'],
|
||||
['plugin_data_import_disable_data_import_description', 'Disable importing of data in Data Viewer for non-admin users'],
|
||||
];
|
||||
|
||||
@@ -11,4 +11,6 @@ export default [
|
||||
['plugin_data_import_process_success', 'Data imported successfully'],
|
||||
['plugin_data_import_process_fail', 'Data import failed'],
|
||||
['plugin_data_import_process_file_processing_step_message', 'File uploaded, processing...'],
|
||||
['plugin_data_import_disable_data_import_name', 'Disable Import'],
|
||||
['plugin_data_import_disable_data_import_description', 'Disable importing of data in Data Viewer for non-admin users'],
|
||||
];
|
||||
|
||||
@@ -11,4 +11,6 @@ export default [
|
||||
['plugin_data_import_process_success', 'Данные успешно импортированы'],
|
||||
['plugin_data_import_process_fail', 'Ошибка импорта данных'],
|
||||
['plugin_data_import_process_file_processing_step_message', 'Файл загружен, обработка...'],
|
||||
['plugin_data_import_disable_data_import_name', 'Отключить импорт данных'],
|
||||
['plugin_data_import_disable_data_import_description', 'Отключить импорт данных для пользователей без прав администратора'],
|
||||
];
|
||||
|
||||
@@ -11,4 +11,6 @@ export default [
|
||||
['plugin_data_import_process_success', '数据导入成功'],
|
||||
['plugin_data_import_process_fail', '数据导入失败'],
|
||||
['plugin_data_import_process_file_processing_step_message', '文件已上传,正在处理...'],
|
||||
['plugin_data_import_disable_data_import_name', 'Disable Import'],
|
||||
['plugin_data_import_disable_data_import_description', 'Disable importing of data in Data Viewer for non-admin users'],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user