Skip to content

Commit

Permalink
Support to Field Preference (#662)
Browse files Browse the repository at this point in the history
* add field preference

* minimal changes

* remove input

* fix error

* raname service

* add information

* rename descrition the preference

Co-authored-by: Elsio Sanchez <elsiosanche@gmail.com>
  • Loading branch information
elsiosanchez and Elsio Sanchez committed Mar 20, 2021
1 parent 44077e4 commit 7617bdb
Show file tree
Hide file tree
Showing 8 changed files with 469 additions and 21 deletions.
35 changes: 35 additions & 0 deletions src/api/ADempiere/field/preference.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export function getPreference({
parentUuid,
containerUuid,
panelType,
attribute,
value,
level
}) {
return getPreference({
parentUuid,
containerUuid,
panelType,
attribute,
value,
level
})
}

export function updatePreference({
parentUuid,
containerUuid,
panelType,
attribute,
value,
level
}) {
return updatePreference({
parentUuid,
containerUuid,
panelType,
attribute,
value,
level
})
}
27 changes: 10 additions & 17 deletions src/components/ADempiere/Field/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@
:field-attributes="fieldAttributes"
:field-value="recordDataFields"
/>
<preference
:field-attributes="fieldAttributes"
:field-value="recordDataFields"
:panel-type="field.panelType"
/>
</template>

<component
:is="componentRender"
:ref="field.columnName"
Expand All @@ -75,12 +79,12 @@
<script>
import contextInfo from '@/components/ADempiere/Field/popover/contextInfo'
import documentStatus from '@/components/ADempiere/Field/popover/documentStatus'
import preference from '@/components/ADempiere/Field/popover/preference/index'
import operatorComparison from '@/components/ADempiere/Field/popover/operatorComparison'
import translated from '@/components/ADempiere/Field/popover/translated'
import calculator from '@/components/ADempiere/Field/popover/calculator'
import { DEFAULT_SIZE } from '@/utils/ADempiere/references'
import { evalutateTypeField, fieldIsDisplayed } from '@/utils/ADempiere/dictionaryUtils'
import { LOG_COLUMNS_NAME_LIST } from '@/utils/ADempiere/dataUtils.js'
/**
* This is the base component for linking the components according to the
Expand All @@ -93,7 +97,8 @@ export default {
documentStatus,
operatorComparison,
translated,
calculator
calculator,
preference
},
props: {
// receives the property that is an object with all the attributes
Expand Down Expand Up @@ -232,9 +237,6 @@ export default {
return true
}
// records in columns manage by backend
const isLogColumns = LOG_COLUMNS_NAME_LIST.includes(this.field.columnName)
const isUpdateableAllFields = this.field.isReadOnly || this.field.isReadOnlyFromLogic
if (this.isPanelWindow) {
Expand All @@ -246,10 +248,6 @@ export default {
return true
}
if (isLogColumns) {
return true
}
if (this.field.isAlwaysUpdateable) {
return false
}
Expand All @@ -266,7 +264,7 @@ export default {
} else if (this.field.panelType === 'browser') {
if (this.inTable) {
// browser result
return this.field.isReadOnly || isLogColumns
return this.field.isReadOnly
}
// query criteria
return this.field.isReadOnlyFromLogic
Expand Down Expand Up @@ -446,12 +444,7 @@ export default {
margin-left: 0px;
margin-right: 0px;
}
.el-textarea {
position: relative;
display: contents;
width: 100%;
vertical-align: bottom;
}
/* Global Styles */
.el-textarea__inner:not(.in-table) {
min-height: 36px !important;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
export default [
{
elementColumnName: 'AD_Client_ID',
columnName: 'AD_Client_ID',
isFromDictionary: true,
overwriteDefinition: {
size: 24,
sequence: 0,
isReadOnly: true,
handleActionPerformed: true,
handleContentSelection: true,
handleActionKeyPerformed: true,
componentPath: 'FieldYesNo',
value: true
}
},
{
elementColumnName: 'AD_Org_ID',
columnName: 'AD_Org_ID',
isFromDictionary: true,
overwriteDefinition: {
size: 24,
sequence: 1,
handleActionPerformed: true,
handleContentSelection: true,
handleActionKeyPerformed: true,
componentPath: 'FieldYesNo',
value: false
}
},
{
elementColumnName: 'AD_User_ID',
columnName: 'AD_User_ID',
isFromDictionary: true,
overwriteDefinition: {
size: 24,
sequence: 2,
isReadOnly: true,
handleActionPerformed: true,
handleContentSelection: true,
handleActionKeyPerformed: true,
componentPath: 'FieldYesNo',
value: true
}
},
{
elementColumnName: 'AD_Window_ID',
columnName: 'AD_Window_ID',
isFromDictionary: true,
overwriteDefinition: {
size: 24,
sequence: 3,
isReadOnly: true,
handleActionPerformed: true,
handleContentSelection: true,
handleActionKeyPerformed: true,
componentPath: 'FieldYesNo',
value: true
}
}
]
Loading

0 comments on commit 7617bdb

Please sign in to comment.