diff --git a/src/actions/AppActions.js b/src/actions/AppActions.js index d06cc278f..9bbe240c8 100644 --- a/src/actions/AppActions.js +++ b/src/actions/AppActions.js @@ -56,15 +56,26 @@ export function deleteView( export function createViewRequest( windowType, viewType, pageLength, filters, refDocType = null, - refDocId = null + refDocId = null, refTabId = null, refRowIds = null ){ + let referencing = null; + + if (refDocType && refDocId) { + referencing = { + 'documentType': refDocType, + 'documentId': refDocId + }; + + if (refTabId && refRowIds) { + referencing.tabId = refTabId; + referencing.rowIds = refRowIds; + } + } + return axios.post(config.API_URL + '/documentView/' + windowType, { 'documentType': windowType, 'viewType': viewType, - 'referencing': (refDocType && refDocId) ? { - 'documentType': refDocType, - 'documentId': refDocId - }: null, + 'referencing': referencing, 'filters': filters }); } diff --git a/src/components/app/DocumentList.js b/src/components/app/DocumentList.js index 32bba244d..53e9775a5 100644 --- a/src/components/app/DocumentList.js +++ b/src/components/app/DocumentList.js @@ -326,13 +326,13 @@ class DocumentList extends Component { createView = () => { const { - windowType, type, refType, refId + windowType, type, refType, refId, refTabId, refRowIds } = this.props; const {page, sort, filters} = this.state; createViewRequest( - windowType, type, this.pageLength, filters, refType, refId + windowType, type, this.pageLength, filters, refType, refId, refTabId, refRowIds ).then(response => { this.mounted && this.setState({ data: response.data, diff --git a/src/components/table/TableContextMenu.js b/src/components/table/TableContextMenu.js index 567a3dd1b..65140fb94 100644 --- a/src/components/table/TableContextMenu.js +++ b/src/components/table/TableContextMenu.js @@ -68,12 +68,14 @@ class TableContextMenu extends Component { handleReferenceClick = (refType, filter) => { const { - dispatch, type, docId + dispatch, type, docId, tabId, selected } = this.props; dispatch(setFilter(filter, refType)); window.open('/window/' + refType + '?refType=' + type + - '&refId=' + docId, + '&refId=' + docId + + '&refTabId=' + tabId + + '&refRowIds=' + JSON.stringify(selected || []), '_blank'); } diff --git a/src/containers/DocList.js b/src/containers/DocList.js index 97d457c6b..56366d5af 100644 --- a/src/containers/DocList.js +++ b/src/containers/DocList.js @@ -80,6 +80,16 @@ class DocList extends Component { modalTitle, notfound, modalDescription } = this.state; + let refRowIds = []; + if (query && query.refRowIds) { + try { + refRowIds = JSON.parse(query.refRowIds); + } + catch (e) { + refRowIds = []; + } + } + return (