Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Load Smart Browser. #889

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/api/ADempiere/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,15 @@ export function requestBrowserSearch({
}) {
const filters = parametersList.map(parameter => {
return {
key: parameter.columnName,
column_name: parameter.columnName,
value: parameter.value,
values: parameter.values
value_to: parameter.valueTo
}
})

return request({
url: '/user-interface/smart-browser/browser-items',
method: 'post',
data: {
// Running Parameters
uuid,
Expand Down
7 changes: 3 additions & 4 deletions src/components/ADempiere/DataTable/dataTables-Script.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,11 @@ export default {
})
},
headerLabel(field) {
if (field.isMandatory || field.isMandatoryFromLogic && field.isDisplayedGrid) {
if (field.isMandatory || field.isMandatoryFromLogic) {
return '* ' + field.name
}
if (field.isDisplayedGrid) {
return field.name
}

return field.name
},
/**
* @param {object} row, row data
Expand Down
22 changes: 19 additions & 3 deletions src/store/modules/ADempiere/browserDefinition.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
// Contributor(s): Edwin Betancourt EdwinBetanc0urt@outlook.com www.erpya.com
// 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/>.

import { requestBrowserMetadata } from '@/api/ADempiere/dictionary/smart-browser.js'
import { showMessage } from '@/utils/ADempiere/notification'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils'
Expand Down Expand Up @@ -50,8 +66,7 @@ const browser = {
}
const {
query,
whereClause,
process
whereClause
} = browserResponse

// Convert from gRPC
Expand Down Expand Up @@ -132,7 +147,8 @@ const browser = {

// Convert from gRPC process list
const actions = []
if (process) {
if (!isEmptyValue(browserResponse.process)) {
const { process } = browserResponse
actions.push({
type: 'process',
panelType: 'process',
Expand Down
9 changes: 7 additions & 2 deletions src/utils/ADempiere/apiConverts/dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ import {
} from '@/utils/ADempiere/apiConverts/field.js'
import { convertContextInfo } from '@/utils/ADempiere/apiConverts/core.js'
import { camelizeObjectKeys } from '../transformObject'
import { isEmptyValue } from '@/utils/ADempiere/valueUtils.js'

export function convertProcess(process) {
const convertedProcess = camelizeObjectKeys(process)
convertedProcess.parameters = process.parameters.map(parameter => convertField(parameter))
if (!isEmptyValue(process.parameters)) {
convertedProcess.parameters = process.parameters.map(parameter => convertField(parameter))
}
return convertedProcess
}

Expand All @@ -35,7 +38,9 @@ export function convertReportExportType(reportExportType) {
export function convertBrowser(browser) {
const convertedBrowser = camelizeObjectKeys(browser)
convertedBrowser.window = convertWindow(browser.window)
convertedBrowser.process = convertProcess(browser.process)
if (!isEmptyValue(browser.process)) {
convertedBrowser.process = convertProcess(browser.process)
}
convertedBrowser.fields = browser.fields.map(fieldItem => convertField(fieldItem))
return convertedBrowser
}
Expand Down