From 109ede997461154902fec4892cd86f2bb89dc616 Mon Sep 17 00:00:00 2001 From: EdwinBetanc0urt Date: Mon, 6 Sep 2021 02:53:52 -0400 Subject: [PATCH 1/2] feat: Add window support ReadOnly field. --- .../Field/FieldOptions/preference/index.vue | 17 ++--- src/components/ADempiere/Field/index.vue | 71 ++++++++++++++++--- src/store/modules/ADempiere/fieldValue.js | 28 +++++++- src/store/modules/ADempiere/preference.js | 21 +++++- src/store/modules/user.js | 7 +- .../ADempiere/constants/systemColumns.js | 25 +++++++ src/views/ADempiere/Window/index.vue | 34 +++++++++ 7 files changed, 176 insertions(+), 27 deletions(-) create mode 100644 src/utils/ADempiere/constants/systemColumns.js diff --git a/src/components/ADempiere/Field/FieldOptions/preference/index.vue b/src/components/ADempiere/Field/FieldOptions/preference/index.vue index d4351f560f8..4655307746f 100644 --- a/src/components/ADempiere/Field/FieldOptions/preference/index.vue +++ b/src/components/ADempiere/Field/FieldOptions/preference/index.vue @@ -106,6 +106,7 @@ import formMixin from '@/components/ADempiere/Form/formMixin' import preferenceFields from './preferenceFields.js' import { createFieldFromDictionary } from '@/utils/ADempiere/lookupFactory' +import { CLIENT, ORGANIZATION } from '@/utils/ADempiere/constants/systemColumns' import { setPreference, deletePreference } from '@/api/ADempiere/field/preference.js' import { showMessage } from '@/utils/ADempiere/notification.js' import language from '@/lang' @@ -149,13 +150,13 @@ export default { if (this.isEmptyValue(this.metadataList)) { return '' } - const forCurrentUser = this.metadataList.find(field => field.columnName === 'AD_User_ID') - const forCurrentClient = this.metadataList.find(field => field.columnName === 'AD_Client_ID') - const forCurrentOrganization = this.metadataList.find(field => field.columnName === 'AD_Org_ID') - const forCurrentContainer = this.metadataList.find(field => field.columnName === 'AD_Window_ID') + const forCurrentClient = this.metadataList.find(field => field.columnName === CLIENT) if (!forCurrentClient) { return '' } + const forCurrentUser = this.metadataList.find(field => field.columnName === 'AD_User_ID') + const forCurrentOrganization = this.metadataList.find(field => field.columnName === ORGANIZATION) + const forCurrentContainer = this.metadataList.find(field => field.columnName === 'AD_Window_ID') // Create Message var expl = language.t('components.preference.for')// components.preference.for if (forCurrentOrganization && forCurrentClient) { @@ -224,8 +225,8 @@ export default { }, remove() { const isForCurrentUser = this.metadataList.find(field => field.columnName === 'AD_User_ID').value - const isForCurrentClient = this.metadataList.find(field => field.columnName === 'AD_Client_ID').value - const isForCurrentOrganization = this.metadataList.find(field => field.columnName === 'AD_Org_ID').value + const isForCurrentClient = this.metadataList.find(field => field.columnName === CLIENT).value + const isForCurrentOrganization = this.metadataList.find(field => field.columnName === ORGANIZATION).value const isForCurrentContainer = this.metadataList.find(field => field.columnName === 'AD_Window_ID').value deletePreference({ parentUuid: this.fieldAttributes.parentUuid, @@ -275,8 +276,8 @@ export default { }, sendValue(list) { const isForCurrentUser = this.metadataList.find(field => field.columnName === 'AD_User_ID').value - const isForCurrentClient = this.metadataList.find(field => field.columnName === 'AD_Client_ID').value - const isForCurrentOrganization = this.metadataList.find(field => field.columnName === 'AD_Org_ID').value + const isForCurrentClient = this.metadataList.find(field => field.columnName === CLIENT).value + const isForCurrentOrganization = this.metadataList.find(field => field.columnName === ORGANIZATION).value const isForCurrentContainer = this.metadataList.find(field => field.columnName === 'AD_Window_ID').value // setPreference({ diff --git a/src/components/ADempiere/Field/index.vue b/src/components/ADempiere/Field/index.vue index ffcfdab7178..6bb5b388177 100644 --- a/src/components/ADempiere/Field/index.vue +++ b/src/components/ADempiere/Field/index.vue @@ -66,6 +66,9 @@