Skip to content

Commit

Permalink
CB-5955 pr fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyteleshev committed Dec 13, 2024
1 parent 80e7dfe commit 2761970
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { isFolderNodeId } from './isFolderNodeId.js';

export function getFolderPathWithProjectId(folderId: string): string {
if (!isFolderNodeId(folderId)) {
throw new Error('Invalid folder id');
}

return folderId.replace('folder://', '');
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ export class CustomConnectionPluginBootstrap extends Bootstrap {
}

private async createConnectionHandler(context: IDataContextProvider, action: IAction) {
const tree = context.get(DATA_CONTEXT_ELEMENTS_TREE)!;

switch (action) {
case ACTION_TREE_CREATE_CONNECTION: {
const tree = context.get(DATA_CONTEXT_ELEMENTS_TREE)!;
const projectId = this.treeSelectionService.getSelectedProject(tree)?.id;
const selectedNode = this.treeSelectionService.getFirstSelectedNode(tree, getProjectNodeId);
const folderPath = selectedNode?.folderId ? getFolderPath(selectedNode.folderId) : undefined;
Expand Down

0 comments on commit 2761970

Please sign in to comment.