Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
work in progress #942
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunkat committed Jul 3, 2017
1 parent 1d68f72 commit 8ddb69a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/components/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class Container extends Component {
modalDescription, editmode, handleEditModeToggle
} = this.props;

console.log(includedView);

return (
<div>
{
Expand Down
20 changes: 16 additions & 4 deletions src/components/app/DocumentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ class DocumentList extends Component {
clickOutsideLock: false,
refresh: null,

cachedSelection: null
cachedSelection: null,

isShowIncluded: false,
hasShowIncluded: false
}
this.fetchLayoutAndData();
}
Expand Down Expand Up @@ -455,10 +458,18 @@ class DocumentList extends Component {
}
}

showIncludedViewOnSelect = (showIncludedView) => {
this.setState({
isShowIncluded: showIncludedView ? true : false,
hasShowIncluded: showIncludedView ? true : false
});
console.log(showIncludedView);
}

render() {
const {
layout, data, viewId, clickOutsideLock, refresh, page, filters,
cachedSelection
cachedSelection, isShowIncluded, hasShowIncluded
} = this.state;

const {
Expand All @@ -483,8 +494,8 @@ class DocumentList extends Component {
<div
className={
'document-list-wrapper ' +
(isIncluded ? 'document-list-included ' : '') +
(hasIncluded ? 'document-list-has-included ' : '')
(isShowIncluded || isIncluded ? 'document-list-included ' : '') +
(hasShowIncluded || hasIncluded ? 'document-list-has-included ' : '')
}
>
{!readonly && <div
Expand Down Expand Up @@ -553,6 +564,7 @@ class DocumentList extends Component {
cachedSelection : selected}
queryLimitHit={data.queryLimitHit}
doesSelectionExist={this.doesSelectionExist}
showIncludedViewOnSelect={this.showIncludedViewOnSelect}
{...{isIncluded, disconnectFromState, autofocus,
open, page, closeOverlays, inBackground,
disablePaginationShortcuts, isModal,
Expand Down
2 changes: 2 additions & 0 deletions src/components/app/QuickActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ class QuickActions extends Component {
return;
}

console.log(action);

dispatch(
openModal(
action.caption, action.processId, 'process', null, null, false,
Expand Down
11 changes: 8 additions & 3 deletions src/components/table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ class Table extends Component {
}

handleClickOutside = (event) => {
const { showIncludedViewOnSelect } = this.props;
if(event.target.parentNode !== document &&
!event.target.parentNode.className.includes('notification')) {
const item = event.path;
Expand All @@ -278,6 +279,7 @@ class Table extends Component {
}

this.deselectAllProducts();
showIncludedViewOnSelect(false);
}
}

Expand Down Expand Up @@ -679,7 +681,8 @@ class Table extends Component {
renderTableBody = () => {
const {
tabid, cols, type, docId, readonly, keyProperty, onDoubleClick,
mainTable, newRow, tabIndex, entity, indentSupported, collapsible
mainTable, newRow, tabIndex, entity, indentSupported, collapsible,
showIncludedViewOnSelect
} = this.props;

const {
Expand Down Expand Up @@ -707,8 +710,10 @@ class Table extends Component {
onDoubleClick={() => onDoubleClick &&
onDoubleClick(item[keyProperty])
}
onMouseDown={(e) =>
this.handleClick(e, item[keyProperty])
onMouseDown={(e) => {
this.handleClick(e, item[keyProperty]);
showIncludedViewOnSelect(item.supportIncludedViews)
}
}
handleRightClick={(e, fieldName) =>
this.handleRightClick(
Expand Down

0 comments on commit 8ddb69a

Please sign in to comment.