From f446bf61421ec9e4d47e5f170341e1f61a5d7350 Mon Sep 17 00:00:00 2001 From: elsiosanchez <45974454+elsiosanchez@users.noreply.github.com> Date: Wed, 29 Jan 2020 17:26:25 -0400 Subject: [PATCH] add popover of Workflow log (#284) * Add popover to Workflow Log * delete italic format * change funtion --- src/lang/ADempiere/en.js | 8 +- src/lang/ADempiere/es.js | 8 +- src/store/modules/ADempiere/containerInfo.js | 1 - src/utils/ADempiere/valueUtils.js | 144 +++++++++---------- src/views/ADempiere/Window/index.vue | 129 ++++++++++------- 5 files changed, 165 insertions(+), 125 deletions(-) diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index ba677832..336be364 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -273,7 +273,13 @@ export default { notes: 'Notes', changeLog: 'Change Log', workflowLog: 'Workflow Log', - changeDetail: 'Detalle del cambio' + changeDetail: 'Detalle del cambio', + logWorkflow: { + message: 'Message', + responsible: 'Responsible', + workflowName: 'Name of Workflow Status', + timeElapsed: 'Time Elapsed' + } } }, data: { diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js index 066c08d1..f32e0fb0 100644 --- a/src/lang/ADempiere/es.js +++ b/src/lang/ADempiere/es.js @@ -248,7 +248,13 @@ export default { notes: 'Notas', changeLog: 'Histórico de Cambios', workflowLog: 'Histórico de Flujo de Trabajo', - changeDetail: 'Detalle del cambio' + changeDetail: 'Detalle del cambio', + logWorkflow: { + message: 'Mensaje', + responsible: 'Responsable', + workflowName: 'Nombre de estado del flujo de trabajo', + timeElapsed: 'Tiempo transcurrido' + } } }, data: { diff --git a/src/store/modules/ADempiere/containerInfo.js b/src/store/modules/ADempiere/containerInfo.js index 714249f9..383ed16e 100644 --- a/src/store/modules/ADempiere/containerInfo.js +++ b/src/store/modules/ADempiere/containerInfo.js @@ -53,7 +53,6 @@ const containerInfo = { const pageToken = 0 return requestListWorkflows({ tableName, pageSize, pageToken }) .then(response => { - console.log(response) commit('addListWorkflows', response) }) .catch(error => { diff --git a/src/utils/ADempiere/valueUtils.js b/src/utils/ADempiere/valueUtils.js index f0c7a4a5..a8582423 100644 --- a/src/utils/ADempiere/valueUtils.js +++ b/src/utils/ADempiere/valueUtils.js @@ -205,6 +205,77 @@ export function convertFieldListToShareLink(fieldList) { return attributesListLink.slice(0, -1) } +/** + * Find element in an array recursively + * @param {object|array} treeData + * @param {string} attributeName, key to get value, default id + * @param {mixed} attributeValue, value to compare with search + * @param {string} attributeChilds, childs list into element + */ +export const recursiveTreeSearch = ({ + treeData, + attributeValue, + attributeName = 'id', + secondAttribute = false, + attributeChilds = 'childsList', + isParent = false +}) => { + if (Array.isArray(treeData)) { + let index = 0 + const length = treeData.length + while (index < length) { + let value = treeData[index] + if (!isEmptyValue(value) && value.hasOwnProperty(attributeName)) { + value = value[attributeName] + } + if (!isEmptyValue(value) && secondAttribute && value.hasOwnProperty(secondAttribute)) { + value = value[secondAttribute] + } + + // compare item to search + if (value === attributeValue) { + return treeData[index] + } + + if (treeData[index] && treeData[index][attributeChilds]) { + const found = recursiveTreeSearch({ + treeData: treeData[index][attributeChilds], + attributeValue, + attributeName, + secondAttribute, + attributeChilds, + isParent + }) + if (found) { + return found + } + } + index++ + } + } else { + let value = treeData + if (!isEmptyValue(value) && value.hasOwnProperty(attributeName)) { + value = value[attributeName] + } + if (!isEmptyValue(value) && secondAttribute && value.hasOwnProperty(secondAttribute)) { + value = value[secondAttribute] + } + + // compare item to search + if (value === attributeValue) { + return treeData + } + + const found = recursiveTreeSearch({ + treeData: treeData[attributeChilds], + attributeValue, + attributeName, + secondAttribute, + attributeChilds + }) + return found + } +} /** * @@ -290,76 +361,3 @@ export function parsedValueComponent({ fieldType, value, referenceType, isMandat } return returnValue } - -/** - * Find element in an array recursively - * @param {object|array} treeData - * @param {string} attributeName, key to get value, default id - * @param {mixed} attributeValue, value to compare with search - * @param {string} attributeChilds, childs list into element - */ -export const recursiveTreeSearch = ({ - treeData, - attributeValue, - attributeName = 'id', - secondAttribute = false, - attributeChilds = 'childsList', - isParent = false -}) => { - if (Array.isArray(treeData)) { - let index = 0 - const length = treeData.length - while (index < length) { - // ESTA MIERDA NO SIRVE PORQUE LOS ATRIBTO - let value = treeData[index] - if (!isEmptyValue(value) && value.hasOwnProperty(attributeName)) { - value = value[attributeName] - } - if (!isEmptyValue(value) && secondAttribute && value.hasOwnProperty(secondAttribute)) { - value = value[secondAttribute] - } - - // compare item to search - if (value === attributeValue) { - return treeData[index] - } - - if (treeData[index] && treeData[index][attributeChilds]) { - const found = recursiveTreeSearch({ - treeData: treeData[index][attributeChilds], - attributeValue, - attributeName, - secondAttribute, - attributeChilds, - isParent - }) - if (found) { - return found - } - } - index++ - } - } else { - let value = treeData - if (!isEmptyValue(value) && value.hasOwnProperty(attributeName)) { - value = value[attributeName] - } - if (!isEmptyValue(value) && secondAttribute && value.hasOwnProperty(secondAttribute)) { - value = value[secondAttribute] - } - - // compare item to search - if (value === attributeValue) { - return treeData - } - - const found = recursiveTreeSearch({ - treeData: treeData[attributeChilds], - attributeValue, - attributeName, - secondAttribute, - attributeChilds - }) - return found - } -} diff --git a/src/views/ADempiere/Window/index.vue b/src/views/ADempiere/Window/index.vue index 1f2fd555..488edc76 100644 --- a/src/views/ADempiere/Window/index.vue +++ b/src/views/ADempiere/Window/index.vue @@ -21,12 +21,14 @@ :icon="iconIsShowedRecordNavigation" circle style="margin-left: 10px;" + class="el-button-window" @click="handleChangeShowedRecordNavigation()" /> @@ -42,6 +44,7 @@ v-show="isPanel" icon="el-icon-caret-left" circle + class="el-button-window" @click="handleChangeShowedPanel()" /> @@ -77,7 +80,7 @@ class="tab-window" />
- +
@@ -92,6 +95,7 @@ icon="el-icon-caret-top" :class="classIsMobile" circle + type="primary" @click="handleChangeShowedTabChildren()" />
@@ -108,6 +112,7 @@ :icon="iconIsShowedRecordNavigation" class="open-navegation" circle + type="primary" @click="handleChangeShowedRecordNavigation()" />
@@ -124,6 +129,7 @@ @@ -145,7 +151,7 @@
- +
@@ -163,7 +169,7 @@ v-for="(listLogs, index) in getTypeLogs" :key="index" > - +
-

{{ evenType.displayColumnName }}: {{ evenType.oldDisplayValue }} {{ evenType.newDisplayValue }}

+

{{ evenType.displayColumnName }}: {{ evenType.oldDisplayValue }} {{ evenType.newDisplayValue }}

@@ -208,35 +214,49 @@ - - - -
- {{ workflow.workflowName }} -
-
- - - -
-
-
-
+ + + + +
+ {{ workflow.workflowName }} +
+
+ + + + +

{{ $t('login.userName') }}: {{ nodeList.userName }}

+

{{ $t('window.containerInfo.logWorkflow.message') }}: {{ nodeList.textMessage }}

+

{{ $t('window.containerInfo.logWorkflow.responsible') }}: {{ nodeList.responsibleName }}

+

{{ $t('window.containerInfo.logWorkflow.workflowName') }}: {{ nodeList.workflowStateName }}

+

{{ $t('window.containerInfo.logWorkflow.timeElapsed') }}: {{ nodeList.timeElapsed }}

+ {{ nodeList.nodeName }} +
+
+
+
+
+
+
+
+
{{ $t('window.containerInfo.notes') }} {{ gettersLisRecordChats[0].description }}
- - - -
- {{ chats.userName }} - {{ chats.characterData }} -
-
-
-
+ + + + +
+ {{ chats.userName }} + {{ chats.characterData }} +
+
+
+
+