From b7fd94f297785fa00a13c5fe58994a0c08b09043 Mon Sep 17 00:00:00 2001 From: Katarzyna Dunikowska Date: Fri, 21 Apr 2017 10:00:54 +0200 Subject: [PATCH] Change /rest/api/pattribute request message #667 --- src/actions/AppActions.js | 6 ++++-- src/components/widget/Attributes/Attributes.js | 5 +++-- src/components/widget/RawWidget.js | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/actions/AppActions.js b/src/actions/AppActions.js index dbbe04518..036f71828 100644 --- a/src/actions/AppActions.js +++ b/src/actions/AppActions.js @@ -169,12 +169,14 @@ export function markAsRead(id) { // Attribute widget backend export function getAttributesInstance( - attrType, tmpId, docType, docId, tabId, rowId, fieldName + attrType, tmpId, docType, docId, tabId, rowId, fieldName, entity ) { + const type = entity === 'process' ? 'processId':'windowId'; + return () => axios.post(config.API_URL + '/' + attrType, { 'templateId': tmpId, 'source': { - 'documentType': docType, + [type] : docType, 'documentId': docId, 'tabid': tabId, 'rowId': rowId, diff --git a/src/components/widget/Attributes/Attributes.js b/src/components/widget/Attributes/Attributes.js index d7b68904f..4f2000756 100644 --- a/src/components/widget/Attributes/Attributes.js +++ b/src/components/widget/Attributes/Attributes.js @@ -69,13 +69,14 @@ class Attributes extends Component { handleInit = () => { const { dispatch, docType, dataId, tabId, rowId, fieldName, attributeType, - widgetData + widgetData, entity } = this.props; const tmpId = Object.keys(widgetData.value)[0]; dispatch( getAttributesInstance( - attributeType, tmpId, docType, dataId, tabId, rowId, fieldName + attributeType, tmpId, docType, dataId, tabId, rowId, fieldName, + entity ) ).then(response => { const {id, fields} = response.data; diff --git a/src/components/widget/RawWidget.js b/src/components/widget/RawWidget.js index 9cac90ee1..7cecba8dd 100644 --- a/src/components/widget/RawWidget.js +++ b/src/components/widget/RawWidget.js @@ -590,6 +590,7 @@ class RawWidget extends Component { case 'ProductAttributes': return (