diff --git a/app/packs/src/apps/mydb/collections/CollectionTree.js b/app/packs/src/apps/mydb/collections/CollectionTree.js index ecf2767ca0..a8fb7f02a1 100644 --- a/app/packs/src/apps/mydb/collections/CollectionTree.js +++ b/app/packs/src/apps/mydb/collections/CollectionTree.js @@ -6,16 +6,10 @@ import CollectionStore from 'src/stores/alt/stores/CollectionStore'; import CollectionActions from 'src/stores/alt/actions/CollectionActions'; import CollectionSubtree from 'src/apps/mydb/collections/CollectionSubtree'; import UIActions from 'src/stores/alt/actions/UIActions'; -import InboxActions from 'src/stores/alt/actions/InboxActions'; -import LoadingActions from 'src/stores/alt/actions/LoadingActions'; import UIStore from 'src/stores/alt/stores/UIStore'; import ElementStore from 'src/stores/alt/stores/ElementStore'; -import InboxStore from 'src/stores/alt/stores/InboxStore'; import UserInfos from 'src/apps/mydb/collections/UserInfos'; -import DeviceBox from 'src/apps/mydb/inbox/DeviceBox'; -import UnsortedBox from 'src/apps/mydb/inbox/UnsortedBox'; - const colVisibleTooltip = Toggle own collections; export default class CollectionTree extends React.Component { @@ -23,7 +17,6 @@ export default class CollectionTree extends React.Component { super(props); const collecState = CollectionStore.getState(); - const inboxState = InboxStore.getState(); this.state = { unsharedRoots: collecState.unsharedRoots, @@ -35,40 +28,30 @@ export default class CollectionTree extends React.Component { sharedWithCollectionVisible: false, sharedToCollectionVisible: false, syncCollectionVisible: false, - inbox: inboxState.inbox, - numberOfAttachments: inboxState.numberOfAttachments, - inboxVisible: false, visible: false, root: {}, selected: false, - itemsPerPage: inboxState.itemsPerPage, - inboxSectionVisible: false, }; this.onChange = this.onChange.bind(this); - this.onClickInbox = this.onClickInbox.bind(this); } componentDidMount() { CollectionStore.listen(this.onChange); - InboxStore.listen(this.onChange); CollectionActions.fetchLockedCollectionRoots(); CollectionActions.fetchUnsharedCollectionRoots(); CollectionActions.fetchSharedCollectionRoots(); CollectionActions.fetchRemoteCollectionRoots(); CollectionActions.fetchSyncInCollectionRoots(); - InboxActions.fetchInboxCount(); } componentWillUnmount() { CollectionStore.unlisten(this.onChange); - InboxStore.unlisten(this.onChange); } handleSectionToggle = (visible) => { this.setState((prevState) => ({ [visible]: !prevState[visible], - inboxSectionVisible: false })); }; @@ -76,29 +59,6 @@ export default class CollectionTree extends React.Component { this.setState(state); } - onClickInbox() { - const { - inboxSectionVisible, inbox, currentPage, itemsPerPage - } = this.state; - this.setState({ - inboxSectionVisible: !inboxSectionVisible, - ownCollectionVisible: false, - sharedToCollectionVisible: false, - sharedWithCollectionVisible: false, - syncCollectionVisible: false, - }); - if (!inbox.children) { - LoadingActions.start(); - InboxActions.fetchInbox({ currentPage, itemsPerPage }); - } - } - - refreshInbox() { - const { currentPage, itemsPerPage } = this.state; - LoadingActions.start(); - InboxActions.fetchInbox({ currentPage, itemsPerPage }); - } - lockedSubtrees() { const roots = this.state.lockedRoots; @@ -186,49 +146,6 @@ export default class CollectionTree extends React.Component { false, sharedWithCollectionVisible) } - inboxSubtrees() { - const { inbox, itemsPerPage } = this.state; - - let boxes = ''; - if (inbox.children) { - inbox.children.sort((a, b) => { - if (a.name > b.name) { return 1; } if (a.name < b.name) { return -1; } return 0; - }); - boxes = inbox.children.map((deviceBox) => ( - - )); - } - - return ( -
-
{ - if (e.key === 'Enter' || e.key === ' ') { - InboxActions.showInboxModal(); - } - }} - > - {boxes} - {inbox.children && inbox.children.length >= itemsPerPage ? ( -
- -
- ) : ''} -
- {inbox.unlinked_attachments ? ( - - ) : ''} -
- ); - } - remoteSyncInSubtrees() { let { syncInRoots, syncCollectionVisible } = this.state syncInRoots = this.removeOrphanRoots(syncInRoots) @@ -344,10 +261,9 @@ export default class CollectionTree extends React.Component { } render() { - const { ownCollectionVisible, inboxSectionVisible } = this.state; + const { ownCollectionVisible } = this.state; const ownCollectionDisplay = ownCollectionVisible ? '' : 'none'; - const inboxDisplay = inboxSectionVisible ? '' : 'none'; return (
@@ -376,32 +292,6 @@ export default class CollectionTree extends React.Component {
{this.remoteSyncInSubtrees()}
-
-
- - { - this.state.numberOfAttachments > 0 ? {this.state.numberOfAttachments} : '' - } - this.refreshInbox()} /> - Show larger Inbox}> -