Skip to content

Commit 0e6871a

Browse files
MKirovaMKirova
authored andcommitted
Simplify a bit.
1 parent fb897df commit 0e6871a

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

projects/igniteui-angular/src/lib/data-operations/pivot-strategy.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,7 @@ export class PivotColumnDimensionsStrategy implements IPivotDimensionStrategy {
110110
if (k.indexOf(pivotKeys.records) !== -1) {
111111
if (hierarchy[k] && hierarchy[k].length > 0 && k !== pivotKeys.records) {
112112
const unprocessed = hierarchy[k].filter(r => !r.processed);
113-
const res = this.processHierarchy(unprocessed, columns, values, pivotKeys);
114-
if (res.length !== unprocessed.length) {
115-
// some records should be removed from the final flat collection
116-
// since this is no longer the final pipe just mark it for removal.
117-
unprocessed.forEach(element => {
118-
element.remove = true;
119-
});
120-
}
113+
this.processHierarchy(unprocessed, columns, values, pivotKeys);
121114
}
122115
//delete hierarchy[k];
123116
}
@@ -126,10 +119,6 @@ export class PivotColumnDimensionsStrategy implements IPivotDimensionStrategy {
126119
}
127120
});
128121
delete hierarchy.processed;
129-
if (this.isLeaf(hierarchy, pivotKeys)) {
130-
delete hierarchy[pivotKeys.records]; /* remove the helper records of the actual records so that
131-
expand indicators can be rendered properly */
132-
}
133122
for (const property in flatCols) {
134123
if (flatCols.hasOwnProperty(property)) {
135124
hierarchy[property] = flatCols[property];

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-grid.pipes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class IgxPivotRowExpansionPipe implements PipeTransform {
6868
PivotUtil.flattenHierarchy(data, config, row, expansionStates, pivotKeys, totalLlv, prevDims, 0);
6969
prevDims.push(row);
7070
}
71-
const finalData = data.filter(x => !x.remove);
71+
const finalData = data.filter(x => x[pivotKeys.records]);
7272
this.cleanState(finalData, pivotKeys);
7373
return finalData;
7474
}

0 commit comments

Comments
 (0)