feat: add filters to drafts (#1631)
* feat: add filters to drafts Co-authored-by: Guilherme Diniz <guilhermedassumpcao@gmail.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// @flow
|
||||
import ArrowKeyNavigation from "boundless-arrow-key-navigation";
|
||||
import { isEqual } from "lodash";
|
||||
import { observable, action } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import * as React from "react";
|
||||
@@ -40,6 +41,9 @@ class PaginatedList extends React.Component<Props> {
|
||||
if (prevProps.fetch !== this.props.fetch) {
|
||||
this.fetchResults();
|
||||
}
|
||||
if (!isEqual(prevProps.options, this.props.options)) {
|
||||
this.fetchResults();
|
||||
}
|
||||
}
|
||||
|
||||
fetchResults = async () => {
|
||||
|
||||
@@ -69,7 +69,6 @@ class MainSidebar extends React.Component<Props> {
|
||||
const { user, team } = auth;
|
||||
if (!user || !team) return null;
|
||||
|
||||
const draftDocumentsCount = documents.drafts.length;
|
||||
const can = policies.abilities(team.id);
|
||||
|
||||
return (
|
||||
@@ -123,8 +122,8 @@ class MainSidebar extends React.Component<Props> {
|
||||
label={
|
||||
<Drafts align="center">
|
||||
Drafts
|
||||
{draftDocumentsCount > 0 && (
|
||||
<Bubble count={draftDocumentsCount} />
|
||||
{documents.totalDrafts > 0 && (
|
||||
<Bubble count={documents.totalDrafts} />
|
||||
)}
|
||||
</Drafts>
|
||||
}
|
||||
|
||||
@@ -11,12 +11,11 @@ const H3 = styled.h3`
|
||||
margin-top: 22px;
|
||||
margin-bottom: 12px;
|
||||
line-height: 1;
|
||||
position: relative;
|
||||
`;
|
||||
|
||||
const Underline = styled("span")`
|
||||
position: relative;
|
||||
top: 1px;
|
||||
|
||||
margin-top: -1px;
|
||||
display: inline-block;
|
||||
font-weight: 500;
|
||||
font-size: 14px;
|
||||
|
||||
Reference in New Issue
Block a user