Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Merge branch 'feature/legacy-support' into cache-multi-tenant
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Jul 11, 2024
2 parents 9bc15fd + fe6e2eb commit dd1a842
Show file tree
Hide file tree
Showing 47 changed files with 780 additions and 326 deletions.
10 changes: 8 additions & 2 deletions src/api/ADempiere/businessData/runBusinessProcess.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@ export function requestRunBusinessProcessAsBrowser({
parametersList,
browserId,
recordId,
selectionsList
selectionsList,
isAllSelection,
browserContextAttributes,
browserCriteriaFilters
}) {
return request({
url: `/business-data/process/${id}/smart-browse/${browserId}`,
method: 'post',
data: {
record_id: recordId,
parameters: parametersList,
selections: selectionsList
selections: selectionsList,
is_all_selection: isAllSelection,
browser_context_attributes: browserContextAttributes,
criteria_filters: browserCriteriaFilters
}
})
}
Expand Down
28 changes: 26 additions & 2 deletions src/api/ADempiere/dictionary/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,34 @@ export function requestIdentifierColumns({
* @returns
*/
export function requestSearchFields({
tableName
fieldId,
processParameterId,
browseFieldId,
columnId,
tableName,
columnName
}) {
let url = `dictionary/search/${tableName}`
switch (true) {
case !isEmptyValue(fieldId):
url = `/dictionary/search/field/${fieldId}`
break
case !isEmptyValue(processParameterId):
url = `/dictionary/search/parameter/${processParameterId}`
break
case !isEmptyValue(browseFieldId):
url = `/dictionary/search/query-criteria/${browseFieldId}`
break
case !isEmptyValue(columnId):
url = `/dictionary/search/column/${columnId}`
break
case (!isEmptyValue(tableName) && !isEmptyValue(columnName)):
url = `/dictionary/search/table/${tableName}/${columnName}`
break
}

return request({
url: `/dictionary/search/${tableName}`,
url: url,
method: 'get'
})
}
6 changes: 3 additions & 3 deletions src/api/ADempiere/field/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ export function requestGridGeneralInfo({
case !isEmptyValue(browseFieldId):
url = `/user-interface/search-records/query-criteria/${browseFieldId}`
break
case (!isEmptyValue(tableName) && !isEmptyValue(columnName)):
url = `/user-interface/search-records/${tableName}/${columnName}`
break
case !isEmptyValue(columnId):
url = `/user-interface/search-records/column/${columnId}`
break
case (!isEmptyValue(tableName) && !isEmptyValue(columnName)):
url = `/user-interface/search-records/${tableName}/${columnName}`
break
}

return request({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
* Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
* Contributor(s): Edwin Betancourt [email protected] https://github.com/EdwinBetanc0urt
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -9,7 +9,7 @@
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
Expand All @@ -34,7 +34,8 @@ export function requestListTabSequences({
url: `/user-interface/tab-sequences/${tabId}`,
method: 'get',
params: {
context_attributes: contextAttributes
context_attributes: contextAttributes,
page_size: 500
}
})
}
Expand All @@ -48,17 +49,15 @@ export function requestListTabSequences({
export function requestSaveTabSequences({
tabId,
// dsl query
contextAttributes
contextAttributes,
entities
}) {
return request({
url: `/user-interface/tab-sequences/${tabId}`,
method: 'post',
data: {
context_attributes: contextAttributes
context_attributes: contextAttributes,
entities
}
})
.then(response => {
const { convertEntityList } = require('@/utils/ADempiere/apiConverts/persistence.js')
return convertEntityList(response)
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ export default defineComponent({
}
listAccoutingElementValues({
accoutingSchemaId: accoutingSchemaId.value,
elementType: props.metadata.elementType,
elementType: props.metadata.element_type,
searchValue: searchQuery,
contextAttributes: attributes
})
Expand All @@ -198,9 +198,9 @@ export default defineComponent({
displayColumn: list.values.DisplayColumn
}
})
// if (!isEmptyValue(optionsList.value) && optionsList.value.length <= 1) {
// displayValue.value = optionsList.value[0].id
// }
if (!isEmptyValue(optionsList.value) && optionsList.value.length <= 1) {
displayValue.value = optionsList.value[0].id
}
})
}, 500)
return
Expand Down Expand Up @@ -229,8 +229,8 @@ export default defineComponent({
}, 500)
}

if (!isEmptyValue(props.defaultValue['DisplayColumn_' + props.metadata.columnName])) {
loadSearch(props.defaultValue['DisplayColumn_' + props.metadata.columnName])
if (!isEmptyValue(props.defaultValue['DisplayColumn_' + props.metadata.column_name])) {
loadSearch(props.defaultValue['DisplayColumn_' + props.metadata.column_name])
}

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.
style="margin: 0px;width: 100%;"
>
<el-input
v-model="metadata.value"
v-model="metadata.fieldValue"
disabled
:placeholder="titleField"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ export default {
})
}
}
},
watch: {
showedPopoverGeneralInfoPanel(value) {
if (value) {
store.dispatch('listAccoutingElementsFromServer')
}
}
}
}
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,19 +413,6 @@ export default defineComponent({
}

function saveAccoutingCombination() {
// const attributes = store.getters.getValuesView({
// containerUuid: uuidForm.value,
// format: 'array'
// }).filter(item => {
// return item.columnName !== 'Combination' &&
// fieldsListElements.value.find(itemDefinition => itemDefinition.columnName === item.columnName)
// }).map(item => {
// return {
// value: item.value,
// key: item.columnName
// }
// })

store.dispatch('saveAccountCombinations', {
id: store.getters.getValueOfField({
containerUuid: props.metadata.containerUuid,
Expand Down Expand Up @@ -540,10 +527,15 @@ export default defineComponent({
}

function getAccoutingElements() {
const accoutingElements = store.getters.getFieldsListAccount
if (isEmptyValue(accoutingElements)) {
store.dispatch('listAccoutingElementsFromServer')
}
// const accoutingElements = store.getters.getFieldsListAccount
// if (isEmptyValue(accoutingElements)) {
store.dispatch('listAccoutingElementsFromServer')
.finally(() => {
setTimeout(() => {
loadCombinations()
}, 500)
})
// }
}

function handleCurrentChange(row) {
Expand All @@ -562,26 +554,27 @@ export default defineComponent({
const { values, table_name } = response
tableNameAccounting.value = table_name
setValuesCombinations.value = values
// combinations.value = values.Combination
fieldsListElements.value.map(list => {
return {
...list,
value: values[list.columnName]
}
fieldsListElements.value.forEach(element => {
store.commit('setFieldsValue', {
columnName: element.column_name,
value: values[element.column_name]
})
})
isLoadingPanel.value = false
// setTimeout(() => {
// isLoadingPanel.value = false
// }, 500)
setTimeout(() => {
isLoadingPanel.value = false
}, 500)
})
.catch(() => {
isLoadingPanel.value = false
setTimeout(() => {
isLoadingPanel.value = false
}, 500)
})
.finally(() => {
isLoadingPanel.value = false
// setTimeout(() => {
// isLoadingPanel.value = false
// }, 500)
setTimeout(() => {
isLoadingPanel.value = false
searchRecordsList()
}, 500)
})
}

Expand All @@ -592,6 +585,7 @@ export default defineComponent({
}

function setPageNumber(pageNumber) {
if (isEmptyValue(pageNumber)) return
searchRecordsList(pageNumber)
}

Expand All @@ -600,7 +594,6 @@ export default defineComponent({
})

getAccoutingElements()
loadCombinations()

return {
TEXT,
Expand Down
26 changes: 16 additions & 10 deletions src/components/ADempiere/FieldDefinition/FieldDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,35 @@ export default {
*/
formatView() {
let format = ''
const currentLanguageDefinition = this.$store.getters['getCurrentLanguageDefinition']
if (!isEmptyValue(this.metadata.vFormat)) {
format = this.metadata.vFormat
}
if (isEmptyValue(format)) {
format = 'yyyy-MM-dd'
const currentLanguageDefinition = this.$store.getters['getCurrentLanguageDefinition']
if (!isEmptyValue(currentLanguageDefinition)) {
const { datePattern } = currentLanguageDefinition
if (!isEmptyValue(datePattern)) {
format = datePattern
}
}
}

if (this.metadata.display_type === DATE_PLUS_TIME.id) {
format = format + ' hh:mm:ss A'
}
return format
let formattedFormat = format
.replace(/[Y]/gi, 'y')
.replace(/[m]/gi, 'M')
.replace(/[D]/gi, 'd')
if (this.metadata.display_type === DATE_PLUS_TIME.id) {
if (!isEmptyValue(currentLanguageDefinition)) {
const { time_pattern } = currentLanguageDefinition
if (!isEmptyValue(time_pattern)) {
formattedFormat = formattedFormat + ' ' + time_pattern
return formattedFormat
.replace(/[z]/gi, '')
}
}
formattedFormat = formattedFormat + ' hh:mm:ss A'
}
return formattedFormat
},
formatSend() {
let format = 'yyyy-MM-dd'
Expand Down Expand Up @@ -196,7 +204,7 @@ export default {
},
set(value) {
const { columnName, containerUuid, inTable } = this.metadata

const valueParam = value
// table records values
if (inTable) {
// implement container manager row
Expand All @@ -205,7 +213,7 @@ export default {
rowIndex: this.metadata.rowIndex,
rowUid: this.metadata.rowUid,
columnName,
value
value: valueParam
})
// types `decimal` and `date` is a object struct
if ((getTypeOfValue(value) === 'OBJECT') && !isEmptyValue(value.type)) {
Expand Down Expand Up @@ -312,7 +320,6 @@ export default {
preHandleChange(value) {
let startValue, endValue
startValue = value

if (this.typePicker === 'dates') {
if (Array.isArray(value)) {
value = value.map(itemValue => new Date(itemValue))
Expand All @@ -335,7 +342,6 @@ export default {
startValue = new Date(startValue)
endValue = new Date(endValue)
}

this.handleFieldChange({
value: startValue,
valueTo: endValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ export default ({
}
})

const storedReferenceTableName = computed(() => {
return store.getters.getTableNameByField({
uuid: fieldAttributes.uuid
})
})

const searchTableName = computed(() => {
if (!isEmptyValue(storedReferenceTableName.value)) {
return storedReferenceTableName.value
}
return fieldAttributes.referenceTableName
})

const businessPartnerData = computed(() => {
return store.getters.getBusinessPartnerData({
containerUuid: uuidForm
Expand Down Expand Up @@ -220,7 +233,7 @@ export default ({
parentUuid,
containerUuid: uuidForm,
contextColumnNames: fieldAttributes.reference.context_column_names,
tableName: fieldAttributes.referenceTableName,
tableName: searchTableName.value,
uuid: fieldAttributes.uuid,
id: fieldAttributes.id,
// filters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export default {
parentUuid,
containerUuid: this.uuidForm,
contextColumnNames: this.metadata.reference.context_column_names,
tableName: this.metadata.referenceTableName,
tableName: this.searchTableName,
uuid: this.metadata.uuid,
id: this.metadata.id,
filters,
Expand Down
Loading

0 comments on commit dd1a842

Please sign in to comment.