Skip to content

Commit c0ea5d1

Browse files
authored
Merge branch '7.3.x' into mkirova/fix-5626
2 parents a44aa56 + 0c8d63b commit c0ea5d1

File tree

5 files changed

+58
-3
lines changed

5 files changed

+58
-3
lines changed

projects/igniteui-angular/src/lib/directives/dragdrop/dragdrop.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,8 @@ export class IgxDragDirective implements OnInit, OnDestroy {
856856
const viewPortY = pageY - window.pageYOffset;
857857
if (document['msElementsFromPoint']) {
858858
// Edge and IE special snowflakes
859-
return document['msElementsFromPoint'](viewPortX, viewPortY);
859+
const elements = document['msElementsFromPoint'](viewPortX, viewPortY);
860+
return elements === null ? [] : elements;
860861
} else {
861862
// Other browsers like Chrome, Firefox, Opera
862863
return document.elementsFromPoint(viewPortX, viewPortY);

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,8 +1980,6 @@ export class IgxColumnLayoutComponent extends IgxColumnGroupComponent implements
19801980
}
19811981

19821982
this.children.forEach(child => {
1983-
child.disableHiding = true;
1984-
child.disablePinning = true;
19851983
child.movable = false;
19861984
});
19871985
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export class IgxExcelStyleColumnMovingComponent {
5555
}
5656
} else if (this.grid.unpinnedColumns.indexOf(this.column) === 0 && moveDirection === 0) {
5757
targetColumn = this.grid.pinnedColumns[this.grid.pinnedColumns.length - 1];
58+
if (targetColumn.parent) {
59+
targetColumn = targetColumn.topLevelParent;
60+
}
5861
moveDirection = 1;
5962
} else {
6063
targetColumn = this.findColumn(moveDirection, this.grid.unpinnedColumns);

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5659,6 +5659,44 @@ describe('IgxGrid - Filtering actions - Excel style filtering', () => {
56595659
expect(pinButton.classList.contains('igx-excel-filter__actions-pin--disabled')).toBe(true,
56605660
'pinButton should be disabled');
56615661
}));
5662+
5663+
it('Should pin column next to already pinned group by moving it to the left.', fakeAsync(() => {
5664+
// Test prerequisites
5665+
grid.width = '1000px';
5666+
fix.detectChanges();
5667+
tick(100);
5668+
// Adjust column widths, so their group can be pinned.
5669+
const columnFields = ['ID', 'ProductName', 'Downloads', 'Released', 'ReleaseDate', 'AnotherField'];
5670+
columnFields.forEach((columnField) => {
5671+
const col = grid.columns.find((c) => c.field === columnField);
5672+
col.width = '100px';
5673+
});
5674+
fix.detectChanges();
5675+
// Make 'AnotherField' column movable.
5676+
const column = grid.columns.find((c) => c.field === 'AnotherField');
5677+
column.movable = true;
5678+
fix.detectChanges();
5679+
5680+
// Pin the 'General Information' group by pinning its child 'ProductName' column.
5681+
GridFunctions.clickExcelFilterIcon(fix, 'ProductName');
5682+
fix.detectChanges();
5683+
GridFunctions.clickPinIconInExcelStyleFiltering(fix, false);
5684+
tick(200);
5685+
fix.detectChanges();
5686+
5687+
// Verify 'AnotherField' column is not pinned.
5688+
GridFunctions.verifyColumnIsPinned(column, false, 7);
5689+
5690+
// Try to pin the 'AnotherField' column by moving it to the left.
5691+
GridFunctions.clickExcelFilterIcon(fix, 'AnotherField');
5692+
fix.detectChanges();
5693+
GridFunctions.clickMoveLeftInExcelStyleFiltering(fix);
5694+
tick(200);
5695+
fix.detectChanges();
5696+
5697+
// Verify 'AnotherField' column is successfully pinned next to the column group.
5698+
GridFunctions.verifyColumnIsPinned(column, true, 8);
5699+
}));
56625700
});
56635701
});
56645702

projects/igniteui-angular/src/lib/grids/grid/grid.multi-row-layout.integration.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,21 @@ describe('IgxGrid - multi-row-layout Integration - ', () => {
801801

802802
verifyDOMMatchesLayoutSettings(gridFirstRow, fixture.componentInstance.colGroups);
803803
});
804+
805+
it('should render unpin and hide column buttons into the excel style filter', () => {
806+
const filterIcons = fixture.debugElement.queryAll(By.css('.igx-excel-filter__icon'));
807+
expect(filterIcons.length).not.toBe(0);
808+
809+
filterIcons[0].nativeElement.click();
810+
fixture.detectChanges();
811+
812+
const excelMenu = grid.nativeElement.querySelector('.igx-excel-filter__menu');
813+
const unpinComponent = excelMenu.querySelector('.igx-excel-filter__actions-unpin');
814+
const hideComponent = excelMenu.querySelector('.igx-excel-filter__actions-hide');
815+
816+
expect(unpinComponent).toBeDefined();
817+
expect(hideComponent).toBeDefined();
818+
});
804819
});
805820

806821
describe('GroupBy ', () => {

0 commit comments

Comments
 (0)