🐛 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;
|
: Module.getInstance().get().modules.pages.Folder.pages.FolderInformation.props.path;
|
||||||
return (
|
return (
|
||||||
<div className={classes["root"]}>
|
<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 (
|
return (
|
||||||
<div
|
<div
|
||||||
onClick={this.props.onCloseLeftSide}
|
onClick={this.props.onCloseLeftSide}
|
||||||
|
@ -195,7 +195,7 @@ export const folderWithPendingDocument: OfficeFolder = {
|
|||||||
updated_at: new Date(),
|
updated_at: new Date(),
|
||||||
description: "Description",
|
description: "Description",
|
||||||
archived_description: "Archived description",
|
archived_description: "Archived description",
|
||||||
documents: [document, documentPending, documentDeposited, documentIdentity],
|
documents: [],
|
||||||
};
|
};
|
||||||
export const folderWithPendingDocument1: OfficeFolder = {
|
export const folderWithPendingDocument1: OfficeFolder = {
|
||||||
uid: "gtrtyutyhretgytu",
|
uid: "gtrtyutyhretgytu",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user