diff --git a/webapp/packages/plugin-connections/src/NavNodes/ConnectionFoldersBootstrap.ts b/webapp/packages/plugin-connections/src/NavNodes/ConnectionFoldersBootstrap.ts index a1757edd91..b7ae2f198a 100644 --- a/webapp/packages/plugin-connections/src/NavNodes/ConnectionFoldersBootstrap.ts +++ b/webapp/packages/plugin-connections/src/NavNodes/ConnectionFoldersBootstrap.ts @@ -129,17 +129,7 @@ export class ConnectionFoldersBootstrap extends Bootstrap { this.actionService.addHandler({ id: 'tree-tools-menu-folders-handler', contexts: [DATA_CONTEXT_ELEMENTS_TREE], - isActionApplicable: (context, action) => { - const tree = context.get(DATA_CONTEXT_ELEMENTS_TREE)!; - - if (action !== ACTION_NEW_FOLDER || !this.userInfoResource.isAuthenticated() || tree.baseRoot !== ROOT_NODE_PATH) { - return false; - } - - const targetNode = this.getTargetNode(tree); - - return targetNode !== undefined; - }, + isActionApplicable: this.isActionApplicable.bind(this), handler: this.elementsTreeActionHandler.bind(this), }); @@ -164,10 +154,23 @@ export class ConnectionFoldersBootstrap extends Bootstrap { menus: [MENU_NAVIGATION_TREE_CREATE], actions: [ACTION_CREATE_FOLDER], contexts: [DATA_CONTEXT_ELEMENTS_TREE], + isActionApplicable: this.isActionApplicable.bind(this), handler: this.elementsTreeActionHandler.bind(this), }); } + private isActionApplicable(context: IDataContextProvider, action: IAction): boolean { + const tree = context.get(DATA_CONTEXT_ELEMENTS_TREE)!; + + if (![ACTION_NEW_FOLDER, ACTION_CREATE_FOLDER].includes(action) || !this.userInfoResource.isAuthenticated() || tree.baseRoot !== ROOT_NODE_PATH) { + return false; + } + + const targetNode = this.getTargetNode(tree); + + return targetNode !== undefined; + } + private async moveConnectionToFolder({ type, targetNode, moveContexts }: INodeMoveData, contexts: IExecutionContextProvider) { if (![NAV_NODE_TYPE_PROJECT, NAV_NODE_TYPE_FOLDER].includes(targetNode.nodeType!)) { return;