From 6f921f249f7cc4e109be25f6251c6751a58d8feb Mon Sep 17 00:00:00 2001 From: Tatiana Lopaeva Date: Tue, 26 Oct 2021 10:59:34 +0300 Subject: [PATCH] Fixed Bug-53346: Added tree expansion when opening the folder where the file is located. --- .../ASC.Files/Client/src/store/FilesActionsStore.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/products/ASC.Files/Client/src/store/FilesActionsStore.js b/products/ASC.Files/Client/src/store/FilesActionsStore.js index 187fec5b64e..d105fea9e9c 100644 --- a/products/ASC.Files/Client/src/store/FilesActionsStore.js +++ b/products/ASC.Files/Client/src/store/FilesActionsStore.js @@ -453,9 +453,17 @@ class FilesActionStore { }; openLocationAction = (locationId, isFolder) => { + const { createNewExpandedKeys, setExpandedKeys } = this.treeFoldersStore; + const locationFilter = isFolder ? this.filesStore.filter : null; this.filesStore.setBufferSelection(null); - return this.filesStore.fetchFiles(locationId, locationFilter); + return this.filesStore + .fetchFiles(locationId, locationFilter) + .then((data) => { + const pathParts = data.selectedFolder.pathParts; + const newExpandedKeys = createNewExpandedKeys(pathParts); + setExpandedKeys(newExpandedKeys); + }); /*.then(() => //isFolder ? null : this.selectRowAction(!checked, item) );*/