Duplicate Processes (#354)

pull/3759/head
elsiosanchez 2020-02-23 00:06:34 -04:00 committed by GitHub
parent 6ce282c65d
commit 557937349a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 68 deletions

View File

@ -581,12 +581,6 @@ const processControl = {
output
})
dispatch('setReportTypeToShareLink', processResult.output.reportType)
dispatch('getDataListTab', {
parentUuid: params.parentUuid,
containerUuid: params.containerUuid,
isRefreshPanel: true,
recordUuid: params.recordUuid
})
resolve(processResult)
})
.catch(error => {
@ -715,76 +709,37 @@ const processControl = {
outputStream: '',
reportType: ''
}
if (response.getOutput()) {
const responseOutput = response.getOutput()
if (isEmptyValue(response.output)) {
const responseOutput = response.output
output = {
uuid: responseOutput.getUuid(),
name: responseOutput.getName(),
description: responseOutput.getDescription(),
fileName: responseOutput.getFilename(),
mimeType: responseOutput.getMimetype(),
output: responseOutput.getOutput(),
outputStream: responseOutput.getOutputstream(),
reportType: responseOutput.getReporttype()
uuid: responseOutput.uuid,
name: responseOutput.name,
description: responseOutput.description,
fileName: responseOutput.filename,
mimeType: responseOutput.mimeType,
output: responseOutput.output,
outputStream: responseOutput.outputstream,
reportType: responseOutput.reporttype
}
}
var logList = []
if (response.getLogsList()) {
logList = response.getLogsList().map(itemLog => {
if (response.getLogsList) {
logList = response.getLogsList.map(itemLog => {
return {
log: itemLog.getLog(),
recordId: itemLog.getRecordid()
log: itemLog.log,
recordId: itemLog.recordid
}
})
}
var link = {
href: undefined,
download: undefined
}
if (processDefinition.isReport) {
const blob = new Blob(
[output.outputStream],
{ type: output.mimeType }
)
link = document.createElement('a')
link.href = window.URL.createObjectURL(blob)
link.download = output.fileName
if (reportType !== 'pdf' && reportType !== 'html') {
link.click()
}
// Report views List to context menu
var reportViewList = {
name: language.t('views.reportView'),
type: 'summary',
action: '',
childs: [],
option: 'reportView'
}
reportViewList.childs = getters.getReportViewList(processResult.processUuid)
if (!reportViewList.childs.length) {
dispatch('requestReportViews', {
processUuid: processResult.processUuid
})
.then(response => {
reportViewList.childs = response
// Get contextMenu metadata and concat print report views with contextMenu actions
var contextMenuMetadata = rootGetters.getContextMenu(processResult.processUuid)
contextMenuMetadata.actions.push(reportViewList)
})
}
}
// assign new attributes
Object.assign(processResult, {
instanceUuid: response.getInstanceuuid(),
url: link.href,
download: link.download,
isError: response.getIserror(),
isProcessing: response.getIsprocessing(),
summary: response.getSummary(),
ResultTableName: response.getResulttablename(),
lastRun: response.getLastrun(),
instanceUuid: response.instanceUuid,
isError: response.isError,
isProcessing: response.isProcessing,
summary: response.summary,
ResultTableName: response.resulttablename,
lastRun: response.lastRun,
logs: logList,
output: output
})

View File

@ -1,8 +1,8 @@
<template>
<div v-if="getRunProcessAll.length" key="with-process" class="app-container">
<div v-if="!isEmptyValue(getProcessLog)" key="with-process" class="app-container">
<el-timeline>
<el-timeline-item
v-for="(activity, index) in getRunProcessAll"
v-for="(activity, index) in getProcessLog"
:key="index"
:timestamp="translateDate(activity.lastRun)"
placement="top"
@ -53,7 +53,7 @@
</el-popover>
<!-- show only when bring logs -->
<el-popover
v-else-if="activity.logsList.length > 0 || activity.summary"
v-else-if="!isEmptyValue(activity.logsList) || !isEmptyValue(activity.summary)"
:key="index + 'is-summary'"
placement="right"
width="500"
@ -173,6 +173,14 @@ export default {
return new Date(a.lastRun) - new Date(b.lastRun)
}).reverse()
},
getProcessLog() {
var log = this.getRunProcessAll.filter(element => {
if (element.isError !== undefined && (element.isProcessing !== undefined)) {
return element
}
})
return log
},
language() {
return this.$store.getters.language
},