🐛 Sort folders by pending documents
This commit is contained in:
parent
c103f44570
commit
5feca67743
@ -27,7 +27,11 @@ class FolderListClass extends React.Component<IPropsClass, IState> {
|
||||
: Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path;
|
||||
return (
|
||||
<div className={classes["root"]}>
|
||||
{this.props.folders.map((folder) => {
|
||||
{this.props.folders.sort((folder) => {
|
||||
const pendingDocuments = folder.documents!.filter((document) => document.document_status === "PENDING");
|
||||
console.log(pendingDocuments.length);
|
||||
return pendingDocuments.length >= 1 ? -1 : 1;
|
||||
}).map((folder) => {
|
||||
return (
|
||||
<div
|
||||
onClick={this.props.onCloseLeftSide}
|
||||
|
@ -195,7 +195,7 @@ export const folderWithPendingDocument: OfficeFolder = {
|
||||
updated_at: new Date(),
|
||||
description: "Description",
|
||||
archived_description: "Archived description",
|
||||
documents: [document, documentPending, documentDeposited, documentIdentity],
|
||||
documents: [],
|
||||
};
|
||||
export const folderWithPendingDocument1: OfficeFolder = {
|
||||
uid: "gtrtyutyhretgytu",
|
||||
|
Loading…
x
Reference in New Issue
Block a user