Skip to content

Commit

Permalink
Merge branch 'feature/dictionary-multi-tenants' into feature/legacy-s…
Browse files Browse the repository at this point in the history
…upport
  • Loading branch information
EdwinBetanc0urt committed Sep 11, 2024
2 parents eec242e + 6be3411 commit 9c5775e
Show file tree
Hide file tree
Showing 62 changed files with 252 additions and 239 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,22 @@
// Get Instance for connection
import { request } from '@/utils/ADempiere/request'

export function requestReference({
uuid,
columnName
/**
* Request dictionary Forms metadata
* @param {number} id, identifier
*/
export function requestForm({
id: uuid,
// mandatory to open search
language,
dictionaryCode
}) {
return request({
url: '/dictionary/reference',
url: `/dictionary/forms/${uuid}`,
method: 'get',
params: {
uuid,
column_name: columnName
language,
dictionary_code: dictionaryCode
}
})
.then(validationResponse => {
const { convertReference } = require('@/utils/ADempiere/apiConverts/field.js')

return convertReference(validationResponse)
})
}
54 changes: 0 additions & 54 deletions src/api/ADempiere/dictionary/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,59 +41,6 @@ export function requestReference({
})
}

/**
* GET Process or Report dictionary metadata definition
* @param {Number} id identifier
* @param {String} language language
* @param {Number} clientId client identifier
* @param {Number} roleId role identifier
* @param {Number} userId user identifier
* @returns
*/
export function requestProcessMetadata({
id,
// mandatory to open search
language,
clientId,
roleId,
userId
}) {
return request({
url: `/dictionary/processes/${id}`,
method: 'get',
params: {
language,
client_id: clientId,
role_id: roleId,
user_id: userId
}
})
}

/**
* Request dictionary Forms metadata
* @param {number} id, identifier
*/
export function requestForm({
id,
// mandatory to open search
language,
clientId,
roleId,
userId
}) {
return request({
url: `/dictionary/forms/${id}`,
method: 'get',
params: {
language,
client_id: clientId,
role_id: roleId,
user_id: userId
}
})
}

/**
* Reques GET Search Info Fields
*/
Expand All @@ -116,4 +63,3 @@ export function tableSearchFields({
}
})
}

45 changes: 45 additions & 0 deletions src/api/ADempiere/dictionary/process.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* 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'

