Skip to content

Commit a20f5bd

Browse files
HristoP96HristoP96
authored andcommitted
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular into hPopov/refactor-hGrid-selection-tests-master
2 parents e7581d9 + 4e67b5f commit a20f5bd

25 files changed

+434
-129
lines changed

projects/igniteui-angular/src/lib/core/styles/components/navbar/_navbar-theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,6 @@
155155

156156
%igx-navbar-title {
157157
@include igx-type-style($type-scale, $title);
158+
margin-bottom: 0;
158159
}
159160
}

projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,14 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
462462
this.expressionsList[0].expression.searchVal === null &&
463463
this.expressionsList[0].expression.condition.isUnary === false) {
464464
this.filteringService.getExpressions(this.column.field).pop();
465+
466+
this.filter();
465467
} else {
466-
this.expressionsList.forEach((item) => {
467-
if (item.expression.searchVal === null && !item.expression.condition.isUnary) {
468-
this.filteringService.removeExpression(this.column.field, this.expressionsList.indexOf(item));
469-
}
470-
});
468+
const condToRemove = this.expressionsList.filter(ex => ex.expression.searchVal === null && !ex.expression.condition.isUnary);
469+
if (condToRemove && condToRemove.length > 0) {
470+
condToRemove.forEach(c => this.filteringService.removeExpression(this.column.field, this.expressionsList.indexOf(c)));
471+
this.filter();
472+
}
471473
}
472474

473475
this.filteringService.isFilterRowVisible = false;

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,13 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
604604
this.notifyChanges();
605605
}
606606

607+
/**
608+
* @hidden
609+
* @internal
610+
*/
611+
@Input()
612+
public class = '';
613+
607614
/**
608615
* Gets/Sets the height.
609616
* @example
@@ -633,6 +640,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
633640
get hostWidth() {
634641
return this._width || this._hostWidth;
635642
}
643+
636644
/**
637645
* Gets/Sets the width of the grid.
638646
* @example
@@ -1940,7 +1948,10 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
19401948
*/
19411949
@HostBinding('attr.class')
19421950
get hostClass(): string {
1943-
return this.getComponentDensityClass('igx-grid');
1951+
const classes = [this.getComponentDensityClass('igx-grid')];
1952+
// The custom classes should be at the end.
1953+
classes.push(this.class);
1954+
return classes.join(' ');
19441955
}
19451956

19461957
get bannerClass(): string {
@@ -2411,6 +2422,8 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
24112422
*/
24122423
protected destroy$ = new Subject<any>();
24132424

2425+
protected _filteredSortedPinnedData;
2426+
protected _filteredSortedUnpinnedData;
24142427
protected _filteredPinnedData;
24152428
protected _filteredUnpinnedData;
24162429

@@ -2935,6 +2948,22 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
29352948
this.setupColumns();
29362949
}
29372950

2951+
/**
2952+
* @hidden
2953+
* @internal
2954+
*/
2955+
public setFilteredSortedData(data, pinned: boolean) {
2956+
if (this._pinnedRecordIDs.length > 0 && pinned) {
2957+
this._filteredSortedPinnedData = data;
2958+
this.filteredSortedData = this.isRowPinningToTop ? [... this._filteredSortedPinnedData, ... this._filteredSortedUnpinnedData] :
2959+
[... this._filteredSortedUnpinnedData, ... this._filteredSortedPinnedData];
2960+
} else if (this._pinnedRecordIDs.length > 0 && !pinned) {
2961+
this._filteredSortedUnpinnedData = data;
2962+
} else {
2963+
this.filteredSortedData = data;
2964+
}
2965+
}
2966+
29382967
/**
29392968
* @hidden @internal
29402969
*/

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1969,6 +1969,23 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
19691969
const activeFilterIcon = header.nativeElement.querySelector('.igx-excel-filter__icon--filtered');
19701970
expect(activeFilterIcon).toBeDefined('no active filter icon was found');
19711971
}));
1972+
1973+
it('Should clear non-unary conditions with null searchVal when close', fakeAsync(() => {
1974+
GridFunctions.clickFilterCellChip(fix, 'ProductName');
1975+
fix.detectChanges();
1976+
1977+
GridFunctions.openFilterDD(fix.debugElement);
1978+
const dropdownList = fix.debugElement.query(By.css('div.igx-drop-down__list.igx-toggle'));
1979+
GridFunctions.selectFilteringCondition('Empty', dropdownList);
1980+
fix.detectChanges();
1981+
GridFunctions.openFilterDD(fix.debugElement);
1982+
GridFunctions.selectFilteringCondition('Contains', dropdownList);
1983+
fix.detectChanges();
1984+
GridFunctions.closeFilterRow(fix);
1985+
1986+
const headerChip = GridFunctions.getFilterChipsForColumn('ProductName', fix);
1987+
expect(headerChip.length).toBe(1);
1988+
}));
19721989
});
19731990

19741991
describe('Integration scenarios', () => {

0 commit comments

Comments
 (0)