Skip to content

Commit ee1e5f9

Browse files
authored
Merge branch 'master' into mkirova/fix-pinned-area-changes
2 parents 83603dd + 013aa82 commit ee1e5f9

File tree

6 files changed

+33
-13
lines changed

6 files changed

+33
-13
lines changed

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ export class IgxColumnComponent implements AfterContentInit {
276276
this.grid.endEdit(false);
277277
this.grid.summaryService.resetSummaryHeight();
278278
this.grid.filteringService.refreshExpressions();
279+
this.grid.filteringService.hideFilteringRowOnColumnVisibilityChange(this);
279280
this.grid.notifyChanges();
280281
}
281282
}

projects/igniteui-angular/src/lib/grids/filtering/grid-filtering.service.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,17 @@ export class IgxFilteringService implements OnDestroy {
9797
filterCell.updateFilterCellArea();
9898
});
9999
});
100+
}
101+
}
100102

101-
this.grid.onColumnVisibilityChanged.pipe(takeUntil(this.destroy$)).subscribe((eventArgs: IColumnVisibilityChangedEventArgs) => {
102-
if (this.grid.filteringRow && this.grid.filteringRow.column === eventArgs.column ) {
103-
this.grid.filteringRow.close();
103+
/**
104+
* Close filtering row if a column is hidden.
105+
*/
106+
public hideFilteringRowOnColumnVisibilityChange(col: IgxColumnComponent) {
107+
const filteringRow = this.grid.filteringRow;
104108

105-
}
106-
});
109+
if (filteringRow && filteringRow.column && filteringRow.column === col) {
110+
filteringRow.close();
107111
}
108112
}
109113

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-ui.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,24 +2138,24 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
21382138
}));
21392139

21402140
it('Should close filter row when hide the current column', fakeAsync(() => {
2141-
pending('This issue is failing because of bug #');
21422141
GridFunctions.clickFilterCellChip(fix, 'ProductName');
21432142

21442143
// Check that the filterRow is opened
2145-
const filterUIRow = fix.debugElement.query(By.css(FILTER_UI_ROW));
2144+
let filterUIRow = fix.debugElement.query(By.css(FILTER_UI_ROW));
21462145
expect(filterUIRow).not.toBeNull();
21472146

21482147
// Add first chip.
21492148
GridFunctions.typeValueInFilterRowInput('a', fix);
21502149
tick(100);
21512150

21522151
grid.getColumnByName('ProductName').hidden = true;
2153-
fix.detectChanges();
21542152
tick(100);
2153+
fix.detectChanges();
21552154

21562155
// Check that the filterRow is closed
2157-
expect(fix.debugElement.query(By.css(FILTER_UI_ROW))).toBeNull();
2158-
expect(grid.rowList.length).toBe(8);
2156+
filterUIRow = fix.debugElement.query(By.css(FILTER_UI_ROW));
2157+
expect(filterUIRow).toBeNull();
2158+
expect(grid.rowList.length).toBe(3, 'filter is not applied');
21592159
}));
21602160

21612161
it('Should keep existing column filter after hiding another column.', fakeAsync(() => {

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid-integration.spec.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1458,7 +1458,7 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
14581458

14591459
});
14601460

1461-
it('should add pinned badge in the pinned row instance in the body', () => {
1461+
it('should add pinned chip in the pinned row instance in the body', () => {
14621462
const rowToPin = treeGrid.getRowByIndex(0);
14631463
const primaryKey = treeGrid.primaryKey;
14641464

@@ -1636,5 +1636,20 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
16361636
{ID: 475, Name: 'Michael Langdon'},
16371637
]);
16381638
});
1639+
1640+
it('should remove the pinned chip for filtered out parent', () => {
1641+
treeGrid.pinRow(147);
1642+
fix.detectChanges();
1643+
1644+
treeGrid.filter('ID', 957, IgxStringFilteringOperand.instance().condition('contains'), false);
1645+
fix.detectChanges();
1646+
1647+
const firstColumnField = treeGrid.columns[0].field;
1648+
const pinnedChipExpectedPosition = treeGrid.getCellByColumn(1, firstColumnField);
1649+
const pinnedRow = pinnedChipExpectedPosition.row;
1650+
1651+
expect(pinnedChipExpectedPosition.nativeElement.getElementsByClassName('igx-grid__td--pinned-chip').length).toBe(0);
1652+
expect(pinnedRow.disabled).toBe(false);
1653+
});
16391654
});
16401655
});

projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
612612
$implicit: this.isGhostRecord(rowData) ? rowData.recordRef : rowData,
613613
index: this.getRowIndex(rowIndex, pinned),
614614
templateID: this.isSummaryRow(rowData) ? 'summaryRow' : 'dataRow',
615-
disabled: this.isGhostRecord(rowData)
615+
disabled: this.isGhostRecord(rowData) ? rowData.recordRef.isFilteredOutParent === undefined : false
616616
};
617617
}
618618

projects/igniteui-angular/src/lib/paginator/paginator.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { IgxSelectModule } from '../select/index';
77
import { IgxIconModule } from '../icon/index';
88
import { IgxButtonModule } from '../directives/button/button.directive';
99
import { IgxRippleModule } from '../directives/ripple/ripple.directive';
10-
import { IgxInputGroupModule } from '../input-group';
10+
import { IgxInputGroupModule } from '../input-group/index';
1111
import { IPaginatorResourceStrings } from '../core/i18n/paginator-resources';
1212
import { DeprecateProperty } from '../core/deprecateDecorators';
1313

0 commit comments

Comments
 (0)