diff --git a/src/api/ADempiere/field/preference.js b/src/api/ADempiere/field/preference.js new file mode 100644 index 00000000000..466a5206f97 --- /dev/null +++ b/src/api/ADempiere/field/preference.js @@ -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 + }) +} diff --git a/src/components/ADempiere/Field/index.vue b/src/components/ADempiere/Field/index.vue index faef7954587..845b3e3224a 100644 --- a/src/components/ADempiere/Field/index.vue +++ b/src/components/ADempiere/Field/index.vue @@ -50,8 +50,12 @@ :field-attributes="fieldAttributes" :field-value="recordDataFields" /> + - 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 @@ -93,7 +97,8 @@ export default { documentStatus, operatorComparison, translated, - calculator + calculator, + preference }, props: { // receives the property that is an object with all the attributes @@ -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) { @@ -246,10 +248,6 @@ export default { return true } - if (isLogColumns) { - return true - } - if (this.field.isAlwaysUpdateable) { return false } @@ -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 @@ -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; diff --git a/src/components/ADempiere/Field/popover/preference/filelistPreference.js b/src/components/ADempiere/Field/popover/preference/filelistPreference.js new file mode 100644 index 00000000000..b58dc80dce0 --- /dev/null +++ b/src/components/ADempiere/Field/popover/preference/filelistPreference.js @@ -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 + } + } +] diff --git a/src/components/ADempiere/Field/popover/preference/index.vue b/src/components/ADempiere/Field/popover/preference/index.vue new file mode 100644 index 00000000000..64cf4486fd5 --- /dev/null +++ b/src/components/ADempiere/Field/popover/preference/index.vue @@ -0,0 +1,301 @@ + + + + + diff --git a/src/lang/ADempiere/en.js b/src/lang/ADempiere/en.js index 5abafa447dc..d6d07cccc81 100644 --- a/src/lang/ADempiere/en.js +++ b/src/lang/ADempiere/en.js @@ -148,7 +148,16 @@ export default { resetAllFilters: 'Reset all filters', switchActiveText: 'Yes', switchInactiveText: 'Not', - contextFieldTitle: 'Context Information' + contextFieldTitle: 'Context Information', + preference: { + title: 'Preference Value', + attribute: 'Attribute', + code: 'Code', + yes: 'Yes', + no: 'No', + defaulMessage: 'Applies for this ', + defaulMessageUser: 'Applies for this ' + } }, views: { browser: 'Smart Browser', diff --git a/src/lang/ADempiere/es.js b/src/lang/ADempiere/es.js index bbeb726af7d..ef79173a707 100644 --- a/src/lang/ADempiere/es.js +++ b/src/lang/ADempiere/es.js @@ -148,7 +148,16 @@ export default { resetAllFilters: 'Reiniciar todos los filtros', switchActiveText: 'Si', switchInactiveText: 'No', - contextFieldTitle: 'InformaciĆ³n de Contexto' + contextFieldTitle: 'InformaciĆ³n de Contexto', + preference: { + title: 'Valor de Preferencia', + attribute: 'Atributo', + code: 'Codigo', + yes: 'Si', + no: 'No', + defaulMessage: 'Aplica para Esta ', + defaulMessageUser: 'Aplica para Este ' + } }, views: { browser: 'Consulta Inteligente', diff --git a/src/utils/ADempiere/valueUtils.js b/src/utils/ADempiere/valueUtils.js index 8cc8a8c79e2..62f557b6c78 100644 --- a/src/utils/ADempiere/valueUtils.js +++ b/src/utils/ADempiere/valueUtils.js @@ -250,7 +250,7 @@ export const recursiveTreeSearch = ({ } /** - * Parsed value to component type + * Preference Value * @author Elsio Sanchez * @param {mixed} value, value to parsed * @param {string} componentPath @@ -530,3 +530,39 @@ export function tenderTypeFind({ export function clearVariables() { partialValue = '' } + +/** + * Search the Payment List for the Current Payment + * @param {string} parentUuid Uuid the Parent + * @param {string} containerUuid Uuid the Container + * @param {string} panelType Panel Type + * @param {string} attribute ColumName Field + * @param {boolean| string | number} value Value + * @param {array} level list value the preference + */ +export function attributePreference({ + parentUuid, + containerUuid, + panelType, + attribute, + value, + level +}) { + let levelPanel + if (level) { + levelPanel = level.map(parameter => { + return { + key: parameter.columnName, + value: parameter.value + } + }) + } + return { + parentUuid, + containerUuid, + panelType, + attribute, + value, + level: levelPanel + } +} diff --git a/src/views/login/index.vue b/src/views/login/index.vue index ab5e9183c4c..b7b4c48cc48 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -132,7 +132,8 @@ export default { loading: false, showDialog: false, redirect: undefined, - otherQuery: {} + otherQuery: {}, + default: 'dashboard' } }, watch: { @@ -212,6 +213,9 @@ export default { }, clientIdRedirect(query, expr) { const redirect = query.split(expr) + if (redirect[1] === this.default) { + return + } return redirect[1] }, organizationIdRedirect(query, expr) {