Skip to content

Commit a5dbd5b

Browse files
authored
Merge branch '8.1.x' into mkirova/fix-5751-8.1.x
2 parents 20e84f5 + 907a90e commit a5dbd5b

File tree

7 files changed

+51
-7
lines changed

7 files changed

+51
-7
lines changed

projects/igniteui-angular/src/lib/core/styles/components/grid/_excel-filtering-theme.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
/// @requires --var
1313
@mixin _excel-filtering($theme, $palette) {
1414
%grid-excel-filter {
15-
height: rem(15px);
1615
display: block;
1716
}
1817

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,19 @@ describe('IgxForOf directive -', () => {
255255
}
256256
});
257257

258+
it('should not throw error when itemSize is changed while data is null/undefined.', () => {
259+
let errorMessage = '';
260+
fix.componentInstance.data = null;
261+
fix.detectChanges();
262+
try {
263+
fix.componentInstance.itemSize = '100px';
264+
fix.detectChanges();
265+
} catch (ex) {
266+
errorMessage = ex.message;
267+
}
268+
expect(errorMessage).toBe('');
269+
});
270+
258271
it('should allow initially undefined value for igxForOf and then detect changes correctly once the value is updated', async () => {
259272
fix = TestBed.createComponent(VerticalVirtualNoDataComponent);
260273
expect(() => {

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,8 @@ export class IgxForOfDirective<T> implements OnInit, OnChanges, DoCheck, OnDestr
423423
}
424424
}
425425
const defaultItemSize = 'igxForItemSize';
426-
if (defaultItemSize in changes && !changes[defaultItemSize].firstChange && this.igxForScrollOrientation === 'vertical') {
426+
if (defaultItemSize in changes && !changes[defaultItemSize].firstChange &&
427+
this.igxForScrollOrientation === 'vertical' && this.igxForOf) {
427428
// handle default item size changed.
428429
this.initSizesCache(this.igxForOf);
429430
this._applyChanges();
@@ -1325,7 +1326,8 @@ export class IgxGridForOfDirective<T> extends IgxForOfDirective<T> implements On
13251326
}
13261327
}
13271328
const defaultItemSize = 'igxForItemSize';
1328-
if (defaultItemSize in changes && !changes[defaultItemSize].firstChange && this.igxForScrollOrientation === 'vertical') {
1329+
if (defaultItemSize in changes && !changes[defaultItemSize].firstChange &&
1330+
this.igxForScrollOrientation === 'vertical' && this.igxForOf) {
13291331
// handle default item size changed.
13301332
this.initSizesCache(this.igxForOf);
13311333
}

projects/igniteui-angular/src/lib/grids/filtering/excel-style/grid.excel-style-filtering.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import {
1414
import {
1515
HorizontalAlignment,
1616
VerticalAlignment,
17-
ConnectedPositioningStrategy,
1817
OverlaySettings,
1918
IgxOverlayService,
20-
AbsoluteScrollStrategy
19+
AbsoluteScrollStrategy,
20+
AutoPositionStrategy
2121
} from '../../../services/index';
2222
import { IgxFilteringService, ExpressionUI } from '../grid-filtering.service';
2323
import { IgxToggleDirective } from '../../../directives/toggle/toggle.directive';
@@ -115,7 +115,7 @@ export class IgxGridExcelStyleFilteringComponent implements OnDestroy, OnInit, A
115115
private _subMenuOverlaySettings: OverlaySettings = {
116116
closeOnOutsideClick: true,
117117
modal: false,
118-
positionStrategy: new ConnectedPositioningStrategy(this._subMenuPositionSettings),
118+
positionStrategy: new AutoPositionStrategy(this._subMenuPositionSettings),
119119
scrollStrategy: new AbsoluteScrollStrategy()
120120
};
121121

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export abstract class IgxHierarchicalGridBaseComponent extends IgxGridBaseCompon
163163
const result = flatten(columns);
164164
this.columnList.reset(result);
165165
this.columnList.notifyOnChanges();
166+
this.initPinning();
166167
}
167168

168169
protected _createColumn(col) {

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,35 @@ describe('IgxHierarchicalGrid Integration', () => {
942942
expect(childGrid.columnList.toArray()[0].pinned).toBeTruthy();
943943
expect(headers[0].classList.contains('igx-grid__th--pinned')).toBeTruthy();
944944
}));
945+
946+
it('should be applied correctly for child grid with multi-column header.', (() => {
947+
const ri = fixture.componentInstance.rowIsland;
948+
const col = ri.columnList.find(x => x.header === 'Information');
949+
col.pinned = true;
950+
fixture.detectChanges();
951+
952+
const row = hierarchicalGrid.getRowByIndex(0) as IgxHierarchicalRowComponent;
953+
UIInteractions.clickElement(row.expander);
954+
fixture.detectChanges();
955+
956+
const childGrids = fixture.debugElement.queryAll(By.css('igx-child-grid-row'));
957+
const childGrid = childGrids[0].query(By.css('igx-hierarchical-grid')).componentInstance;
958+
// check unpinned/pinned columns
959+
expect(childGrid.pinnedColumns.length).toBe(3);
960+
expect(childGrid.unpinnedColumns.length).toBe(1);
961+
// check cells
962+
const cells = childGrid.getRowByIndex(0).cells;
963+
expect(cells.length).toBe(3);
964+
let cell = childGrid.getCellByColumn(0, 'ChildLevels');
965+
expect(cell.visibleColumnIndex).toEqual(0);
966+
expect(cell.nativeElement.classList.contains('igx-grid__td--pinned')).toBe(true);
967+
cell = childGrid.getCellByColumn(0, 'ProductName');
968+
expect(cell.visibleColumnIndex).toEqual(1);
969+
expect(cell.nativeElement.classList.contains('igx-grid__td--pinned')).toBe(true);
970+
cell = childGrid.getCellByColumn(0, 'ID');
971+
expect(cell.visibleColumnIndex).toEqual(2);
972+
expect(cell.nativeElement.classList.contains('igx-grid__td--pinned')).toBe(false);
973+
}));
945974
});
946975
});
947976

src/app/hierarchical-grid-remote/hierarchical-grid-remote.sample.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<button (click)='setterBindingChange()'>Set rowSelectable via binding</button>
22
<button (click)='setterChange()'>Set rowSelectable via setter on 1st row island</button>
3-
<igx-hierarchical-grid #grid1 [data]="remoteData" [primaryKey]="'CustomerID'" [autoGenerate]="false" [height]="'800px'" [width]="'100%'" #hGrid [emptyGridMessage]="''">
3+
<igx-hierarchical-grid #grid1 displayDensity="cosy" [data]="remoteData" [primaryKey]="'CustomerID'" [autoGenerate]="false" [height]="'800px'" [width]="'100%'" #hGrid [emptyGridMessage]="''">
44
<igx-column field="CustomerID"></igx-column>
55
<igx-column field="CompanyName"></igx-column>
66
<igx-column field="ContactName"></igx-column>

0 commit comments

Comments
 (0)