/**
* GET Process or Report dictionary metadata definition
* @param {Number} id identifier
* @param {String} language language
* @param {Number} clientId client identifier
* @param {Number} roleId role identifier
* @param {Number} userId user identifier
* @returns
*/
export function requestProcessMetadata({
id: uuid,
// mandatory to open search
language,
dictionaryCode
}) {
return request({
url: `/dictionary/processes/${uuid}`,
method: 'get',
params: {
language,
dictionary_code: dictionaryCode
}
})
}
12 changes: 4 additions & 8 deletions src/api/ADempiere/dictionary/smart-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,16 @@ import { request } from '@/utils/ADempiere/request'
* @param {number} id, identifier
*/
export function requestBrowserMetadata({
id,
id: uuid,
language,
clientId,
roleId,
userId
dictionaryCode
}) {
return request({
url: `/dictionary/browsers/${id}`,
url: `/dictionary/browsers/${uuid}`,
method: 'get',
params: {
language,
client_id: clientId,
role_id: roleId,
user_id: userId
dictionary_code: dictionaryCode
}
})
}
28 changes: 15 additions & 13 deletions src/api/ADempiere/dictionary/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,19 @@ import { request } from '@/utils/ADempiere/request'
/**
* Request dictionary Window metadata
* @param {number} id, identifier
* @param {string} language
*/
export function requestWindowMetadata({
id,
// mandatory to open search
id: uuid,
language,
clientId,
roleId,
userId
dictionaryCode
}) {
return request({
url: `/dictionary/windows/${id}`,
url: `/dictionary/windows/${uuid}`,
method: 'get',
params: {
language,
client_id: clientId,
role_id: roleId,
user_id: userId
dictionary_code: dictionaryCode
}
})
}
Expand All @@ -48,11 +44,17 @@ export function requestWindowMetadata({
* @param {number} id
*/
export function requestTabMetadata({
id,
windowId
id: uuid,
windowId,
language,
dictionaryCode
}) {
return request({
url: `/dictionary/windows/${windowId}/tabs/${id}`,
method: 'get'
url: `/dictionary/windows/${windowId}/tabs/${uuid}`,
method: 'get',
params: {
language,
dictionary_code: dictionaryCode
}
})
}
10 changes: 8 additions & 2 deletions src/api/ADempiere/security/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,27 @@ export function requestChangeRole({

/**
* GET Menu
* @param {string} language
* @param {string} clientId
* @param {string} roleId
* @param {string} userUuid
*/
export function requestMenu({
language,
dictionaryCode,
clientId,
roleId,
userId
userUuid
}) {
return request({
url: '/security/menus',
method: 'get',
params: {
language,
dictionary_code: dictionaryCode,
role_id: roleId,
client_id: clientId,
user_id: userId,
user_id: userUuid,
page_size: 100
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export default defineComponent({
parentUuid: props.parentUuid,
containerUuid: props.containerUuid,
tableName: tabAttributes.value.tableName,
tabId: tabAttributes.value.internal_id,
recordUuid: recordUuid.value
})
.then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default {
contextColumnNames: this.metadata.reference.context_column_names,
tableName: TABLE_NAME,
uuid: this.metadata.uuid,
id: this.metadata.id,
id: this.metadata.internal_id,
searchValue,
pageNumber: 1,
pageSize: RECORD_ROWS_BY_LIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<span style="word-break: break-word;">
{{ $t('field.field') }}
<b>{{ fieldAttributes.name }}</b>
({{ fieldAttributes.id }}, {{ fieldAttributes.column_name }}{{ !fieldAttributes.isSameColumnElement ? ', ' + fieldAttributes.element_name : '' }})
({{ fieldAttributes.internal_id }}, {{ fieldAttributes.column_name }}{{ !fieldAttributes.isSameColumnElement ? ', ' + fieldAttributes.element_name : '' }})
</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export default ({
contextColumnNames: fieldAttributes.reference.context_column_names,
tableName: searchTableName.value,
uuid: fieldAttributes.uuid,
id: fieldAttributes.id,
id: fieldAttributes.internal_id,
// filters,
pageNumber,
pageSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export default {
contextColumnNames: this.metadata.reference.context_column_names,
tableName: TABLE_NAME,
uuid: this.metadata.uuid,
id: this.metadata.id,
id: this.metadata.internal_id,
searchValue,
pageNumber: 1,
pageSize: RECORD_ROWS_BY_LIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default {
tableName: this.searchTableName,
columnName: this.metadata.column_name,
uuid: this.metadata.uuid,
id: this.metadata.id,
id: this.metadata.internal_id,
searchValue,
pageNumber: 1,
pageSize: RECORD_ROWS_BY_LIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ export default {
const fieldsListTable = this.storedColumnsListTable
if (isEmptyValue(fieldsListTable)) {
this.containerManager.getSearchDefinition({
id: this.metadata.id
id: this.metadata.internal_id
})
.finally(() => {
this.isLoadingFields = false
Expand Down Expand Up @@ -443,7 +443,7 @@ export default {
parentUuid: this.metadata.parentUuid,
tableName: this.searchTableName,
columnName: this.metadata.columnName,
id: this.metadata.id,
id: this.metadata.internal_id,
contextColumnNames: this.metadata.reference.context_column_names,
filters: values,
pageNumber,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export default ({
columnName: fieldAttributes.column_name,
tableName: searchTableName.value,
uuid: fieldAttributes.uuid,
id: fieldAttributes.id,
id: fieldAttributes.internal_id,
// filters,
pageNumber,
pageSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export default {
tableName: TABLE_NAME,
columnName: this.metadata.column_name,
uuid: this.metadata.uuid,
id: this.metadata.id,
id: this.metadata.internal_id,
searchValue,
pageNumber: 1,
pageSize: RECORD_ROWS_BY_LIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export default ({
tableName: searchTableName.value,
columnName: fieldAttributes.column_name,
uuid: fieldAttributes.uuid,
id: fieldAttributes.id,
id: fieldAttributes.internal_id,
// filters,
pageNumber,
pageSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export default {
contextColumnNames: this.metadata.reference.context_column_names,
tableName: TABLE_NAME,
uuid: this.metadata.uuid,
id: this.metadata.id,
id: this.metadata.internal_id,
searchValue,
pageNumber: 1,
pageSize: RECORD_ROWS_BY_LIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default ({
contextColumnNames: fieldAttributes.reference.context_column_names,
tableName: searchTableName.value,
uuid: fieldAttributes.uuid,
id: fieldAttributes.id,
id: fieldAttributes.internal_id,
// filters,
pageNumber,
pageSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export default {
contextColumnNames: this.metadata.reference.context_column_names,
tableName: TABLE_NAME,
uuid: this.metadata.uuid,
id: this.metadata.id,
id: this.metadata.internal_id,
searchValue,
pageNumber: 1,
pageSize: RECORD_ROWS_BY_LIST
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export default ({
contextColumnNames: fieldAttributes.reference.context_column_names,
tableName: searchTableName.value,
uuid: fieldAttributes.uuid,
id: fieldAttributes.id,
id: fieldAttributes.internal_id,
// filters,
pageNumber,
pageSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default {
contextColumnNames: this.metadata.reference.context_column_names,
tableName: TABLE_NAME,
uuid: this.metadata.uuid,
id: this.metadata.id,
id: this.metadata.internal_id,
searchValue,
pageNumber: 1,
pageSize: RECORD_ROWS_BY_LIST
Expand Down
Loading

0 comments on commit 9c5775e

Please sign in to comment.