From 4a30872a1584d35606eb7c9823922e2b021c1acf Mon Sep 17 00:00:00 2001 From: Daniil Senkiv Date: Thu, 19 Mar 2020 15:59:28 +0300 Subject: [PATCH] Web.Files: TreeFolders, EmptyFolderContainer: fix problem with paging --- .../Client/src/components/Article/Body/TreeFolders.js | 5 +++-- .../pages/Home/Section/Body/EmptyFolderContainer.js | 5 +++-- .../Client/src/components/pages/Home/Section/Body/index.js | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) 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 3f5f9ed965..78257d4bc6 100644 --- a/products/ASC.Files/Client/src/components/Article/Body/TreeFolders.js +++ b/products/ASC.Files/Client/src/components/Article/Body/TreeFolders.js @@ -1,6 +1,6 @@ import React from "react"; import { TreeMenu, TreeNode, Icons, toastr, utils } from "asc-web-components"; -import { fetchFolder } from "../../../store/files/actions"; +import { fetchFolder, fetchFiles } from "../../../store/files/actions"; import store from "../../../store/store"; import { api, history } from "asc-web-common"; const { files } = api; @@ -65,7 +65,8 @@ class TreeFolders extends React.Component { ? "" : "/"; history.push(`${url}${symbol}#${data[0]}`); - fetchFolder(data[0], store.dispatch).catch(err => + const newFilter = this.props.filter.clone(); + fetchFiles(data[0], newFilter, store.dispatch).catch(err => toastr.error("Something went wrong", err) ); } diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyFolderContainer.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyFolderContainer.js index f611cce3cd..490d55dafb 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyFolderContainer.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/EmptyFolderContainer.js @@ -1,7 +1,7 @@ import React from "react"; import styled from "styled-components"; import { EmptyScreenContainer, Link } from "asc-web-components"; -import { fetchFolder } from "../../../../../store/files/actions"; +import { fetchFiles } from "../../../../../store/files/actions"; import store from "../../../../../store/store"; import { history } from "asc-web-common"; @@ -44,7 +44,8 @@ const EmptyFolderContainer = props => { console.log("Create presentation click"); const onCreateFolderClick = () => console.log("Create folder click"); const onBackToParentFolder = () => { - fetchFolder(props.parentId, store.dispatch); + const newFilter = props.filter.clone(); + fetchFiles(props.parentId, newFilter, store.dispatch); const url = history.location.search !== "" ? history.location.search diff --git a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js index 3b5db175b8..0dbcf3f4ba 100644 --- a/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js +++ b/products/ASC.Files/Client/src/components/pages/Home/Section/Body/index.js @@ -184,7 +184,7 @@ class SectionBodyContent extends React.PureComponent { }; render() { - const { files, folders, viewer, parentId, folderId, settings, selection, fileAction, onLoading } = this.props; + const { files, folders, viewer, parentId, folderId, settings, selection, fileAction, onLoading, filter } = this.props; const { editingId } = this.state; let items = [...folders, ...files]; @@ -229,7 +229,7 @@ class SectionBodyContent extends React.PureComponent { })} ) : parentId !== 0 ? ( - + ) :

RootFolderContainer

; } }