Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
feat: Change container_id to parent_id on dependent fields (#2183)
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinBetanc0urt authored Apr 25, 2024
1 parent 7e8d84a commit 2b3f454
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 109 deletions.
57 changes: 0 additions & 57 deletions src/api/ADempiere/dictionary/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,6 @@
// Get Instance for connection
import { request } from '@/utils/ADempiere/request'

/**
* Request dictionary Window metadata
* @param {number} id, identifier
*/
export function requestWindowMetadata({
id
}) {
return request({
url: `/dictionary/windows/${id}`,
method: 'get'
})
.then(windowResponse => {
const { convertWindow } = require('@/utils/ADempiere/apiConverts/dictionary.js')
return convertWindow(windowResponse)
})
}

/**
* Request Get Tabs
* @param {number} id
*/
export function requestTabsMetadata({
id
}) {
return request({
url: `/dictionary/tabs/${id}`,
method: 'get'
})
.then(responde => {
return responde
})
}

/**
* GET References
* @param {String} id
Expand Down Expand Up @@ -103,30 +70,6 @@ export function requestProcessMetadata({
})
}

/**
* Request dictionary Smart Browser metadata
* @param {string} uuid universally unique identifier
* @param {number} id, identifier
*/
export function requestBrowserMetadata({
id,
language,
clientId,
roleId,
userId
}) {
return request({
url: `/dictionary/browsers/${id}`,
method: 'get',
params: {
language,
client_id: clientId,
role_id: roleId,
user_id: userId
}
})
}

/**
* Request dictionary Forms metadata
* @param {number} id, identifier
Expand Down
52 changes: 27 additions & 25 deletions src/api/ADempiere/dictionary/smart-browser.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
// ADempiere-Vue (Frontend) for ADempiere ERP & CRM Smart Business Solution
// Copyright (C) 2017-Present E.R.P. Consultores y Asociados, C.A.
// Contributor(s): Yamel Senih [email protected] 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/>.
/**
* 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 [email protected] 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/>.
*/

// Get Instance for connection
import { request } from '@/utils/ADempiere/request'
Expand All @@ -23,20 +25,20 @@ import { request } from '@/utils/ADempiere/request'
* @param {number} id, identifier
*/
export function requestBrowserMetadata({
uuid,
id
id,
language,
clientId,
roleId,
userId
}) {
return request({
url: '/dictionary/browser',
url: `/dictionary/browsers/${id}`,
method: 'get',
params: {
uuid,
id
language,
client_id: clientId,
role_id: roleId,
user_id: userId
}
})
.then(browserResponse => {
const { convertBrowser } = require('@/utils/ADempiere/apiConverts/dictionary.js')

return convertBrowser(browserResponse)
})
}
24 changes: 0 additions & 24 deletions src/api/ADempiere/dictionary/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,6 @@
// Get Instance for connection
import { request } from '@/utils/ADempiere/request'

/**
* Request dictionary Window metadata
* @param {string} uuid universally unique identifier
* @param {number} id, identifier
*/
export function requestWindowMetadata({
uuid,
id
}) {
return request({
url: '/dictionary/window',
method: 'get',
params: {
uuid,
id
}
})
.then(windowResponse => {
const { convertWindow } = require('@/utils/ADempiere/apiConverts/dictionary.js')

return convertWindow(windowResponse)
})
}

export function requestReference({
uuid,
columnName
Expand Down
14 changes: 14 additions & 0 deletions src/api/ADempiere/dictionary/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,17 @@ export function requestWindowMetadata({
}
})
}

/**
* Request Get Tabs
* @param {number} id
*/
export function requestTabMetadata({
id,
windowId
}) {
return request({
url: `/dictionary/windows/${windowId}/tabs/${id}`,
method: 'get'
})
}
2 changes: 1 addition & 1 deletion src/store/modules/ADempiere/dictionary/browser/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import router from '@/router'
import store from '@/store'

// API Request Methods
import { requestBrowserMetadata } from '@/api/ADempiere/dictionary/index.ts'
import { requestBrowserMetadata } from '@/api/ADempiere/dictionary/smart-browser.js'

// Constants
import {
Expand Down
4 changes: 2 additions & 2 deletions src/store/modules/ADempiere/panel/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ const actions = {
// new implementation
fieldId = fieldDependentDefinition.id
columnName = fieldDependentDefinition.column_name
containerUuid = fieldDependentDefinition.container_uuid
containerName = fieldDependentDefinition.container_name
containerUuid = fieldDependentDefinition.parent_uuid
containerName = fieldDependentDefinition.parent_name
}

// Get all fields on different container
Expand Down

0 comments on commit 2b3f454

Please sign in to comment.