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

Commit

Permalink
Provides details for inline rows zoom requests (tabId, rowIds) #1041
Browse files Browse the repository at this point in the history
  • Loading branch information
wiadev committed Jul 19, 2017
1 parent bb46b39 commit 0c72e61
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
21 changes: 16 additions & 5 deletions src/actions/AppActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/app/DocumentList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 4 additions & 2 deletions src/components/table/TableContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
12 changes: 12 additions & 0 deletions src/containers/DocList.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<Container
entity="documentView"
Expand All @@ -100,6 +110,8 @@ class DocList extends Component {
defaultPage={parseInt(query.page)}
refType={query.refType}
refId={query.refId}
refTabId={query.refTabId}
refRowIds={refRowIds}
selectedWindowType={selectedWindowType}
selected={selected}
inBackground={rawModal.visible}
Expand Down

0 comments on commit 0c72e61

Please sign in to comment.