fix: Correct process metadata loading in modal. (#210)
parent
2e036e2034
commit
ef26f3055d
|
@ -30,7 +30,7 @@ export function getProcess(uuid, isConvert = true) {
|
|||
|
||||
export function getBrowser(uuid, isConvert = true) {
|
||||
return Instance.call(this).requestBrowser({
|
||||
uuid: uuid,
|
||||
uuid,
|
||||
isConvertedMetadata: isConvert,
|
||||
isConvertedFields: true
|
||||
})
|
||||
|
@ -38,7 +38,7 @@ export function getBrowser(uuid, isConvert = true) {
|
|||
|
||||
export function getTab(uuid, childrenFields = true, isConvert = true) {
|
||||
return Instance.call(this).requestTab({
|
||||
uuid: uuid,
|
||||
uuid,
|
||||
isWithFields: childrenFields,
|
||||
isConvertedMetadata: isConvert,
|
||||
isConvertedFields: true
|
||||
|
|
|
@ -320,7 +320,10 @@ export const contextMixin = {
|
|||
if (action.type === 'process') {
|
||||
this.$store.dispatch('setShowDialog', {
|
||||
type: action.type,
|
||||
action: action
|
||||
action: {
|
||||
...action,
|
||||
containerUuid: action.uuid
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
@ -141,13 +141,14 @@ export default {
|
|||
contextFieldTitle: 'Context Information'
|
||||
},
|
||||
views: {
|
||||
SmartBrowser: 'Smart Browser',
|
||||
Process: 'Process',
|
||||
Window: 'Window',
|
||||
Report: 'Report',
|
||||
Workflow: 'Workflow',
|
||||
Task: 'Task',
|
||||
Form: 'Form',
|
||||
browser: 'Smart Browser',
|
||||
smartBrowser: 'Smart Browser',
|
||||
process: 'Process',
|
||||
window: 'Window',
|
||||
report: 'Report',
|
||||
workflow: 'Workflow',
|
||||
task: 'Task',
|
||||
form: 'Form',
|
||||
noProcess: 'Not process running',
|
||||
logs: 'Summary',
|
||||
log: 'Summary',
|
||||
|
|
|
@ -141,13 +141,14 @@ export default {
|
|||
contextFieldTitle: 'Información de Contexto'
|
||||
},
|
||||
views: {
|
||||
SmartBrowser: 'Consulta Inteligente',
|
||||
Process: 'Proceso',
|
||||
Window: 'Ventana',
|
||||
Report: 'Reporte',
|
||||
Workflow: 'Flujo de Trabajo',
|
||||
Task: 'Tarea',
|
||||
Form: 'Formulario',
|
||||
browser: 'Consulta Inteligente',
|
||||
smartBrowser: 'Consulta Inteligente',
|
||||
process: 'Proceso',
|
||||
window: 'Ventana',
|
||||
report: 'Reporte',
|
||||
workflow: 'Flujo de Trabajo',
|
||||
task: 'Tarea',
|
||||
form: 'Formulario',
|
||||
noProcess: 'No hay procesos en ejecución',
|
||||
logs: 'Resumen',
|
||||
log: 'Bitacora',
|
||||
|
|
|
@ -106,17 +106,19 @@ const browser = {
|
|||
if (process) {
|
||||
actions.push({
|
||||
type: 'process',
|
||||
panelType: 'process',
|
||||
uuid: process.uuid,
|
||||
name: process.name,
|
||||
description: process.description,
|
||||
isReport: process.isReport,
|
||||
isDirectPrint: process.isDirectPrint
|
||||
})
|
||||
// add process associated in vuex store
|
||||
dispatch('addProcessAssociated', {
|
||||
processToGenerate: process,
|
||||
containerUuidAssociated: newBrowser.uuid
|
||||
})
|
||||
// TODO: No list of parameters
|
||||
// // add process associated in vuex store
|
||||
// dispatch('addProcessAssociated', {
|
||||
// processToGenerate: process,
|
||||
// containerUuidAssociated: newBrowser.uuid
|
||||
// })
|
||||
}
|
||||
|
||||
dispatch('addPanel', newBrowser)
|
||||
|
|
|
@ -20,6 +20,9 @@ const panel = {
|
|||
addPanel(state, payload) {
|
||||
state.panel.push(payload)
|
||||
},
|
||||
changePanel(state, payload) {
|
||||
payload.panel = payload.newPanel
|
||||
},
|
||||
changeFieldLogic(state, payload) {
|
||||
if (payload.isDisplayedFromLogic !== undefined) {
|
||||
payload.field.isDisplayedFromLogic = payload.isDisplayedFromLogic
|
||||
|
@ -34,9 +37,6 @@ const panel = {
|
|||
dictionaryResetCache(state) {
|
||||
state.panel = []
|
||||
},
|
||||
changePanel(state, payload) {
|
||||
payload.panel = payload.newPanel
|
||||
},
|
||||
changeFieldList(state, payload) {
|
||||
payload.fieldList = payload.newFieldList
|
||||
},
|
||||
|
@ -63,38 +63,42 @@ const panel = {
|
|||
let selectionColumn = []
|
||||
let identifierColumns = []
|
||||
let count = 0
|
||||
params.fieldList.forEach(itemField => {
|
||||
if (itemField.isKey) {
|
||||
keyColumn = itemField.columnName
|
||||
}
|
||||
if (itemField.isSelectionColumn) {
|
||||
selectionColumn.push(itemField.columnName)
|
||||
}
|
||||
if (itemField.isIdentifier) {
|
||||
identifierColumns.push({
|
||||
columnName: itemField.columnName,
|
||||
identifierSequence: itemField.identifierSequence,
|
||||
componentPath: itemField.componentPath
|
||||
})
|
||||
}
|
||||
|
||||
if (params.panelType === 'table' || params.isAdvancedQuery) {
|
||||
itemField.isShowedFromUser = false
|
||||
if (count < 2 && itemField.isSelectionColumn && itemField.sequence >= 10) {
|
||||
itemField.isShowedFromUser = true
|
||||
count++
|
||||
if (params.fieldList) {
|
||||
params.fieldList.forEach(itemField => {
|
||||
if (itemField.isKey) {
|
||||
keyColumn = itemField.columnName
|
||||
}
|
||||
} else {
|
||||
if (params.isParentTab) {
|
||||
dispatch('setContext', {
|
||||
parentUuid: params.parentUuid,
|
||||
containerUuid: params.uuid,
|
||||
if (itemField.isSelectionColumn) {
|
||||
selectionColumn.push(itemField.columnName)
|
||||
}
|
||||
if (itemField.isIdentifier) {
|
||||
identifierColumns.push({
|
||||
columnName: itemField.columnName,
|
||||
value: itemField.value
|
||||
identifierSequence: itemField.identifierSequence,
|
||||
componentPath: itemField.componentPath
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
if (params.panelType === 'table' || params.isAdvancedQuery) {
|
||||
itemField.isShowedFromUser = false
|
||||
if (count < 2 && itemField.isSelectionColumn && itemField.sequence >= 10) {
|
||||
itemField.isShowedFromUser = true
|
||||
count++
|
||||
}
|
||||
} else {
|
||||
if (params.isParentTab) {
|
||||
dispatch('setContext', {
|
||||
parentUuid: params.parentUuid,
|
||||
containerUuid: params.uuid,
|
||||
columnName: itemField.columnName,
|
||||
value: itemField.value
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
params.fieldList = assignedGroup(params.fieldList)
|
||||
}
|
||||
|
||||
params.keyColumn = keyColumn
|
||||
if (params.isSortTab) {
|
||||
|
@ -111,7 +115,6 @@ const panel = {
|
|||
})
|
||||
|
||||
params.recordUuid = null
|
||||
params.fieldList = assignedGroup(params.fieldList)
|
||||
|
||||
commit('addPanel', params)
|
||||
},
|
||||
|
@ -715,47 +718,44 @@ const panel = {
|
|||
}
|
||||
commit('changeFieldValue', newField)
|
||||
},
|
||||
getPanelAndFields({ dispatch }, parameters) {
|
||||
if (parameters.panelType === 'process' || parameters.panelType === 'report') {
|
||||
return dispatch('getProcessFromServer', parameters)
|
||||
.then(response => {
|
||||
return response
|
||||
})
|
||||
.catch(error => {
|
||||
return {
|
||||
...error,
|
||||
moreInfo: `Dictionary getPanelAndFields ${parameters.panelType} (State Panel)`,
|
||||
parameters: parameters
|
||||
}
|
||||
})
|
||||
} else if (parameters.panelType === 'browser') {
|
||||
return dispatch('getBrowserFromServer', parameters)
|
||||
.then(response => {
|
||||
return response
|
||||
})
|
||||
.catch(error => {
|
||||
return {
|
||||
...error,
|
||||
moreInfo: 'Dictionary getPanelAndFields browser (State Panel)',
|
||||
parameters: parameters
|
||||
}
|
||||
})
|
||||
} else if (parameters.panelType === 'window' || parameters.panelType === 'table') {
|
||||
return dispatch('getTabAndFieldFromServer', {
|
||||
parentUuid: parameters.parentUuid,
|
||||
containerUuid: parameters.containerUuid,
|
||||
isAdvancedQuery: parameters.isAdvancedQuery,
|
||||
panelType: parameters.panelType
|
||||
}).then(response => {
|
||||
return response
|
||||
}).catch(error => {
|
||||
getPanelAndFields({ dispatch }, {
|
||||
parentUuid,
|
||||
containerUuid,
|
||||
panelType,
|
||||
routeToDelete,
|
||||
isAdvancedQuery = false
|
||||
}) {
|
||||
let executeAction
|
||||
switch (panelType) {
|
||||
case 'process':
|
||||
case 'report':
|
||||
executeAction = 'getProcessFromServer'
|
||||
break
|
||||
case 'browser':
|
||||
executeAction = 'getBrowserFromServer'
|
||||
break
|
||||
case 'window':
|
||||
case 'table':
|
||||
default:
|
||||
executeAction = 'getTabAndFieldFromServer'
|
||||
break
|
||||
}
|
||||
|
||||
return dispatch(executeAction, {
|
||||
parentUuid,
|
||||
containerUuid,
|
||||
isAdvancedQuery,
|
||||
routeToDelete
|
||||
})
|
||||
.then(panelResponse => {
|
||||
return panelResponse
|
||||
})
|
||||
.catch(error => {
|
||||
return {
|
||||
...error,
|
||||
moreInfo: 'Dictionary getPanelAndFields Window (State Panel)',
|
||||
parameters: parameters
|
||||
moreInfo: `Dictionary getPanelAndFields ${panelType} (State Panel)`
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
showedTotals({ commit, getters }, containerUuid) {
|
||||
const panel = getters.getPanel(containerUuid)
|
||||
|
|
|
@ -421,15 +421,15 @@ const processControl = {
|
|||
setShowDialog({ state, commit, dispatch, rootGetters }, params) {
|
||||
const panels = ['process', 'report', 'window']
|
||||
if (params.action && (panels.includes(params.type) || panels.includes(params.action.panelType))) {
|
||||
if (params.action.containerUuid === state.metadata.containerUuid) {
|
||||
if (state.metadata && state.metadata.containerUuid === params.action.containerUuid) {
|
||||
commit('setShowDialog', true)
|
||||
return
|
||||
}
|
||||
const panel = rootGetters.getPanel(params.action.containerUuid)
|
||||
if (!panel) {
|
||||
if (panel === undefined) {
|
||||
dispatch('getPanelAndFields', {
|
||||
parentUuid: params.action.parentUuid,
|
||||
containerUuid: params.action.containerUuid,
|
||||
containerUuid: params.action.containerUuid || params.action.uuid,
|
||||
panelType: params.action.panelType
|
||||
})
|
||||
.then(response => {
|
||||
|
|
|
@ -151,6 +151,7 @@ const window = {
|
|||
tabAssociatedUuid: tab.uuid, // tab source
|
||||
tabAssociatedName: tab.name, // tab source
|
||||
action: 'orderSequence',
|
||||
panelType: 'window',
|
||||
type: 'application'
|
||||
}
|
||||
})
|
||||
|
@ -163,15 +164,18 @@ const window = {
|
|||
// get processess associated in tab
|
||||
if (tabItem.processesList && tabItem.processesList.length) {
|
||||
const processList = tabItem.processesList.map(processItem => {
|
||||
dispatch('addProcessAssociated', {
|
||||
processToGenerate: processItem,
|
||||
containerUuidAssociated: tabItem.uuid
|
||||
})
|
||||
// TODO: No list of parameters
|
||||
// // add process associated in vuex store
|
||||
// dispatch('addProcessAssociated', {
|
||||
// processToGenerate: processItem,
|
||||
// containerUuidAssociated: tabItem.uuid
|
||||
// })
|
||||
return {
|
||||
id: processItem.id,
|
||||
uuid: processItem.uuid,
|
||||
name: processItem.name,
|
||||
type: 'process',
|
||||
panelType: 'process',
|
||||
description: processItem.description,
|
||||
help: processItem.help,
|
||||
isReport: processItem.isReport,
|
||||
|
|
|
@ -152,41 +152,45 @@ export function generateProcess({ processToGenerate, containerUuidAssociated = u
|
|||
}
|
||||
|
||||
// Convert from gRPC
|
||||
const fieldsRangeList = []
|
||||
let fieldDefinitionList = processToGenerate.parametersList
|
||||
.map(fieldItem => {
|
||||
const field = generateField(fieldItem, additionalAttributes)
|
||||
// Add new field if is range number
|
||||
if (field.isRange && field.componentPath === 'FieldNumber') {
|
||||
const fieldRange = generateField(fieldItem, additionalAttributes, true)
|
||||
if (!isEmptyValue(fieldRange.value)) {
|
||||
fieldRange.isShowedFromUser = true
|
||||
let fieldDefinitionList
|
||||
if (processToGenerate.parametersList) {
|
||||
const fieldsRangeList = []
|
||||
|
||||
fieldDefinitionList = processToGenerate.parametersList
|
||||
.map(fieldItem => {
|
||||
const field = generateField(fieldItem, additionalAttributes)
|
||||
// Add new field if is range number
|
||||
if (field.isRange && field.componentPath === 'FieldNumber') {
|
||||
const fieldRange = generateField(fieldItem, additionalAttributes, true)
|
||||
if (!isEmptyValue(fieldRange.value)) {
|
||||
fieldRange.isShowedFromUser = true
|
||||
}
|
||||
fieldsRangeList.push(fieldRange)
|
||||
}
|
||||
fieldsRangeList.push(fieldRange)
|
||||
}
|
||||
|
||||
// if field with value displayed in main panel
|
||||
if (!isEmptyValue(field.value)) {
|
||||
field.isShowedFromUser = true
|
||||
}
|
||||
|
||||
return field
|
||||
})
|
||||
fieldDefinitionList = fieldDefinitionList.concat(fieldsRangeList)
|
||||
|
||||
// Get dependent fields
|
||||
fieldDefinitionList
|
||||
.filter(field => field.parentFieldsList && field.isActive)
|
||||
.forEach((field, index, list) => {
|
||||
field.parentFieldsList.forEach(parentColumnName => {
|
||||
var parentField = list.find(parentField => {
|
||||
return parentField.columnName === parentColumnName && parentColumnName !== field.columnName
|
||||
})
|
||||
if (parentField) {
|
||||
parentField.dependentFieldsList.push(field.columnName)
|
||||
// if field with value displayed in main panel
|
||||
if (!isEmptyValue(field.value)) {
|
||||
field.isShowedFromUser = true
|
||||
}
|
||||
|
||||
return field
|
||||
})
|
||||
})
|
||||
fieldDefinitionList = fieldDefinitionList.concat(fieldsRangeList)
|
||||
|
||||
// Get dependent fields
|
||||
fieldDefinitionList
|
||||
.filter(field => field.parentFieldsList && field.isActive)
|
||||
.forEach((field, index, list) => {
|
||||
field.parentFieldsList.forEach(parentColumnName => {
|
||||
var parentField = list.find(parentField => {
|
||||
return parentField.columnName === parentColumnName && parentColumnName !== field.columnName
|
||||
})
|
||||
if (parentField) {
|
||||
parentField.dependentFieldsList.push(field.columnName)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// Default Action
|
||||
const actions = []
|
||||
|
@ -225,6 +229,7 @@ export function generateProcess({ processToGenerate, containerUuidAssociated = u
|
|||
isReport: processToGenerate.isReport,
|
||||
isDirectPrint: processToGenerate.isDirectPrint
|
||||
}
|
||||
|
||||
processToGenerate.reportExportTypeList.forEach(actionValue => {
|
||||
// Push values
|
||||
summaryAction.childs.push({
|
||||
|
@ -240,6 +245,7 @@ export function generateProcess({ processToGenerate, containerUuidAssociated = u
|
|||
reportExportType: actionValue.reportExportType
|
||||
})
|
||||
})
|
||||
|
||||
// Add summary Actions
|
||||
actions.push(summaryAction)
|
||||
|
||||
|
@ -455,39 +461,39 @@ export function convertAction(action) {
|
|||
|
||||
switch (action) {
|
||||
case 'B':
|
||||
actionAttributes.name = 'Workbech'
|
||||
actionAttributes.name = 'workbech'
|
||||
actionAttributes.icon = 'peoples'
|
||||
break
|
||||
case 'F':
|
||||
actionAttributes.name = 'Workflow'
|
||||
actionAttributes.name = 'workflow'
|
||||
actionAttributes.icon = 'example'
|
||||
break
|
||||
case 'P':
|
||||
actionAttributes.name = 'Process'
|
||||
actionAttributes.name = 'process'
|
||||
actionAttributes.icon = 'component'
|
||||
actionAttributes.component = () => import('@/views/ADempiere/Process')
|
||||
break
|
||||
case 'R':
|
||||
actionAttributes.name = 'Report'
|
||||
actionAttributes.name = 'report'
|
||||
actionAttributes.icon = 'skill'
|
||||
actionAttributes.component = () => import('@/views/ADempiere/Process')
|
||||
break
|
||||
case 'S':
|
||||
actionAttributes.name = 'Browser'
|
||||
actionAttributes.name = 'browser'
|
||||
actionAttributes.icon = 'search'
|
||||
actionAttributes.component = () => import('@/views/ADempiere/Browser')
|
||||
break
|
||||
case 'T':
|
||||
actionAttributes.name = 'Task'
|
||||
actionAttributes.name = 'task'
|
||||
actionAttributes.icon = 'size'
|
||||
break
|
||||
case 'W':
|
||||
actionAttributes.name = 'Window'
|
||||
actionAttributes.name = 'window'
|
||||
actionAttributes.icon = 'tab'
|
||||
actionAttributes.component = () => import('@/views/ADempiere/Window')
|
||||
break
|
||||
case 'X':
|
||||
actionAttributes.name = 'Form'
|
||||
actionAttributes.name = 'form'
|
||||
actionAttributes.icon = 'form'
|
||||
break
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue