diff --git a/src/components/app/DocumentList.js b/src/components/app/DocumentList.js index 7fd5c8a05..a0d57a473 100644 --- a/src/components/app/DocumentList.js +++ b/src/components/app/DocumentList.js @@ -136,6 +136,13 @@ class DocumentList extends Component { }) } } + + if( + JSON.stringify(selected) != JSON.stringify(this.props.selected) && + includedView && includedView.windowType && includedView.viewId + ){ + //TODO: we need here close includedView when supportIncludedView will be available + } } shouldComponentUpdate(nextProps, nextState) { @@ -159,10 +166,14 @@ class DocumentList extends Component { }); } - doesSelectionExist(selected) { + doesSelectionExist(selected, hasIncluded) { const {data} = this.state; // When the rows are changing we should ensure // that selection still exist + + if(hasIncluded){ + return true; + } let rows = []; @@ -358,7 +369,8 @@ class DocumentList extends Component { render() { const { - layout, data, viewId, clickOutsideLock, refresh, page, filters + layout, data, viewId, clickOutsideLock, refresh, page, filters, + cachedSelection } = this.state; const { @@ -367,8 +379,10 @@ class DocumentList extends Component { includedView, children, isIncluded } = this.props; - const selectionValid = this.doesSelectionExist(selected); - + const hasIncluded = true && includedView && + includedView.windowType && includedView.viewId; + const selectionValid = this.doesSelectionExist(selected, hasIncluded); + hasIncluded && console.log(selected) if(layout && data) { return (
@@ -445,9 +459,10 @@ class DocumentList extends Component { closeOverlays={closeOverlays} indentSupported={layout.supportTree} disableOnClickOutside={clickOutsideLock} - defaultSelected={selected} + defaultSelected={cachedSelection ? cachedSelection : selected} queryLimitHit={data.queryLimitHit} doesSelectionExist={this.doesSelectionExist} + inBackground={inBackground} > {layout.supportAttributes && !isIncluded && } - {!layout.supportIncludedView && includedView && - includedView.windowType && includedView.viewId && + {hasIncluded &&
diff --git a/src/components/table/Table.js b/src/components/table/Table.js index 37e1fcaba..d73d7a9f5 100644 --- a/src/components/table/Table.js +++ b/src/components/table/Table.js @@ -57,13 +57,12 @@ class Table extends Component { } componentWillUpdate(nextProps, nextState) { - const {dispatch, type} = this.props; + const {dispatch, type, inBackground} = this.props; if( JSON.stringify(nextState.selected) !== JSON.stringify(this.state.selected) ){ - console.log('tabela') dispatch(selectTableItems(nextState.selected, type)); } }