Skip to content

Commit

Permalink
fix: Window filter records. (#1554)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Feb 11, 2022
1 parent fe25222 commit a88184c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
15 changes: 8 additions & 7 deletions src/api/ADempiere/user-interface/persistence.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

// Get Instance for connection
import { request } from '@/utils/ADempiere/request'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'

/**
* Object List from window
Expand Down Expand Up @@ -47,18 +48,19 @@ export function getEntities({
}
})

let attributesValues
if (attributes) {
attributesValues = attributes.map(attributeValue => {
return {
// context attributes
if (!isEmptyValue(attributes)) {
attributes.forEach(attributeValue => {
filters.push({
column_name: attributeValue.columnName,
operator: attributeValue.operator,
value: attributeValue.value
}
})
})
}

let sortingDefinition
if (sorting) {
if (!isEmptyValue(sorting)) {
sortingDefinition = sorting.map(sortValue => {
return {
column_name: sortValue.columnName,
Expand All @@ -77,7 +79,6 @@ export function getEntities({
filters,
columns,
// replace sql values
context_attributes: attributesValues,
sorting: sortingDefinition,
// Page Data
page_token: pageToken,
Expand Down
2 changes: 2 additions & 0 deletions src/store/modules/ADempiere/windowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {

// constants
import { ROW_ATTRIBUTES } from '@/utils/ADempiere/constants/table'
import { OPERATOR_EQUAL } from '@/utils/ADempiere/dataUtils.js'

// utils and helper methods
import { getContext } from '@/utils/ADempiere/contextUtils.js'
Expand Down Expand Up @@ -113,6 +114,7 @@ const windowManager = {
})
contextAttriburesList.push({
value,
operator: OPERATOR_EQUAL.operator,
columnName
})
})
Expand Down
3 changes: 1 addition & 2 deletions src/views/ADempiere/Test/MultiTabWindow/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ export default defineComponent({
callBack: () => {
root.$store.dispatch('getEntities', {
parentUuid: props.parentUuid,
containerUuid: uuid,
tableName
containerUuid: uuid
})
}
},
Expand Down

0 comments on commit a88184c

Please sign in to comment.