Skip to content

Commit

Permalink
fix: Display type porperty.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Apr 11, 2024
1 parent 1529a2a commit 5f1e05e
Show file tree
Hide file tree
Showing 45 changed files with 311 additions and 305 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/> -->

<p
v-else-if="!isEmptyValue(displayedValue) && displayedValue.length >= 23 && fieldAttributes.displayType != IMAGE.id"
v-else-if="!isEmptyValue(displayedValue) && displayedValue.length >= 23 && fieldAttributes.display_type != IMAGE.id"
key="display-column"
style="max-height: 40px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap; margin: 5px;"
>
Expand Down Expand Up @@ -191,16 +191,16 @@ export default defineComponent({
value: currentValue,
currency: props.dataRow[DISPLAY_COLUMN_PREFIX + CURRENCY],
displayedValue: props.dataRow[displayColumnName.value],
displayType: props.fieldAttributes.displayType
displayType: props.fieldAttributes.display_type
})
})

const cellCssClass = computed(() => {
let classCss = ''
if (isNumberField(props.fieldAttributes.displayType) || props.fieldAttributes.componentPath === 'FieldNumber') {
if (isNumberField(props.fieldAttributes.display_type) || props.fieldAttributes.componentPath === 'FieldNumber') {
classCss = ' cell-align-right '
}
if (props.fieldAttributes.isColumnDocumentStatus || props.fieldAttributes.displayType === IMAGE.id) {
if (props.fieldAttributes.isColumnDocumentStatus || props.fieldAttributes.display_type === IMAGE.id) {
classCss = ' cell-align-center '
}
return classCss
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default defineComponent({
})

const isRowChangeEdited = computed(() => {
if ([BINARY_DATA.id, IMAGE.id].includes(props.fieldAttributes.displayType)) {
if ([BINARY_DATA.id, IMAGE.id].includes(props.fieldAttributes.display_type)) {
return false
}
if (props.dataRow.isEditRow && !isReadOnly.value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
:span="6"
>
<text-accounting
v-if="field.displayType === 14"
v-if="field.display_type === TEXT.id"
:metadata="{
...field,
value: valuesCombinations(field)
Expand Down Expand Up @@ -178,6 +178,7 @@ import {
} from '@/api/ADempiere/field/generalGedger'

// Constants
import { TEXT } from '@/utils/ADempiere/references'
import { ACCOUTING_COMBINATIONS_LIST_FORM, COLUMN_NAME } from '@/utils/ADempiere/dictionary/field/accoutingCombination.js'

// Components and Mixins
Expand Down Expand Up @@ -430,6 +431,7 @@ export default defineComponent({
loadCombinations()

return {
TEXT,
// Ref
setValuesCombinations,
isLoadingRecords,
Expand Down
6 changes: 3 additions & 3 deletions src/components/ADempiere/FieldDefinition/FieldDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {
return picker
}
// Date + Time reference (16)
if (this.metadata.displayType === DATE_PLUS_TIME.id) {
if (this.metadata.display_type === DATE_PLUS_TIME.id) {
picker += 'time'
}
if (this.isRenderRange && !this.metadata.inTable) {
Expand Down Expand Up @@ -121,7 +121,7 @@ export default {
}
}

if (this.metadata.displayType === DATE_PLUS_TIME.id) {
if (this.metadata.display_type === DATE_PLUS_TIME.id) {
format = format + ' hh:mm:ss A'
}
return format
Expand All @@ -131,7 +131,7 @@ export default {
},
formatSend() {
let format = 'yyyy-MM-dd'
if (this.metadata.displayType === DATE_PLUS_TIME.id) {
if (this.metadata.display_type === DATE_PLUS_TIME.id) {
format += ' HH:mm:ss'
}
return format
Expand Down
30 changes: 15 additions & 15 deletions src/components/ADempiere/FieldDefinition/FieldNumber.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

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
GNU General Public License for more details.
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
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->

<template>
Expand Down Expand Up @@ -112,7 +112,7 @@ export default {
if (!isEmptyValue(this.metadata.precision)) {
return this.metadata.precision
}
if (isDecimalField(this.metadata.displayType)) {
if (isDecimalField(this.metadata.display_type)) {
return store.getters.getStandardPrecision
}
return undefined
Expand Down Expand Up @@ -141,7 +141,7 @@ export default {
get() {
return formatNumber({
value: this.value,
displayType: this.metadata.displayType,
displayType: this.metadata.display_type,
currency: this.currencyCode,
precision: this.metadata.precision
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com www.erpya.com
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

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
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
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
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

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
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->

<template>
Expand Down Expand Up @@ -186,7 +186,7 @@ export default {
},
// Integer or ID
isInteger() {
return isIntegerField(this.fieldAttributes.displayType)
return isIntegerField(this.fieldAttributes.display_type)
}
},

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
Contributor(s): Elsio Sanchez elsiosanches@gmail.com www.erpya.com
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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Elsio Sanchez elsiosanches@gmail.com 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

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
GNU General Public License for more details.
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
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->

<template>
Expand Down Expand Up @@ -218,7 +218,7 @@ export default {
})
},
isShowSopportLookup() {
return isSupportLookup(this.fieldAttributes.displayType)
return isSupportLookup(this.fieldAttributes.display_type)
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default defineComponent({
})
})
const displayValueField = computed(() => {
if (!isLookup(props.fieldAttributes.displayType)) {
if (!isLookup(props.fieldAttributes.display_type)) {
return null
}
const { parentUuid, containerUuid, columnName } = props.fieldAttributes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const zoomInOptionItem = {
}

// TODO: Evaluate reference.key_column_name: AD_Ref_List.Value
if (fieldAttributes.displayType === LIST.id) {
if (fieldAttributes.display_type === LIST.id) {
columnName = 'AD_Reference_ID'
// TODO: Direct query is deprecated
// const valueQuery = reference.directQuery
Expand Down
32 changes: 16 additions & 16 deletions src/components/ADempiere/FieldDefinition/FieldOptions/index.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

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
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com 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
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

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
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->

<template>
Expand Down Expand Up @@ -288,7 +288,7 @@ export default defineComponent({
menuOptions.push(documentStatusOptionItem)
}

if (isSupportLookup(field.displayType)) {
if (isSupportLookup(field.display_type)) {
menuOptions.push(refreshLookup)
if (field.reference && !isEmptyValue(field.reference.zoom_windows)) {
menuOptions.push(zoomInOptionItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
:container-uuid="uuidForm"
:field-attributes="{
columnName: fieldAttributes.column_name,
displayType: fieldAttributes.display_type
display_type: fieldAttributes.display_type
}"
:container-manager="containerManagerList"
:scope="scope"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default {
}
return listIdentifier
.filter(field => {
// return field.displayType === field.displayType === CHAR.id
// return field.display_type === CHAR.id
return field.identifierSequence > 0
})
.sort((fieldA, fieldB) => {
Expand Down Expand Up @@ -251,12 +251,12 @@ export default {
// }
// find on identifier columns
for (const field of this.storedIdentifierColumns) {
const { columnName, displayColumnName, displayType } = field
const { columnName, displayColumnName, display_type } = field

const currentValue = formatField({
value: row[columnName],
displayedValue: row[displayColumnName],
displayType
displayType: display_type
})
const valueToCompare = String(currentValue).toLowerCase()

Expand Down Expand Up @@ -344,12 +344,12 @@ export default {

// generate with identifier columns
this.storedIdentifierColumns.forEach(field => {
const { columnName, displayColumnName, displayType } = field
const { columnName, displayColumnName, display_type } = field

const currentValue = formatField({
value: row[columnName],
displayedValue: row[displayColumnName],
displayType
displayType: display_type
})

if (isEmptyValue(currentValue)) {
Expand Down
22 changes: 11 additions & 11 deletions src/components/ADempiere/FieldDefinition/FieldSelect/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default {

isFiltrable() {
if (this.isMobile) {
if (LIST.id === this.metadata.displayType) {
if (LIST.id === this.metadata.display_type) {
return false
}
}
Expand Down Expand Up @@ -352,17 +352,17 @@ export default {
}
},
remoteSearch(searchQuery = '') {
const results = this.localSearch(searchQuery)
if (isEmptyValue(searchQuery) ||
(!isEmptyValue(searchQuery) && (isEmptyValue(results) || results.length < 3))) {
clearTimeout(this.timeOut)
this.timeOut = setTimeout(() => {
this.loadListFromServer(searchQuery)
}, 500)
return
}
// const results = this.localSearch(searchQuery)
// if (isEmptyValue(searchQuery) ||
// (!isEmptyValue(searchQuery) && (isEmptyValue(results) || results.length < 3))) {
clearTimeout(this.timeOut)
this.timeOut = setTimeout(() => {
this.loadListFromServer(searchQuery)
}, 500)
// return
// }
// use this, if remote is enabled, local search not working
this.optionsList = results
// this.optionsList = results
},
localSearch(searchQuery = '') {
if (isEmptyValue(searchQuery)) {
Expand Down
Loading

0 comments on commit 5f1e05e

Please sign in to comment.