diff --git a/webapp/packages/plugin-connection-custom/tsconfig.json b/webapp/packages/plugin-connection-custom/tsconfig.json index 17198e218a..40f7b423e5 100644 --- a/webapp/packages/plugin-connection-custom/tsconfig.json +++ b/webapp/packages/plugin-connection-custom/tsconfig.json @@ -12,6 +12,9 @@ { "path": "../core-connections/tsconfig.json" }, + { + "path": "../core-data-context/tsconfig.json" + }, { "path": "../core-di/tsconfig.json" }, diff --git a/webapp/packages/plugin-help/package.json b/webapp/packages/plugin-help/package.json index 4fda9cd56a..d06e0c571f 100644 --- a/webapp/packages/plugin-help/package.json +++ b/webapp/packages/plugin-help/package.json @@ -32,6 +32,7 @@ "@cloudbeaver/plugin-data-spreadsheet-new": "^0", "@cloudbeaver/plugin-navigation-tree": "^0", "@cloudbeaver/plugin-sql-editor": "^0", + "@cloudbeaver/plugin-sql-editor-navigation-tab-script": "^0", "@cloudbeaver/plugin-top-app-bar": "^0", "react": "^18" }, diff --git a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts index c91b611c88..e46d4dab8a 100644 --- a/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts +++ b/webapp/packages/plugin-help/src/Shortcuts/SHORTCUTS_DATA.ts @@ -21,6 +21,7 @@ import { KEY_BINDING_SQL_EDITOR_FORMAT, KEY_BINDING_SQL_EDITOR_SHOW_EXECUTION_PLAN, } from '@cloudbeaver/plugin-sql-editor'; +import { KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT } from '@cloudbeaver/plugin-sql-editor-navigation-tab-script'; import type { IShortcut } from './IShortcut.js'; @@ -64,6 +65,10 @@ export const SQL_EDITOR_SHORTCUTS: IShortcut[] = [ label: 'sql_editor_shortcut_format', code: transformKeys(KEY_BINDING_SQL_EDITOR_FORMAT), }, + { + label: 'sql_editor_shortcut_save_as_script', + code: transformKeys(KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT), + }, { label: 'sql_editor_shortcut_undo', code: transformKeys(KEY_BINDING_UNDO), diff --git a/webapp/packages/plugin-help/src/locales/en.ts b/webapp/packages/plugin-help/src/locales/en.ts index 8ccebf6fcc..76d25f678f 100644 --- a/webapp/packages/plugin-help/src/locales/en.ts +++ b/webapp/packages/plugin-help/src/locales/en.ts @@ -1,3 +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. + */ export default [ ['shortcuts_title', 'Shortcuts'], @@ -14,6 +21,7 @@ export default [ ['sql_editor_shortcut_execute_script', 'Execute script'], ['sql_editor_shortcut_show_execution_plan', 'Show Execution plan'], ['sql_editor_shortcut_format', 'Format script'], + ['sql_editor_shortcut_save_as_script', 'Save as script'], ['sql_editor_shortcut_open_editor_in_new_tab', 'Open SQL Editor in the separate browser Tab'], ['sql_editor_shortcut_undo', 'Undo'], ['sql_editor_shortcut_redo', 'Redo'], diff --git a/webapp/packages/plugin-help/src/locales/fr.ts b/webapp/packages/plugin-help/src/locales/fr.ts index 89650f5bb8..41a7f12686 100644 --- a/webapp/packages/plugin-help/src/locales/fr.ts +++ b/webapp/packages/plugin-help/src/locales/fr.ts @@ -19,6 +19,7 @@ export default [ ['sql_editor_shortcut_execute_script', 'Exécuter le script'], ['sql_editor_shortcut_show_execution_plan', "Afficher le plan d'exécution"], ['sql_editor_shortcut_format', 'Formater le script'], + ['sql_editor_shortcut_save_as_script', 'Save as script'], ['sql_editor_shortcut_open_editor_in_new_tab', "Ouvrir l'éditeur SQL dans un nouvel onglet"], ['sql_editor_shortcut_undo', 'Annuler'], ['sql_editor_shortcut_redo', 'Rétablir'], diff --git a/webapp/packages/plugin-help/src/locales/it.ts b/webapp/packages/plugin-help/src/locales/it.ts index 574180f9b8..faffafb3c2 100644 --- a/webapp/packages/plugin-help/src/locales/it.ts +++ b/webapp/packages/plugin-help/src/locales/it.ts @@ -1,3 +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. + */ export default [ ['shortcuts_title', 'Shortcuts'], @@ -14,6 +21,7 @@ export default [ ['sql_editor_shortcut_execute_script', 'Execute script'], ['sql_editor_shortcut_show_execution_plan', 'Show Execution plan'], ['sql_editor_shortcut_format', 'Format script'], + ['sql_editor_shortcut_save_as_script', 'Save as script'], ['sql_editor_shortcut_open_editor_in_new_tab', 'Open SQL Editor in the separate browser Tab'], ['sql_editor_shortcut_undo', 'Undo'], ['sql_editor_shortcut_redo', 'Redo'], diff --git a/webapp/packages/plugin-help/src/locales/ru.ts b/webapp/packages/plugin-help/src/locales/ru.ts index 57f9cb53cc..79499b313d 100644 --- a/webapp/packages/plugin-help/src/locales/ru.ts +++ b/webapp/packages/plugin-help/src/locales/ru.ts @@ -1,3 +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. + */ export default [ ['shortcuts_title', 'Горячие клавиши'], @@ -14,6 +21,7 @@ export default [ ['sql_editor_shortcut_execute_script', 'Выполнить скрипт'], ['sql_editor_shortcut_show_execution_plan', 'Показать план выполнения'], ['sql_editor_shortcut_format', 'Форматировать скрипт'], + ['sql_editor_shortcut_save_as_script', 'Сохранить как скрипт'], ['sql_editor_shortcut_open_editor_in_new_tab', 'Открыть SQL редактор в новой бразуерной вкладке'], ['sql_editor_shortcut_undo', 'Отменить'], ['sql_editor_shortcut_redo', 'Повторить'], diff --git a/webapp/packages/plugin-help/src/locales/zh.ts b/webapp/packages/plugin-help/src/locales/zh.ts index c3e10bb627..6fbd7affd6 100644 --- a/webapp/packages/plugin-help/src/locales/zh.ts +++ b/webapp/packages/plugin-help/src/locales/zh.ts @@ -21,6 +21,7 @@ export default [ ['sql_editor_shortcut_execute_script', '执行脚本'], ['sql_editor_shortcut_show_execution_plan', '显示执行计划'], ['sql_editor_shortcut_format', '格式化脚本'], + ['sql_editor_shortcut_save_as_script', 'Save as script'], ['sql_editor_shortcut_open_editor_in_new_tab', '在单独的浏览器标签下打开SQL编辑器'], ['sql_editor_shortcut_undo', '撤销'], ['sql_editor_shortcut_redo', '重做'], diff --git a/webapp/packages/plugin-help/tsconfig.json b/webapp/packages/plugin-help/tsconfig.json index 310be66375..227ed0b50c 100644 --- a/webapp/packages/plugin-help/tsconfig.json +++ b/webapp/packages/plugin-help/tsconfig.json @@ -45,6 +45,9 @@ { "path": "../plugin-navigation-tree/tsconfig.json" }, + { + "path": "../plugin-sql-editor-navigation-tab-script/tsconfig.json" + }, { "path": "../plugin-sql-editor/tsconfig.json" }, diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/package.json b/webapp/packages/plugin-sql-editor-navigation-tab-script/package.json index d4e31d596a..8510382873 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/package.json +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/package.json @@ -20,6 +20,7 @@ "dependencies": { "@cloudbeaver/core-blocks": "^0", "@cloudbeaver/core-connections": "^0", + "@cloudbeaver/core-data-context": "^0", "@cloudbeaver/core-di": "^0", "@cloudbeaver/core-dialogs": "^0", "@cloudbeaver/core-events": "^0", diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT.ts b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT.ts new file mode 100644 index 0000000000..54eab7c52d --- /dev/null +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT.ts @@ -0,0 +1,14 @@ +/* + * 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 { createKeyBinding } from '@cloudbeaver/core-view'; + +export const KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT = createKeyBinding({ + id: 'save-as-script', + keys: 'shift+mod+s', + preventDefault: true, +}); diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/PluginBootstrap.ts b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/PluginBootstrap.ts index 227e2c821c..146c53dc93 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/PluginBootstrap.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/PluginBootstrap.ts @@ -5,6 +5,7 @@ * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. */ +import type { IDataContextProvider } from '@cloudbeaver/core-data-context'; import { Bootstrap, injectable } from '@cloudbeaver/core-di'; import { CommonDialogService, DialogueStateResult } from '@cloudbeaver/core-dialogs'; import { NotificationService } from '@cloudbeaver/core-events'; @@ -14,7 +15,7 @@ import { isResourceOfType, ProjectInfoResource, ProjectsService } from '@cloudbe import { CachedMapAllKey, CachedTreeChildrenKey } from '@cloudbeaver/core-resource'; import { getRmResourcePath, NAV_NODE_TYPE_RM_RESOURCE, ResourceManagerResource, RESOURCES_NODE_PATH } from '@cloudbeaver/core-resource-manager'; import { createPath, getPathName } from '@cloudbeaver/core-utils'; -import { ActionService, MenuService } from '@cloudbeaver/core-view'; +import { ActionService, KeyBindingService, MenuService } from '@cloudbeaver/core-view'; import { NavigationTabsService } from '@cloudbeaver/plugin-navigation-tabs'; import { getResourceKeyFromNodeId } from '@cloudbeaver/plugin-navigation-tree-rm'; import { RESOURCE_NAME_REGEX, ResourceManagerService } from '@cloudbeaver/plugin-resource-manager'; @@ -29,10 +30,12 @@ import { SQL_EDITOR_TOOLS_MENU, SqlDataSourceService, SqlEditorSettingsService, + SqlEditorView, } from '@cloudbeaver/plugin-sql-editor'; import { isSQLEditorTab, SqlEditorNavigatorService } from '@cloudbeaver/plugin-sql-editor-navigation-tab'; import { ACTION_SAVE_AS_SCRIPT } from './ACTION_SAVE_AS_SCRIPT.js'; +import { KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT } from './KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT.js'; import { ResourceSqlDataSource } from './ResourceSqlDataSource.js'; import { SqlEditorTabResourceService } from './SqlEditorTabResourceService.js'; @@ -55,8 +58,11 @@ export class PluginBootstrap extends Bootstrap { private readonly sqlEditorSettingsService: SqlEditorSettingsService, private readonly resourceManagerResource: ResourceManagerResource, private readonly resourceManagerScriptsService: ResourceManagerScriptsService, + private readonly keyBindingService: KeyBindingService, + private readonly sqlEditorView: SqlEditorView, ) { super(); + this.saveAsScriptHandler = this.saveAsScriptHandler.bind(this); } override register(): void { @@ -78,103 +84,9 @@ export class PluginBootstrap extends Bootstrap { return dataSource instanceof MemorySqlDataSource || dataSource instanceof LocalStorageSqlDataSource; }, - handler: async (context, action) => { - const state = context.get(DATA_CONTEXT_SQL_EDITOR_STATE)!; - - let dataSource: ISqlDataSource | ResourceSqlDataSource | undefined = this.sqlDataSourceService.get(state.editorId); - - if (!dataSource) { - return; - } - + handler: (context, action) => { if (action === ACTION_SAVE_AS_SCRIPT) { - let projectId = dataSource.executionContext?.projectId ?? null; - await this.projectInfoResource.load(CachedMapAllKey); - const name = getSqlEditorName(state, dataSource); - - if (projectId) { - const project = this.projectInfoResource.get(projectId); - - if (!project?.canEditResources) { - projectId = null; - } - } - - const result = await this.commonDialogService.open(SaveScriptDialog, { - defaultScriptName: name, - projectId, - validation: async ({ name, projectId }, setMessage) => { - const trimmedName = name.trim(); - - if (!projectId || !trimmedName.length) { - return false; - } - - if (!RESOURCE_NAME_REGEX.test(trimmedName)) { - setMessage('plugin_resource_manager_scripts_script_name_invalid_characters_message'); - return false; - } - - const project = this.projectInfoResource.get(projectId); - const nameWithExtension = this.projectInfoResource.getNameWithExtension(projectId, SCRIPTS_TYPE_ID, trimmedName); - const rootFolder = project ? this.resourceManagerScriptsService.getRootFolder(project) : undefined; - const key = getRmResourcePath(projectId, rootFolder); - - try { - await this.resourceManagerResource.load(CachedTreeChildrenKey(key)); - return !this.resourceManagerResource.has(createPath(key, nameWithExtension)); - } catch (exception: any) { - return false; - } - }, - }); - - if (result !== DialogueStateResult.Rejected && result !== DialogueStateResult.Resolved) { - try { - projectId = result.projectId; - - if (!projectId) { - throw new Error('Project not selected'); - } - - const project = this.projectInfoResource.get(projectId); - if (!project) { - throw new Error('Project not found'); - } - - const nameWithoutExtension = result.name.trim(); - const scriptName = this.projectInfoResource.getNameWithExtension(projectId, SCRIPTS_TYPE_ID, nameWithoutExtension); - const scriptsRootFolder = this.resourceManagerScriptsService.getRootFolder(project); - const folderResourceKey = getResourceKeyFromNodeId(createPath(RESOURCES_NODE_PATH, projectId, scriptsRootFolder)); - - if (!folderResourceKey) { - this.notificationService.logError({ title: 'ui_error', message: 'plugin_sql_editor_navigation_tab_resource_save_script_error' }); - return; - } - - const resourceKey = createPath(folderResourceKey, scriptName); - - await this.resourceManagerScriptsService.createScript(resourceKey, dataSource.executionContext, dataSource.script); - - dataSource = this.sqlDataSourceService.create(state, ResourceSqlDataSource.key, { - script: dataSource.script, - executionContext: dataSource.executionContext, - }); - - (dataSource as ResourceSqlDataSource).setResourceKey(resourceKey); - - this.notificationService.logSuccess({ - title: 'plugin_sql_editor_navigation_tab_resource_save_script_success', - message: nameWithoutExtension, - }); - - if (!this.resourceManagerScriptsService.active) { - this.resourceManagerScriptsService.togglePanel(); - } - } catch (exception) { - this.notificationService.logException(exception as any, 'plugin_sql_editor_navigation_tab_resource_save_script_error'); - } - } + this.saveAsScriptHandler(context); } }, getActionInfo: (context, action) => { @@ -189,6 +101,8 @@ export class PluginBootstrap extends Bootstrap { }, }); + this.sqlEditorView.registerAction(ACTION_SAVE_AS_SCRIPT); + this.menuService.addCreator({ menus: [SQL_EDITOR_TOOLS_MENU], contexts: [DATA_CONTEXT_SQL_EDITOR_STATE], @@ -201,6 +115,113 @@ export class PluginBootstrap extends Bootstrap { }, getItems: (context, items) => [...items, ACTION_SAVE_AS_SCRIPT], }); + + this.keyBindingService.addKeyBindingHandler({ + id: 'save-as-script', + binding: KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT, + actions: [ACTION_SAVE_AS_SCRIPT], + contexts: [DATA_CONTEXT_SQL_EDITOR_STATE], + isBindingApplicable: (_, action) => action === ACTION_SAVE_AS_SCRIPT, + handler: this.saveAsScriptHandler.bind(this), + }); + } + + private async saveAsScriptHandler(context: IDataContextProvider) { + const state = context.get(DATA_CONTEXT_SQL_EDITOR_STATE)!; + + let dataSource: ISqlDataSource | ResourceSqlDataSource | undefined = this.sqlDataSourceService.get(state.editorId); + + if (!dataSource) { + return; + } + + let projectId = dataSource.executionContext?.projectId ?? null; + await this.projectInfoResource.load(CachedMapAllKey); + const name = getSqlEditorName(state, dataSource); + + if (projectId) { + const project = this.projectInfoResource.get(projectId); + + if (!project?.canEditResources) { + projectId = null; + } + } + + const result = await this.commonDialogService.open(SaveScriptDialog, { + defaultScriptName: name, + projectId, + validation: async ({ name, projectId }, setMessage) => { + const trimmedName = name.trim(); + + if (!projectId || !trimmedName.length) { + return false; + } + + if (!RESOURCE_NAME_REGEX.test(trimmedName)) { + setMessage('plugin_resource_manager_scripts_script_name_invalid_characters_message'); + return false; + } + + const project = this.projectInfoResource.get(projectId); + const nameWithExtension = this.projectInfoResource.getNameWithExtension(projectId, SCRIPTS_TYPE_ID, trimmedName); + const rootFolder = project ? this.resourceManagerScriptsService.getRootFolder(project) : undefined; + const key = getRmResourcePath(projectId, rootFolder); + + try { + await this.resourceManagerResource.load(CachedTreeChildrenKey(key)); + return !this.resourceManagerResource.has(createPath(key, nameWithExtension)); + } catch (exception: any) { + return false; + } + }, + }); + + if (result !== DialogueStateResult.Rejected && result !== DialogueStateResult.Resolved) { + try { + projectId = result.projectId; + + if (!projectId) { + throw new Error('Project not selected'); + } + + const project = this.projectInfoResource.get(projectId); + if (!project) { + throw new Error('Project not found'); + } + + const nameWithoutExtension = result.name.trim(); + const scriptName = this.projectInfoResource.getNameWithExtension(projectId, SCRIPTS_TYPE_ID, nameWithoutExtension); + const scriptsRootFolder = this.resourceManagerScriptsService.getRootFolder(project); + const folderResourceKey = getResourceKeyFromNodeId(createPath(RESOURCES_NODE_PATH, projectId, scriptsRootFolder)); + + if (!folderResourceKey) { + this.notificationService.logError({ title: 'ui_error', message: 'plugin_sql_editor_navigation_tab_resource_save_script_error' }); + return; + } + + const resourceKey = createPath(folderResourceKey, scriptName); + + await this.resourceManagerScriptsService.createScript(resourceKey, dataSource.executionContext, dataSource.script); + + dataSource = this.sqlDataSourceService.create(state, ResourceSqlDataSource.key, { + script: dataSource.script, + executionContext: dataSource.executionContext, + }); + + (dataSource as ResourceSqlDataSource).setResourceKey(resourceKey); + + this.notificationService.logSuccess({ + title: 'plugin_sql_editor_navigation_tab_resource_save_script_success', + message: nameWithoutExtension, + }); + + if (!this.resourceManagerScriptsService.active) { + this.resourceManagerScriptsService.togglePanel(); + } + } catch (exception) { + this.notificationService.logException(exception as any, 'plugin_sql_editor_navigation_tab_resource_save_script_error'); + } + } } private canOpenHandler(data: INodeNavigationData, contexts: IExecutionContextProvider): void { diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/index.ts b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/index.ts index 4f4c9cb3ab..5280afc8f6 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/index.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/index.ts @@ -7,4 +7,6 @@ */ import { manifest } from './manifest.js'; +export * from './KEY_BINDING_SQL_EDITOR_SAVE_AS_SCRIPT.js'; + export default manifest; diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/en.ts b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/en.ts index 00a4bc286a..9009c2ea31 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/en.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/en.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_sql_editor_navigation_tab_resource_save_script_title', 'Save as script'], + ['plugin_sql_editor_navigation_tab_resource_save_script_title', 'Save as script (Shift + Ctrl + S)'], ['plugin_sql_editor_navigation_tab_script_state_renaming', 'Renaming script...'], ['plugin_sql_editor_navigation_tab_script_state_reading', 'Reading script...'], ['plugin_sql_editor_navigation_tab_script_state_saving', 'Saving script...'], diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/fr.ts b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/fr.ts index 3543b71ac4..5e123f2bcc 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/fr.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/fr.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_sql_editor_navigation_tab_resource_save_title', 'Enregistrer comme script'], + ['plugin_sql_editor_navigation_tab_resource_save_title', 'Enregistrer comme script (Shift + Ctrl + S)'], ['plugin_sql_editor_navigation_tab_script_state_renaming', 'Renommer le script...'], ['plugin_sql_editor_navigation_tab_script_state_reading', 'Lecture du script...'], ['plugin_sql_editor_navigation_tab_script_state_saving', 'Enregistrement du script...'], diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/it.ts b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/it.ts index 00a4bc286a..9009c2ea31 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/it.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/it.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_sql_editor_navigation_tab_resource_save_script_title', 'Save as script'], + ['plugin_sql_editor_navigation_tab_resource_save_script_title', 'Save as script (Shift + Ctrl + S)'], ['plugin_sql_editor_navigation_tab_script_state_renaming', 'Renaming script...'], ['plugin_sql_editor_navigation_tab_script_state_reading', 'Reading script...'], ['plugin_sql_editor_navigation_tab_script_state_saving', 'Saving script...'], diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/ru.ts b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/ru.ts index 30cf98bc37..2d2383855a 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/ru.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/ru.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_sql_editor_navigation_tab_resource_save_script_title', 'Сохранить как скрипт'], + ['plugin_sql_editor_navigation_tab_resource_save_script_title', 'Сохранить как скрипт (Shift + Ctrl + S)'], ['plugin_sql_editor_navigation_tab_script_state_renaming', 'Переименовывание скрипта...'], ['plugin_sql_editor_navigation_tab_script_state_reading', 'Чтение скрипта...'], ['plugin_sql_editor_navigation_tab_script_state_saving', 'Сохранение скрипта...'], diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/zh.ts b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/zh.ts index 9cc4e99fa5..1109a8ad9b 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/zh.ts +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/src/locales/zh.ts @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. */ export default [ - ['plugin_sql_editor_navigation_tab_resource_save_script_title', '保存为脚本'], + ['plugin_sql_editor_navigation_tab_resource_save_script_title', '保存为脚本 (Shift + Ctrl + S)'], ['plugin_sql_editor_navigation_tab_script_state_renaming', '重命名脚本中...'], ['plugin_sql_editor_navigation_tab_script_state_reading', '读取脚本中...'], ['plugin_sql_editor_navigation_tab_script_state_saving', '保存脚本中...'], diff --git a/webapp/packages/plugin-sql-editor-navigation-tab-script/tsconfig.json b/webapp/packages/plugin-sql-editor-navigation-tab-script/tsconfig.json index 92d9867bb6..d59cdf26b4 100644 --- a/webapp/packages/plugin-sql-editor-navigation-tab-script/tsconfig.json +++ b/webapp/packages/plugin-sql-editor-navigation-tab-script/tsconfig.json @@ -12,6 +12,9 @@ { "path": "../core-connections/tsconfig.json" }, + { + "path": "../core-data-context/tsconfig.json" + }, { "path": "../core-di/tsconfig.json" }, diff --git a/webapp/packages/plugin-sql-editor/src/index.ts b/webapp/packages/plugin-sql-editor/src/index.ts index 1a976a1dba..6248274125 100644 --- a/webapp/packages/plugin-sql-editor/src/index.ts +++ b/webapp/packages/plugin-sql-editor/src/index.ts @@ -47,5 +47,6 @@ export * from './SQLEditorLoader.js'; export * from './SqlEditorModeService.js'; export * from './SqlEditorService.js'; export * from './SqlEditorSettingsService.js'; +export * from './SqlEditorView.js'; export default sqlEditorPluginManifest;