add column to JSON view

This commit is contained in:
Jan Prochazka
2021-12-02 13:58:14 +01:00
parent 1da8c4ca2c
commit 2649a0174d
4 changed files with 27 additions and 1 deletions

View File

@@ -70,9 +70,14 @@ function getDisplayColumn(basePath, columnName, display) {
export function analyseCollectionDisplayColumns(rows, display) {
const res = [];
const addedColumns = display?.config?.addedColumns;
for (const row of rows || []) {
getColumnsForObject([], row, res, display);
}
for (const added of addedColumns || []) {
if (res.find(x => x.uniqueName == added)) continue;
res.push(getDisplayColumn([], added, display));
}
return (
res.map(col => ({
...col,