Skip to content

Commit

Permalink
- use included view from listHandler if it exists (#7035)
Browse files Browse the repository at this point in the history
  • Loading branch information
siemiatj committed Jul 20, 2020
1 parent 9367d87 commit a7f8ae3
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions frontend/src/actions/ViewActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,8 @@ export function fetchDocument({

dispatch(updateGridTable(tableId, tableData));

const view = getView(getState(), windowId, isModal);
const state = getState();
const view = getView(state, windowId, isModal);
const openIncludedViewOnSelect =
view.layout &&
view.layout.includedView &&
Expand All @@ -294,15 +295,21 @@ export function fetchDocument({
response.data.result.length
) {
const row = response.data.result[0];
const includedWindowId = row.supportIncludedViews
? state.listHandler.includedView.windowType ||
row.includedView.windowType ||
row.includedView.windowId
: null;
const includedViewId = row.supportIncludedViews
? state.listHandler.includedView.viewId || row.includedView.viewId
: null;

dispatch(
showIncludedView({
id: windowId,
showIncludedView: row.supportIncludedViews,
windowId: row.supportIncludedViews
? row.includedView.windowType || row.includedView.windowId
: null,
viewId: row.supportIncludedViews ? row.includedView.viewId : '',
windowId: includedWindowId,
viewId: includedViewId,
isModal,
})
);
Expand Down

0 comments on commit a7f8ae3

Please sign in to comment.