Skip to content

Commit

Permalink
fix: (Transcoding) Load records on tab childs.
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt committed Oct 26, 2023
1 parent c554178 commit 472c4cc
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 65 deletions.
1 change: 0 additions & 1 deletion src/api/ADempiere/userInterface/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { RECORD_ROWS_BY_LIST } from '@/utils/ADempiere/references.js'
* @param {number} id, identifier
*/
export function requestGetEntities({
id,
tabId,
filters,
pageToken,
Expand Down
31 changes: 15 additions & 16 deletions src/components/ADempiere/TabManager/TabPanel/modeDesktop.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Elsio Sanchez elsiosanches@gmail.com www.erpya.com https://github.com/elsiosanchez
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Elsio Sanchez elsiosanches@gmail.com www.erpya.com https://github.com/elsiosanchez
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->

<template>
Expand Down Expand Up @@ -100,7 +100,6 @@ along with this program. If not, see <https:www.gnu.org/licenses/>.

<el-footer :style="styleFooterPanel" class="tab-panel-footer">
<!-- pagination table, set custom or use default change page method -->
{{ currentPage }}
<custom-pagination
:container-manager="containerManager"
:parent-uuid="parentUuid"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!--
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->

<template>
<el-button
Expand Down
40 changes: 18 additions & 22 deletions src/components/ADempiere/TabManager/convenienceButtons/index.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<!--
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
Copyright (C) 2018-Present E.R.P. Consultores y Asociados, C.A. www.erpya.com
Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com https://github.com/EdwinBetanc0urt
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https:www.gnu.org/licenses/>.
-->

<template>
Expand All @@ -31,7 +31,7 @@

<refresh-record-button
:parent-uuid="parentUuid"
:container-uuid="tabAttributes.id"
:container-uuid="tabAttributes.uuid"
/>

<delete-record-button
Expand Down Expand Up @@ -107,10 +107,6 @@ export default defineComponent({
type: Object,
required: true
},
currentTabUuid: {
type: String,
default: ''
},
tabAttributes: {
type: Object,
default: () => ({})
Expand Down Expand Up @@ -192,13 +188,13 @@ export default defineComponent({
// })

return {
// computed
// Computeds
isMobile,
recordUuid,
getCurrentTab,
isEditSecuence,
isDisableOptionsTabChild,
// methods
// Methodss
openLog
}
}
Expand Down
12 changes: 5 additions & 7 deletions src/store/modules/ADempiere/windowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ const windowManager = {
}, {
parentUuid,
containerUuid,
tabUuid,
searchValue = '',
referenceUuid = '',
filters = [],
Expand Down Expand Up @@ -410,16 +409,15 @@ const windowManager = {
pageToken = ''
}

if (isEmptyValue(tabUuid)) {
tabUuid = containerUuid
if (!isEmptyValue(searchValue)) {
searchValue = encodeURI(searchValue)
}

if (!isEmptyValue(searchValue)) searchValue = encodeURI(searchValue)

if (!isEmptyValue(contextAttributesList)) contextAttributes = JSON.stringify(contextAttributesList)
if (!isEmptyValue(contextAttributesList)) {
contextAttributes = JSON.stringify(contextAttributesList)
}

requestGetEntities({
windowUuid: parentUuid,
tabId: id,
contextAttributes,
searchValue,
Expand Down
10 changes: 9 additions & 1 deletion src/utils/ADempiere/contextUtils/contextAttributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
*/

// Utils and Helper Methods
import { isEmptyValue, isIdentifierEmpty } from '@/utils/ADempiere/valueUtils.js'
import {
getTypeOfValue, isEmptyValue, isIdentifierEmpty
} from '@/utils/ADempiere/valueUtils.js'
import { getContext } from '@/utils/ADempiere/contextUtils'

/**
Expand Down Expand Up @@ -80,6 +82,12 @@ export function generateContextKey(contextAttributes = [], keyName = 'columnName
if (isEmptyValue(contextAttributes)) {
return contextKey
}
if (getTypeOfValue(contextAttributes) === 'OBJECT') {
Object.keys(contextAttributes).forEach(key => {
contextKey += '|' + key + '|' + contextAttributes[key]
})
return '_' + contextKey
}

contextAttributes.forEach(attribute => {
contextKey += '|' + attribute[keyName] + '|' + attribute.value
Expand Down
3 changes: 1 addition & 2 deletions src/utils/ADempiere/dictionary/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -1204,13 +1204,12 @@ export const refreshRecords = {
svg: false,
icon: 'el-icon-refresh',
actionName: 'refreshRecords',
refreshRecords: ({ parentUuid, containerUuid, tabId }) => {
refreshRecords: ({ parentUuid, containerUuid }) => {
nprogress.start()
// refresh records on current tab
store.dispatch('getEntities', {
parentUuid,
containerUuid,
tabId,
filters: []
})
.finally(() => {
Expand Down

0 comments on commit 472c4cc

Please sign in to comment.