diff --git a/packages/asc-web-common/api/files/index.js b/packages/asc-web-common/api/files/index.js index b5455bd343b..579fa359a4c 100644 --- a/packages/asc-web-common/api/files/index.js +++ b/packages/asc-web-common/api/files/index.js @@ -64,26 +64,28 @@ export function getFolder(folderId, filter) { return request(options); } -// const getFolderNameByType = (folderType) => { -// switch (folderType) { -// case FolderType.USER: -// return "@my"; -// case FolderType.SHARE: -// return "@share"; -// case FolderType.COMMON: -// return "@common"; -// case FolderType.Projects: -// return "@projects"; -// case FolderType.Favorites: -// return "@favorites"; -// case FolderType.Recent: -// return "@recent"; -// case FolderType.TRASH: -// return "@trash"; -// default: -// return ""; -// } -// }; //TODO: need get from settings +const getFolderClassNameByType = (folderType) => { + switch (folderType) { + case FolderType.USER: + return "tree-node-my"; + case FolderType.SHARE: + return "tree-node-share"; + case FolderType.COMMON: + return "tree-node-common"; + case FolderType.Projects: + return "tree-node-projects"; + case FolderType.Favorites: + return "tree-node-favorites"; + case FolderType.Recent: + return "tree-node-recent"; + case FolderType.Privacy: + return "tree-node-privacy"; + case FolderType.TRASH: + return "tree-node-trash"; + default: + return ""; + } +}; const sortInDisplayOrder = (folders) => { const sorted = []; @@ -145,7 +147,7 @@ export function getFoldersTree() { const folders = sortInDisplayOrder(response); return folders.map((data, index) => { const type = +data.current.rootFolderType; - //const name = getFolderNameByType(type); + const name = getFolderClassNameByType(type); const isRecycleBinFolder = type === FolderType.TRASH; return { id: data.current.id, @@ -153,7 +155,7 @@ export function getFoldersTree() { parentId: data.current.parentId, title: data.current.title, rootFolderType: type, - //rootFolderName: name, + folderClassName: name, // folders: !isRecycleBinFolder // ? data.folders.map((folder) => { // return { diff --git a/products/ASC.Files/Client/src/components/Article/Body/TreeFolders.js b/products/ASC.Files/Client/src/components/Article/Body/TreeFolders.js index 8a3131dfea5..2710d950821 100644 --- a/products/ASC.Files/Client/src/components/Article/Body/TreeFolders.js +++ b/products/ASC.Files/Client/src/components/Article/Body/TreeFolders.js @@ -222,7 +222,7 @@ class TreeFolders extends React.Component {