diff --git a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java index 61825cfc6d..53cc29fa36 100644 --- a/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java +++ b/server/bundles/io.cloudbeaver.model/src/io/cloudbeaver/model/rm/local/LocalResourceController.java @@ -756,7 +756,7 @@ public class LocalResourceController implements RMController { } Path targetPath = getTargetPath(projectId, resourcePath); if (!forceOverwrite && Files.exists(targetPath)) { - throw new DBException("Resource '" + resourcePath + "' exists"); + throw new DBException("Resource '" + IOUtils.getFileNameWithoutExtension(targetPath) + "' already exists"); } doFileWriteOperation(projectId, targetPath, () -> { diff --git a/server/bundles/io.cloudbeaver.service.rm/src/io/cloudbeaver/service/rm/impl/WebServiceRM.java b/server/bundles/io.cloudbeaver.service.rm/src/io/cloudbeaver/service/rm/impl/WebServiceRM.java index a267ec508a..0e233467a6 100644 --- a/server/bundles/io.cloudbeaver.service.rm/src/io/cloudbeaver/service/rm/impl/WebServiceRM.java +++ b/server/bundles/io.cloudbeaver.service.rm/src/io/cloudbeaver/service/rm/impl/WebServiceRM.java @@ -246,7 +246,7 @@ public class WebServiceRM implements DBWServiceRM { WSResourceProperty.CONTENT); return content; } catch (Exception e) { - throw new DBWebException("Error writing resource '" + resourcePath + "' data", e); + throw new DBWebException("Error writing resource data", e); } } 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 9aee60e3e1..f6ef78c0dd 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 @@ -33,9 +33,9 @@ import { } 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'; import { ResourceSqlDataSource } from './ResourceSqlDataSource'; import { SqlEditorTabResourceService } from './SqlEditorTabResourceService'; -import { ACTION_SAVE_AS_SCRIPT } from './ACTION_SAVE_AS_SCRIPT'; @injectable() export class PluginBootstrap extends Bootstrap { @@ -141,7 +141,8 @@ export class PluginBootstrap extends Bootstrap { throw new Error('Project not found'); } - const scriptName = this.projectInfoResource.getNameWithExtension(projectId, SCRIPTS_TYPE_ID, result.name.trim()); + 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)); @@ -163,7 +164,7 @@ export class PluginBootstrap extends Bootstrap { this.notificationService.logSuccess({ title: 'plugin_sql_editor_navigation_tab_resource_save_script_success', - message: getPathName(resourceKey), + message: nameWithoutExtension, }); if (!this.resourceManagerScriptsService.active) { @@ -248,7 +249,7 @@ export class PluginBootstrap extends Bootstrap { }); } - load(): void | Promise { } + load(): void | Promise {} private canOpenHandler(data: INodeNavigationData, contexts: IExecutionContextProvider): void { const nodeInfo = contexts.getContext(this.navNodeManagerService.navigationNavNodeContext);