From 927de4aa33e5125ebf470c35bae8515117441506 Mon Sep 17 00:00:00 2001 From: Edwin Betancourt Date: Thu, 2 Apr 2020 04:06:54 -0400 Subject: [PATCH] improves: Optimize the times data is consulted in the vuex store (#426) * improves: Optimize the times data is consulted in the vuex store * Improves to get store tab. --- .../ADempiere/ContextMenu/contextMenuMixin.js | 5 + .../ADempiere/ContextMenu/index.vue | 5 + src/components/ADempiere/Field/index.vue | 35 +- src/components/ADempiere/Panel/index.vue | 36 +- src/components/ADempiere/Tab/index.vue | 11 +- src/components/ADempiere/Tab/tabMixin.js | 9 +- src/store/modules/ADempiere/panel.js | 2 + src/store/modules/ADempiere/window.js | 313 ++++++++++-------- src/store/modules/ADempiere/windowControl.js | 35 +- src/utils/ADempiere/dictionaryUtils.js | 9 +- src/views/ADempiere/Window/index.vue | 113 ++++--- 11 files changed, 320 insertions(+), 253 deletions(-) diff --git a/src/components/ADempiere/ContextMenu/contextMenuMixin.js b/src/components/ADempiere/ContextMenu/contextMenuMixin.js index fb099284..7d025f62 100644 --- a/src/components/ADempiere/ContextMenu/contextMenuMixin.js +++ b/src/components/ADempiere/ContextMenu/contextMenuMixin.js @@ -27,6 +27,10 @@ export const contextMixin = { type: String, default: undefined }, + tableName: { + type: String, + default: undefined + }, isReport: { type: Boolean, default: false @@ -281,6 +285,7 @@ export const contextMixin = { this.$store.dispatch('getReferencesListFromServer', { parentUuid: this.parentUuid, containerUuid: this.containerUuid, + tableName: this.tableName, recordUuid: this.recordUuid }) .then(() => { diff --git a/src/components/ADempiere/ContextMenu/index.vue b/src/components/ADempiere/ContextMenu/index.vue index 13169628..45218c30 100644 --- a/src/components/ADempiere/ContextMenu/index.vue +++ b/src/components/ADempiere/ContextMenu/index.vue @@ -5,6 +5,7 @@ :parent-uuid="parentUuid" :container-uuid="containerUuid" :panel-type="panelType" + :table-name="tableName" :is-report="isReport" :last-parameter="lastParameter" :report-format="reportFormat" @@ -34,6 +35,10 @@ export default { type: String, default: undefined }, + tableName: { + type: String, + default: undefined + }, isReport: { type: Boolean, default: false diff --git a/src/components/ADempiere/Field/index.vue b/src/components/ADempiere/Field/index.vue index c9ba1fc5..cf91b255 100644 --- a/src/components/ADempiere/Field/index.vue +++ b/src/components/ADempiere/Field/index.vue @@ -39,12 +39,12 @@ :field="fieldAttributes" /> @@ -170,10 +170,10 @@ export default { if (this.field.isAlwaysUpdateable) { return false } - if (this.getterContextProcessing) { + if (this.field.isProcessingContext) { return true } - if (this.getterContextProcessed) { + if (this.field.isProcessedContext) { return true } @@ -216,12 +216,6 @@ export default { } return '' }, - getterIsShowedRecordNavigation() { - if (this.field.panelType === 'window') { - return this.$store.getters.getIsShowedRecordNavigation(this.field.parentUuid) - } - return false - }, sizeFieldResponsive() { if (!this.isDisplayed) { return DEFAULT_SIZE @@ -254,7 +248,7 @@ export default { return sizeField } // two columns if is mobile or desktop and show record navigation - if (this.getWidth <= 768 || (this.getWidth >= 768 && this.getterIsShowedRecordNavigation)) { + if (this.getWidth <= 768 || (this.getWidth >= 768 && this.field.isShowedRecordNavigation)) { newSizes.xs = 12 newSizes.sm = 12 newSizes.md = 12 @@ -282,25 +276,11 @@ export default { } return sizeField }, - getterContextProcessing() { - const processing = this.$store.getters.getContextProcessing(this.field.parentUuid) - if (processing === true || processing === 'Y') { - return true - } - return false - }, - getterContextProcessed() { - const processed = this.$store.getters.getContextProcessed(this.field.parentUuid) - if (processed === true || processed === 'Y') { - return true - } - return false - }, processOrderUuid() { return this.$store.getters.getOrders }, isDocuemntStatus() { - if (this.field.panelType === 'window') { + if (this.field.panelType === 'window' && !this.isAdvancedQuery) { if (this.field.columnName === 'DocStatus' && !this.isEmptyValue(this.processOrderUuid)) { return true } @@ -312,9 +292,6 @@ export default { return (this.field.contextInfo && this.field.contextInfo.isActive) || this.field.reference.windowsList.length } return false - }, - isNumeric() { - return this.field.componentPath === 'FieldNumber' } }, watch: { diff --git a/src/components/ADempiere/Panel/index.vue b/src/components/ADempiere/Panel/index.vue index 8425e2d8..d129cffa 100644 --- a/src/components/ADempiere/Panel/index.vue +++ b/src/components/ADempiere/Panel/index.vue @@ -38,11 +38,14 @@ :key="subKey" :metadata-field="{ ...fieldAttributes, + isShowedRecordNavigation, + isProcessingContext: getterContextProcessing, + isProcessedContext: getterContextProcessed, optionCRUD, recordUuid: uuidRecord }" :record-data-fields="isAdvancedQuery ? undefined : dataRecords[fieldAttributes.columnName]" - :in-group="!getterIsShowedRecordNavigation" + :in-group="!isShowedRecordNavigation" :is-advanced-query="isAdvancedQuery" /> @@ -94,6 +97,9 @@ :key="subKey" :metadata-field="{ ...fieldAttributes, + isShowedRecordNavigation, + isProcessingContext: getterContextProcessing, + isProcessedContext: getterContextProcessed, optionCRUD, recordUuid: uuidRecord }" @@ -144,6 +150,9 @@ :key="subKey" :metadata-field="{ ...fieldAttributes, + isShowedRecordNavigation, + isProcessingContext: getterContextProcessing, + isProcessedContext: getterContextProcessed, optionCRUD, recordUuid: uuidRecord }" @@ -213,6 +222,10 @@ export default { isAdvancedQuery: { type: Boolean, default: false + }, + isShowedRecordNavigation: { + type: Boolean, + default: false } }, data() { @@ -244,9 +257,21 @@ export default { isPanelWindow() { return this.panelType === 'window' }, - getterIsShowedRecordNavigation() { - if (this.isPanelWindow) { - return this.$store.getters.getIsShowedRecordNavigation(this.parentUuid) + getterContextProcessing() { + if (this.panelType === 'window' && !this.isAdvancedQuery) { + const processing = this.$store.getters.getContextProcessing(this.parentUuid) + if (processing === true || processing === 'Y') { + return true + } + } + return false + }, + getterContextProcessed() { + if (this.panelType === 'window' && !this.isAdvancedQuery) { + const processed = this.$store.getters.getContextProcessed(this.parentUuid) + if (processed === true || processed === 'Y') { + return true + } } return false }, @@ -276,7 +301,7 @@ export default { return this.getterDataStore.isLoaded }, classCards() { - if (this.isMobile || this.fieldGroups.length < 2 || this.getterIsShowedRecordNavigation) { + if (this.isMobile || this.fieldGroups.length < 2 || this.isShowedRecordNavigation) { return 'cards-not-group' } return 'cards-in-group' @@ -320,6 +345,7 @@ export default { parentUuid: this.parentUuid, containerUuid: this.containerUuid, panelType: this.panelType, + panelMetadata: this.metadata, isAdvancedQuery: this.isAdvancedQuery }).then(() => { this.generatePanel(this.getterFieldList) diff --git a/src/components/ADempiere/Tab/index.vue b/src/components/ADempiere/Tab/index.vue index 92002acf..ff97ea7b 100644 --- a/src/components/ADempiere/Tab/index.vue +++ b/src/components/ADempiere/Tab/index.vue @@ -17,6 +17,7 @@ :metadata="tabAttributes" :group-tab="tabAttributes.tabGroup" :panel-type="panelType" + :is-showed-record-navigation="windowMetadata.isShowedRecordNavigation" /> @@ -34,15 +35,9 @@ export default { }, mixins: [tabMixin], computed: { - getWindow() { - return this.$store.getters.getWindow(this.windowUuid) - }, - // if tabs children is showed or closed - isShowedTabsChildren() { - return this.getWindow.isShowedTabsChildren - }, tabParentStyle() { - if (this.isShowedTabsChildren) { + // if tabs children is showed or closed + if (this.windowMetadata.isShowedTabsChildren) { return { height: '100%', overflow: 'hidden' diff --git a/src/components/ADempiere/Tab/tabMixin.js b/src/components/ADempiere/Tab/tabMixin.js index d6873de0..b1571580 100644 --- a/src/components/ADempiere/Tab/tabMixin.js +++ b/src/components/ADempiere/Tab/tabMixin.js @@ -6,6 +6,10 @@ export const tabMixin = { type: String, default: '' }, + windowMetadata: { + type: Object, + default: () => {} + }, tabsList: { type: Array, default: () => [] @@ -39,7 +43,8 @@ export const tabMixin = { setCurrentTab() { this.$store.dispatch('setCurrentTab', { parentUuid: this.windowUuid, - containerUuid: this.tabUuid + containerUuid: this.tabUuid, + window: this.windowMetadata }) this.$route.meta.tabUuid = this.tabUuid }, @@ -53,7 +58,7 @@ export const tabMixin = { } }, handleBeforeLeave(activeName) { - const metadataTab = this.tabsList.find(tab => tab.index === parseInt(activeName), 10) + const metadataTab = this.tabsList.find(tab => tab.index === parseInt(activeName, 10)) if (!this.isEmptyValue(metadataTab.whereClause) && metadataTab.whereClause.includes('@')) { metadataTab.whereClause = parseContext({ parentUuid: metadataTab.parentUuid, diff --git a/src/store/modules/ADempiere/panel.js b/src/store/modules/ADempiere/panel.js index 4015291c..8bc5639d 100644 --- a/src/store/modules/ADempiere/panel.js +++ b/src/store/modules/ADempiere/panel.js @@ -898,6 +898,7 @@ const panel = { parentUuid, containerUuid, panelType, + panelMetadata, routeToDelete, isAdvancedQuery = false }) { @@ -921,6 +922,7 @@ const panel = { parentUuid, containerUuid, panelType, + panelMetadata, isAdvancedQuery, routeToDelete }) diff --git a/src/store/modules/ADempiere/window.js b/src/store/modules/ADempiere/window.js index e8f368cc..28f5a29e 100644 --- a/src/store/modules/ADempiere/window.js +++ b/src/store/modules/ADempiere/window.js @@ -23,14 +23,23 @@ const window = { dictionaryResetCacheWindow(state) { state = initStateWindow }, - changeWindow(state, payload) { - payload.window = payload.newWindow - }, setCurrentTab(state, payload) { - payload.window.currentTabUuid = payload.tabUuid + payload.window.currentTab = payload.tab + payload.window.currentTabUuid = payload.tab.uuid }, - setTabIsLoadField(state, payload) { - payload.tab.isLoadFieldList = payload.isLoadFieldList + changeWindowAttribute(state, payload) { + let value = payload.attributeValue + if (payload.attributeNameControl) { + value = payload.window[payload.attributeNameControl] + } + payload.window[payload.attributeName] = value + }, + changeTabAttribute(state, payload) { + let value = payload.attributeValue + if (payload.attributeNameControl) { + value = payload.tab[payload.attributeNameControl] + } + payload.tab[payload.attributeName] = value } }, actions: { @@ -40,10 +49,10 @@ const window = { }) { return getWindowMetadata(windowUuid) .then(responseWindow => { - const firstTab = responseWindow.tabsList[0].tableName + const firstTabTableName = responseWindow.tabsList[0].tableName const firstTabUuid = responseWindow.tabsList[0].uuid - const childrenTabs = [] - const parentTabs = [] + const tabsListParent = [] + const tabsListChildren = [] const tabsSequence = [] // TODO Add source tab on the server for tabs Translation and Sort @@ -78,11 +87,11 @@ const window = { tabGroup: tabItem.fieldGroup, firstTabUuid, // relations - isParentTab: Boolean(firstTab === tabItem.tableName), + isParentTab: Boolean(firstTabTableName === tabItem.tableName), // app properties isAssociatedTabSequence: false, // show modal with order tab isShowedRecordNavigation: !(tabItem.isSingleRow), - isLoadFieldList: false, + isLoadFieldsList: false, index } delete tab.processesList @@ -95,7 +104,7 @@ const window = { processName: language.t('window.newRecord'), type: 'dataAction', action: 'resetPanelToNew', - uuidParent: responseWindow, + uuidParent: windowUuid, disabled: !tab.isInsertRecord || tab.isReadOnly }, { // action to delete record selected @@ -103,7 +112,7 @@ const window = { processName: language.t('window.deleteRecord'), type: 'dataAction', action: 'deleteEntity', - uuidParent: responseWindow, + uuidParent: windowUuid, disabled: tab.isReadOnly }, { // action to undo create, update, delete record @@ -111,7 +120,7 @@ const window = { processName: language.t('data.undo'), type: 'dataAction', action: 'undoModifyData', - uuidParent: responseWindow, + uuidParent: windowUuid, disabled: false }, { name: language.t('data.lockRecord'), @@ -164,7 +173,7 @@ const window = { if (tabItem.processesList && tabItem.processesList.length) { const processList = tabItem.processesList.map(processItem => { // TODO: No list of parameters - // // add process associated in vuex store + // add process associated in vuex store // dispatch('addProcessAssociated', { // processToGenerate: processItem, // containerUuidAssociated: tabItem.uuid @@ -189,35 +198,32 @@ const window = { // Add process menu dispatch('setContextMenu', { containerUuid: tab.uuid, - actions: actions + actions }) if (tab.isParentTab) { - parentTabs.push(tab) + tabsListParent.push(tab) return tab } if (!tab.isSortTab) { - childrenTabs.push(tab) + tabsListChildren.push(tab) } return tab }) - const tabProperties = { - tabsList: tabs, - currentTab: parentTabs[0], - tabsListParent: parentTabs, - tabsListChildren: childrenTabs, - // app attributes - currentTabUuid: parentTabs[0].uuid - } - const newWindow = { ...responseWindow, - ...tabProperties, + tabsList: tabs, + currentTab: tabsListParent[0], + tabsListParent, + tabsListChildren, + // app attributes + currentTabUuid: tabsListParent[0].uuid, + firstTab: tabsListParent[0], firstTabUuid, windowIndex: state.windowIndex + 1, // App properties - isShowedTabsChildren: Boolean(childrenTabs.length), + isShowedTabsChildren: Boolean(tabsListChildren.length), isShowedRecordNavigation: undefined, isShowedAdvancedQuery: false } @@ -238,141 +244,167 @@ const window = { parentUuid, containerUuid, panelType = 'window', + panelMetadata, isAdvancedQuery = false }) { - return getTabMetadata(containerUuid) - .then(tabResponse => { - const additionalAttributes = { - parentUuid, - containerUuid, - isShowedFromUser: true, - panelType, - tableName: tabResponse.tableName, - // - isReadOnlyFromForm: false, - isAdvancedQuery - } - - let isWithUuidField = false // indicates it contains the uuid field - let fieldLinkColumnName - // Convert from gRPC - const fieldsList = tabResponse.fieldsList.map((fieldItem, index) => { - fieldItem = generateField({ - fieldToGenerate: fieldItem, - moreAttributes: { - ...additionalAttributes, - fieldListIndex: index - } - }) - - if (!isWithUuidField && fieldItem.columnName === 'UUID') { - isWithUuidField = true + return new Promise(resolve => { + getTabMetadata(containerUuid) + .then(tabResponse => { + const additionalAttributes = { + parentUuid, + containerUuid, + isShowedFromUser: true, + panelType, + tableName: tabResponse.tableName, + // + isReadOnlyFromForm: false, + isAdvancedQuery } - if (fieldItem.isParent) { - fieldLinkColumnName = fieldItem.columnName - } - - return fieldItem - }) - - if (!isAdvancedQuery) { - // Get dependent fields - fieldsList - .forEach((field, index, list) => { - if (field.parentFieldsList.length && field.isActive) { - field.parentFieldsList.forEach(parentColumnName => { - const parentField = list.find(parentField => { - return parentField.columnName === parentColumnName && parentColumnName !== field.columnName - }) - if (parentField) { - parentField.dependentFieldsList.push(field.columnName) - } - }) + let isWithUuidField = false // indicates it contains the uuid field + let fieldLinkColumnName + // Convert and add to app attributes + const fieldsList = tabResponse.fieldsList.map((fieldItem, index) => { + fieldItem = generateField({ + fieldToGenerate: fieldItem, + moreAttributes: { + ...additionalAttributes, + fieldListIndex: index } }) - } - if (!isWithUuidField) { - const fieldUuid = getFieldTemplate({ - ...additionalAttributes, - isShowedFromUser: false, - name: 'UUID', - columnName: 'UUID', - componentPath: 'FieldText' + if (!isWithUuidField && fieldItem.columnName === 'UUID') { + isWithUuidField = true + } + + if (fieldItem.isParent) { + fieldLinkColumnName = fieldItem.columnName + } + + return fieldItem }) - fieldsList.push(fieldUuid) - } - const window = getters.getWindow(parentUuid) - // Panel for save on store - const panel = { - ...getters.getTab(parentUuid, containerUuid), - isAdvancedQuery, - fieldLinkColumnName: fieldLinkColumnName, - fieldList: fieldsList, - panelType, - // app attributes - isShowedTotals: false, - isTabsChildren: Boolean(window.tabsListChildren.length) - } + let isTabsChildren = false + if (!isAdvancedQuery) { + // Get dependent fields + fieldsList + .forEach((field, index, list) => { + if (field.parentFieldsList.length && field.isActive) { + field.parentFieldsList.forEach(parentColumnName => { + const parentField = list.find(parentField => { + return parentField.columnName === parentColumnName && parentColumnName !== field.columnName + }) + if (parentField) { + parentField.dependentFieldsList.push(field.columnName) + } + }) + } + }) - dispatch('addPanel', panel) - dispatch('setTabIsLoadField', { - parentUuid, - containerUuid + const window = getters.getWindow(parentUuid) + isTabsChildren = Boolean(window.tabsListChildren.length) + } + + if (!isWithUuidField) { + const fieldUuid = getFieldTemplate({ + ...additionalAttributes, + isShowedFromUser: false, + name: 'UUID', + columnName: 'UUID', + componentPath: 'FieldText' + }) + fieldsList.push(fieldUuid) + } + + if (isEmptyValue(panelMetadata)) { + panelMetadata = getters.getTab(parentUuid, containerUuid) + } + // Panel for save on store + const panel = { + ...panelMetadata, + isAdvancedQuery, + fieldLinkColumnName, + fieldList: fieldsList, + panelType, + // app attributes + isLoadFieldsList: true, + isShowedTotals: false, + isTabsChildren // to delete records assiciated + } + + dispatch('addPanel', panel) + resolve(panel) + + dispatch('changeTabAttribute', { + parentUuid, + containerUuid, + tab: panelMetadata, + attributeName: 'isLoadFieldsList', + attributeValue: true + }) }) - return panel - }) - .catch(error => { - showMessage({ - message: language.t('login.unexpectedError'), - type: 'error' + .catch(error => { + showMessage({ + message: language.t('login.unexpectedError'), + type: 'error' + }) + console.warn(`Dictionary Tab (State Window) - Error ${error.code}: ${error.message}.`) }) - console.warn(`Dictionary Tab (State Window) - Error ${error.code}: ${error.message}.`) - }) + }) + }, + setCurrentTab({ commit, getters }, { + parentUuid, + containerUuid, + window, + tab + }) { + if (isEmptyValue(window)) { + window = getters.getWindow(parentUuid) + } + if (isEmptyValue(tab)) { + tab = window.tabsList.find(itemTab => itemTab.uuid === containerUuid) + } + + commit('setCurrentTab', { + window, + tab + }) }, changeWindowAttribute({ commit, getters }, { parentUuid, window, attributeName, + attributeNameControl, attributeValue }) { if (isEmptyValue(window)) { window = getters.getWindow(parentUuid) } - const newWindow = window - newWindow[attributeName] = attributeValue - commit('changeWindow', { + + commit('changeWindowAttribute', { + parentUuid, window, - newWindow + attributeName, + attributeNameControl, + attributeValue }) }, - /** - * @param {string} parentUuid - * @param {string} containerUuid - */ - setCurrentTab({ commit, getters }, { + changeTabAttribute({ commit, getters }, { parentUuid, - containerUuid + containerUuid, + tab, + attributeName, + attributeNameControl, + attributeValue }) { - commit('setCurrentTab', { - window: getters.getWindow(parentUuid), - tabUuid: containerUuid - }) - }, - /** - * Indicate if fields is load in tab (containerUuid) - * @param {string} parentUuid - * @param {string} containerUuid - */ - setTabIsLoadField({ commit, getters }, { - parentUuid, containerUuid - }) { - const tab = getters.getTab(parentUuid, containerUuid) - commit('setTabIsLoadField', { - tab: tab, - isLoadFieldList: true + if (isEmptyValue(tab)) { + tab = getters.getTab(parentUuid, containerUuid) + } + commit('changeTabAttribute', { + tab, + attributeName, + attributeValue, + attributeNameControl }) } }, @@ -409,13 +441,6 @@ const window = { isInsertRecord: false } }, - getTabIsLoadField: (state, getters) => (windowUuid, tabUuid) => { - const tab = getters.getTab(windowUuid, tabUuid) - if (tab) { - return tab.isLoadFieldList - } - return tab - }, getTableNameFromTab: (state, getters) => (windowUuid, tabUuid) => { return getters.getTab(windowUuid, tabUuid).tableName } diff --git a/src/store/modules/ADempiere/windowControl.js b/src/store/modules/ADempiere/windowControl.js index 030f1513..62b8e37e 100644 --- a/src/store/modules/ADempiere/windowControl.js +++ b/src/store/modules/ADempiere/windowControl.js @@ -497,14 +497,22 @@ const windowControl = { }, /** * Delete selection records in table - * @param {string} containerUuid * @param {string} parentUuid + * @param {string} containerUuid + * @param {string} tableName + * @param {boolean} isParentTab */ deleteSelectionDataList({ dispatch, rootGetters }, { parentUuid, - containerUuid + containerUuid, + tableName, + isParentTab }) { - const { tableName, isParentTab } = rootGetters.getTab(parentUuid, containerUuid) + if (isEmptyValue(tableName) || isEmptyValue(isParentTab)) { + const tab = rootGetters.getTab(parentUuid, containerUuid) + tableName = tab.tableName + isParentTab = tab.isParentTab + } const allData = rootGetters.getDataRecordAndSelection(containerUuid) let selectionLength = allData.selection.length @@ -663,7 +671,7 @@ const windowControl = { }) } return dispatch('getObjectListFromCriteria', { - parentUuid: tab.parentUuid, + parentUuid, containerUuid, tableName: tab.tableName, query: parsedQuery, @@ -680,7 +688,7 @@ const windowControl = { if (newValues) { // update fields with values obtained from the server dispatch('notifyPanelChange', { - parentUuid: tab.parentUuid, + parentUuid, containerUuid, newValues, isSendToServer: false @@ -688,7 +696,7 @@ const windowControl = { } else { // this record is missing (Deleted or the query does not include it) dispatch('resetPanelToNew', { - parentUuid: tab.parentUuid, + parentUuid, containerUuid }) } @@ -748,20 +756,23 @@ const windowControl = { }, /** * Get references asociate to record - * @param {string} parentUuid + * @param {string} parentUuid as windowUuid * @param {string} containerUuid + * @param {string} tableName * @param {string} recordUuid */ getReferencesListFromServer({ commit, rootGetters }, { - parentUuid, + parentUuid: windowUuid, containerUuid, + tableName, recordUuid }) { - // TODO: check if you get better performance search only the window and get the current tab - const { tableName } = rootGetters.getTab(parentUuid, containerUuid) + if (isEmptyValue(tableName)) { + tableName = rootGetters.getTab(windowUuid, containerUuid).tableName + } return new Promise((resolve, reject) => { getReferencesList({ - windowUuid: parentUuid, + windowUuid, tableName, recordUuid }) @@ -775,7 +786,7 @@ const windowControl = { }) const references = { ...referenceResponse, - windowUuid: parentUuid, + windowUuid, recordUuid, referencesList } diff --git a/src/utils/ADempiere/dictionaryUtils.js b/src/utils/ADempiere/dictionaryUtils.js index c40454f0..63a07a50 100644 --- a/src/utils/ADempiere/dictionaryUtils.js +++ b/src/utils/ADempiere/dictionaryUtils.js @@ -33,7 +33,11 @@ export function generateField({ let parsedDefaultValue = fieldToGenerate.defaultValue let parsedDefaultValueTo = fieldToGenerate.defaultValueTo let operator = 'EQUAL' + let isNumericField = componentReference.type === 'FieldNumber' + let isTranslatedField = fieldToGenerate.isTranslated if (moreAttributes.isAdvancedQuery) { + isNumericField = false + isTranslatedField = false parsedDefaultValue = undefined parsedDefaultValueTo = undefined @@ -182,7 +186,10 @@ export function generateField({ // Advanced query operator, // current operator oldOperator: undefined, // old operator - defaultOperator: operator + defaultOperator: operator, + // popover's + isNumericField, + isTranslatedField } // Sizes from panel and groups diff --git a/src/views/ADempiere/Window/index.vue b/src/views/ADempiere/Window/index.vue index 22800492..b71d0658 100644 --- a/src/views/ADempiere/Window/index.vue +++ b/src/views/ADempiere/Window/index.vue @@ -5,7 +5,7 @@ > - +