Merged in bugfix/PMCORE-3560 (pull request #8305)

PMCORE-3560

Approved-by: Rodrigo Quelca
This commit is contained in:
Fabio Guachalla
2021-11-30 14:18:47 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -229,7 +229,20 @@ export default {
* Return the columns for table - concat with field "detail" "actions"
*/
getTableColumns(columns) {
return _.concat(["detail"], columns, ["actions"]);
return _.concat(["detail"], this.removeDefaultColumns(columns), ["actions"]);
},
/**
* Remove the default columns, 'detail' and 'actions'
* @param {Array} columns
*/
removeDefaultColumns(columns) {
if (columns[0] === 'detail') {
columns.shift()
}
if (columns[columns.length - 1] === 'actions') {
columns.pop();
}
return columns;
},
/**
* Return options for Table