Skip to content

Commit

Permalink
fix: Logics on window and smart browse.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Apr 15, 2024
1 parent 94f2ead commit 1e8c5d4
Show file tree
Hide file tree
Showing 23 changed files with 329 additions and 314 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export default {
return {
parentUuid: undefined,
containerUuid: undefined,
columnName: COLUMN_NAME,
elementName: COLUMN_NAME
column_name: COLUMN_NAME,
element_name: COLUMN_NAME
}
}
}
Expand All @@ -52,10 +52,10 @@ export default {
computed: {
blankValues() {
return {
[this.metadata.columnName]: undefined,
[this.metadata.elementName]: undefined,
[DISPLAY_COLUMN_PREFIX + this.metadata.columnName]: undefined,
[DISPLAY_COLUMN_PREFIX + this.metadata.elementName]: undefined,
[this.metadata.column_name]: undefined,
[this.metadata.element_name]: undefined,
[DISPLAY_COLUMN_PREFIX + this.metadata.column_name]: undefined,
[DISPLAY_COLUMN_PREFIX + this.metadata.element_name]: undefined,
uuid: undefined,
UUID: undefined
}
Expand Down Expand Up @@ -128,7 +128,7 @@ export default {
containerUuid: this.metadata.containerUuid,
containerManager: this.containerManager,
field: this.metadata,
columnName: this.metadata.columnName,
columnName: this.metadata.column_name,
newValue: value
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default {
computed: {
uuidForm() {
if (!isEmptyValue(this.metadata.containerUuid)) {
return this.metadata.columnName + '_' + this.metadata.containerUuid
return this.metadata.column_name + '_' + this.metadata.containerUuid
}
return LOCATION_ADDRESS_FORM
},
Expand All @@ -64,8 +64,8 @@ export default {
},
blankValues() {
return {
[this.metadata.columnName]: undefined,
[this.metadata.elementName]: undefined,
[this.metadata.column_name]: undefined,
[this.metadata.element_name]: undefined,
id: undefined,
uuid: undefined,
UUID: undefined,
Expand Down Expand Up @@ -195,19 +195,19 @@ export default {
})

newFieldsList.forEach(field => {
const { columnName } = field
const displayColumnName = DISPLAY_COLUMN_PREFIX + columnName
const { column_name } = field
const displayColumnName = DISPLAY_COLUMN_PREFIX + column_name

let currrentValue = ''
if (!isEmptyValue(entityValues[displayColumnName])) {
currrentValue = entityValues[displayColumnName]
}

if (isEmptyValue(currrentValue)) {
if (columnName === 'C_City_ID') {
if (column_name === 'C_City_ID') {
currrentValue = entityValues['City']
}
if (columnName === 'C_Region_ID') {
if (column_name === 'C_Region_ID') {
currrentValue = entityValues['RegionName']
}

Expand All @@ -219,7 +219,7 @@ export default {
}
}
if (isEmptyValue(currrentValue)) {
currrentValue = entityValues[columnName]
currrentValue = entityValues[column_name]
}

addDisplayValue(currrentValue)
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): Elsio Sanchez [email protected] https://github.com/elsiosanchez
* 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 Down Expand Up @@ -35,9 +35,9 @@ export default ({
const blankValues = computed(() => {
return {
[fieldAttributes.columnName]: undefined,
[fieldAttributes.elementName]: undefined,
[fieldAttributes.element_name]: undefined,
[DISPLAY_COLUMN_PREFIX + fieldAttributes.columnName]: undefined,
[DISPLAY_COLUMN_PREFIX + fieldAttributes.elementName]: undefined,
[DISPLAY_COLUMN_PREFIX + fieldAttributes.element_name]: undefined,
id: undefined,
uuid: undefined,
UUID: undefined,
Expand Down Expand Up @@ -65,45 +65,43 @@ export default ({
function setValues(row) {
const { id, uuid, description } = row

const { parentUuid, containerUuid } = fieldAttributes

const columnName = fieldAttributes.columnName
const { parentUuid, containerUuid, column_name } = fieldAttributes

store.commit('updateValueOfField', {
parentUuid,
containerUuid,
columnName,
columnName: column_name,
value: id
})
// set display column (name) value
store.commit('updateValueOfField', {
parentUuid,
containerUuid,
// DisplayColumn_'ColumnName'
columnName: DISPLAY_COLUMN_PREFIX + columnName,
columnName: DISPLAY_COLUMN_PREFIX + column_name,
value: description
})
// set UUID value
store.commit('updateValueOfField', {
parentUuid,
containerUuid,
columnName: columnName + UNIVERSALLY_UNIQUE_IDENTIFIER_COLUMN_SUFFIX,
columnName: column_name + UNIVERSALLY_UNIQUE_IDENTIFIER_COLUMN_SUFFIX,
value: uuid
})
// update element column name
if (!fieldAttributes.isSameColumnElement) {
store.commit('updateValueOfField', {
parentUuid,
containerUuid,
columnName: fieldAttributes.elementName,
columnName: fieldAttributes.element_name,
value: id
})
// set display column (name) value
store.commit('updateValueOfField', {
parentUuid,
containerUuid,
// DisplayColumn_'ColumnName'
columnName: DISPLAY_COLUMN_PREFIX + fieldAttributes.elementName,
columnName: DISPLAY_COLUMN_PREFIX + fieldAttributes.element_name,
value: description
})
}
Expand All @@ -113,13 +111,13 @@ export default ({
containerManager.setCell({
containerUuid,
rowIndex: fieldAttributes.rowIndex,
columnName,
columnName: column_name,
value: id
})
containerManager.setCell({
containerUuid,
rowIndex: fieldAttributes.rowIndex,
columnName: DISPLAY_COLUMN_PREFIX + columnName,
columnName: DISPLAY_COLUMN_PREFIX + column_name,
value: description
})
}
Expand All @@ -128,7 +126,7 @@ export default ({
containerUuid,
containerManager,
field: fieldAttributes,
columnName
columnName: column_name
})
}

Expand Down
18 changes: 9 additions & 9 deletions src/components/ADempiere/FieldDefinition/FieldSelect/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,27 +112,27 @@ export default {

value: {
get() {
const { columnName, containerUuid, inTable } = this.metadata
const { column_name, containerUuid, inTable } = this.metadata
// table records values
if (inTable) {
// implement container manager row
if (this.containerManager && this.containerManager.getCell) {
return this.containerManager.getCell({
containerUuid,
rowIndex: this.metadata.rowIndex,
columnName
columnName: column_name
})
}
}

return this.$store.getters.getValueOfFieldOnContainer({
parentUuid: this.metadata.parentUuid,
containerUuid,
columnName
columnName: column_name
})
},
set(value) {
const { columnName, containerUuid, inTable } = this.metadata
const { column_name, containerUuid, inTable } = this.metadata

// table records values
if (inTable) {
Expand All @@ -141,7 +141,7 @@ export default {
this.containerManager.setCell({
containerUuid,
rowIndex: this.metadata.rowIndex,
columnName,
columnName: column_name,
value
})
}
Expand All @@ -154,15 +154,15 @@ export default {
this.$store.commit('updateValueOfField', {
parentUuid: this.metadata.parentUuid,
containerUuid,
columnName,
columnName: column_name,
value
})
// update element column name
if (!this.metadata.isSameColumnElement) {
this.$store.commit('updateValueOfField', {
parentUuid: this.metadata.parentUuid,
containerUuid,
columnName: this.metadata.elementName,
columnName: this.metadata.element_name,
value
})
}
Expand Down Expand Up @@ -383,7 +383,7 @@ export default {
id: this.metadata.id,
//
tableName: this.metadata.reference.table_name,
columnName: this.metadata.columnName,
columnName: this.metadata.column_name,
columnUuid: this.metadata.columnUuid,
searchValue: searchQuery,
referenceUuid: this.metadata.reference.uuid,
Expand Down Expand Up @@ -411,7 +411,7 @@ export default {
uuid: this.metadata.uuid,
//
tableName: this.metadata.reference.table_name,
columnName: this.metadata.columnName,
columnName: this.metadata.column_name,
value: this.value
})
.then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export default ({

const blankValues = computed(() => {
return {
[fieldAttributes.columnName]: undefined,
[fieldAttributes.elementName]: undefined,
[DISPLAY_COLUMN_PREFIX + fieldAttributes.columnName]: undefined,
[DISPLAY_COLUMN_PREFIX + fieldAttributes.elementName]: undefined,
[fieldAttributes.column_name]: undefined,
[fieldAttributes.element_name]: undefined,
[DISPLAY_COLUMN_PREFIX + fieldAttributes.column_name]: undefined,
[DISPLAY_COLUMN_PREFIX + fieldAttributes.element_name]: undefined,
id: undefined,
uuid: undefined,
UUID: undefined,
Expand All @@ -61,7 +61,7 @@ export default ({

const uuidForm = computed(() => {
if (!isEmptyValue(fieldAttributes.containerUuid)) {
return fieldAttributes.columnName + '_' + containerUuid
return fieldAttributes.column_name + '_' + containerUuid
}
return 'Warehouse-Locator-Form'
})
Expand Down Expand Up @@ -120,7 +120,7 @@ export default ({

// const { parentUuid, containerUuid } = fieldAttributes

const columnName = fieldAttributes.columnName
const { column_name } = fieldAttributes

// set ID value
value.value = id
Expand All @@ -135,7 +135,7 @@ export default ({
containerUuid,
containerManager,
field: fieldAttributes,
columnName
columnName: column_name
})
}

Expand Down
Loading

0 comments on commit 1e8c5d4

Please sign in to comment.