Skip to content

Commit 17fedf7

Browse files
committed
chore(*): merge to master
2 parents 92edf11 + 315d43c commit 17fedf7

14 files changed

+675
-90
lines changed

projects/igniteui-angular/src/lib/core/grid-selection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ export class IgxGridSelectionService {
559559
selectAllRows(event?) {
560560
const allRowIDs = this.getRowIDs(this.allData);
561561
const addedRows = allRowIDs.filter((rID) => !this.isRowSelected(rID));
562-
const newSelection = this.rowSelection.size ? allRowIDs.concat(this.getSelectedRows()) : addedRows;
562+
const newSelection = this.rowSelection.size ? this.getSelectedRows().concat(addedRows) : addedRows;
563563

564564
this.emitRowSelectionEvent(newSelection, addedRows, [], event);
565565
}

projects/igniteui-angular/src/lib/grids/grid/grid-cell-selection.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,12 @@ describe('IgxGrid - Cell selection #grid', () => {
144144
});
145145

146146
it('Should select correct cells with Ctrl key and mouse drag', () => {
147-
pending('Related to the bug 4084');
148147
const range = { rowStart: 3, rowEnd: 2, columnStart: 'Name', columnEnd: 'ParentID' };
149148
const firstCell = grid.getCellByColumn(1, 'ParentID');
150149
const secondCell = grid.getCellByColumn(1, 'ID');
151150
const thirdCell = grid.getCellByColumn(2, 'ParentID');
152151
const expectedData = [
153-
{ ParentID: 147, Name: 'Michael Langdon' },
152+
{ ParentID: 147, Name: 'Monica Reyes' },
154153
{ ParentID: 847, Name: 'Laurence Johnson' },
155154
{ ParentID: 147 }
156155
];

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ describe('IgxGrid - Keyboard navigation #grid', () => {
137137
displayContainer.dispatchEvent(event);
138138
await wait(300);
139139

140-
expect(firstCell.isSelected).toBeFalsy();
141140
expect(firstCell.selected).toBeFalsy();
142141
expect(firstCell.focused).toBeFalsy();
143142
}));
@@ -164,15 +163,15 @@ describe('IgxGrid - Keyboard navigation #grid', () => {
164163
fix.detectChanges();
165164

166165
expect(cell.selected).toBeTruthy();
167-
expect(secondRow.isSelected).toBeTruthy();
166+
expect(secondRow.selected).toBeTruthy();
168167
expect(secondRowCheckbox.classList.contains('igx-checkbox--checked')).toBeTruthy();
169168

170169
UIInteractions.triggerKeyDownEvtUponElem('space', cell.nativeElement, true);
171170
await wait(DEBOUNCETIME);
172171
fix.detectChanges();
173172

174173
expect(cell.selected).toBeTruthy();
175-
expect(secondRow.isSelected).toBeFalsy();
174+
expect(secondRow.selected).toBeFalsy();
176175
expect(secondRowCheckbox.classList.contains('igx-checkbox--checked')).toBeFalsy();
177176

178177
cell = grid.getCellByColumn(1, 'ID');
@@ -190,15 +189,15 @@ describe('IgxGrid - Keyboard navigation #grid', () => {
190189
await wait(DEBOUNCETIME);
191190
fix.detectChanges();
192191

193-
expect(firstRow.isSelected).toBeTruthy();
192+
expect(firstRow.selected).toBeTruthy();
194193
expect(firstRowCheckbox.classList.contains('igx-checkbox--checked')).toBeTruthy();
195194

196195
UIInteractions.triggerKeyDownEvtUponElem('space', cell.nativeElement, true);
197196
await wait(DEBOUNCETIME);
198197
fix.detectChanges();
199198

200199
expect(cell.selected).toBeTruthy();
201-
expect(firstRow.isSelected).toBeFalsy();
200+
expect(firstRow.selected).toBeFalsy();
202201
expect(firstRowCheckbox.classList.contains('igx-checkbox--checked')).toBeFalsy();
203202

204203
UIInteractions.triggerKeyDownWithBlur('tab', cell.nativeElement, true);

projects/igniteui-angular/src/lib/grids/grid/grid-row-editing.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,11 @@ describe('IgxGrid - Row Editing #grid', () => {
800800
expect(grid.endEdit).toHaveBeenCalled();
801801
expect(grid.endEdit).toHaveBeenCalledWith(false, mockEvent);
802802

803-
cell.setEditMode(true);
803+
cell.nativeElement.dispatchEvent(new Event('focus'));
804+
tick(16);
805+
fix.detectChanges();
806+
807+
cell.nativeElement.dispatchEvent(new Event('dblclick'));
804808
tick(16);
805809
fix.detectChanges();
806810
// press Escape on Cancel button

projects/igniteui-angular/src/lib/grids/grid/grid-row-selection.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('IgxGrid - Row Selection #grid', () => {
5454

5555
it('Should have checkbox on each row', (async () => {
5656
GridSelectionFunctions.verifyHeaderRowHasCheckbox(fix);
57-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
57+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
5858

5959
for (const row of grid.rowList.toArray()) {
6060
GridSelectionFunctions.verifyRowHasCheckbox(row.nativeElement);
@@ -64,7 +64,7 @@ describe('IgxGrid - Row Selection #grid', () => {
6464
await wait(100);
6565
fix.detectChanges();
6666

67-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
67+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
6868

6969
for (const row of grid.rowList.toArray()) {
7070
GridSelectionFunctions.verifyRowHasCheckbox(row.nativeElement);
@@ -103,19 +103,19 @@ describe('IgxGrid - Row Selection #grid', () => {
103103
it('Should have correct checkboxes position when scroll left', (async () => {
104104
grid.width = '300px';
105105
fix.detectChanges();
106-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
106+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
107107

108108
GridFunctions.scrollLeft(grid, 1000);
109109
await wait(100);
110110
fix.detectChanges();
111111

112-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
112+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
113113

114114
GridFunctions.scrollLeft(grid, 0);
115115
await wait(100);
116116
fix.detectChanges();
117117

118-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
118+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
119119
}));
120120

121121
it('Header checkbox should select/deselect all rows', () => {
@@ -482,7 +482,7 @@ describe('IgxGrid - Row Selection #grid', () => {
482482
GridSelectionFunctions.verifyRowSelected(firstRow, false);
483483
GridSelectionFunctions.verifyHeaderRowHasCheckbox(fix, false);
484484
GridSelectionFunctions.verifyRowHasCheckbox(firstRow.nativeElement);
485-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
485+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
486486

487487
// Click on a row
488488
UIInteractions.simulateClickEvent(firstRow.nativeElement);
@@ -657,7 +657,7 @@ describe('IgxGrid - Row Selection #grid', () => {
657657
grid.rowSelection = GridSelectionMode.multiple;
658658
fix.detectChanges();
659659

660-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
660+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
661661
GridSelectionFunctions.verifyRowSelected(grid.getRowByIndex(0), false, false);
662662
GridSelectionFunctions.verifyHeaderRowCheckboxState(fix);
663663
GridSelectionFunctions.verifyHeaderRowHasCheckbox(fix);
@@ -677,7 +677,7 @@ describe('IgxGrid - Row Selection #grid', () => {
677677

678678
it('Should have checkbox on each row nd do not have header checkbox', (async () => {
679679
GridSelectionFunctions.verifyHeaderRowHasCheckbox(fix, false);
680-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
680+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
681681

682682
for (const row of grid.rowList.toArray()) {
683683
GridSelectionFunctions.verifyRowHasCheckbox(row.nativeElement);
@@ -688,7 +688,7 @@ describe('IgxGrid - Row Selection #grid', () => {
688688
fix.detectChanges();
689689

690690
GridSelectionFunctions.verifyHeaderRowHasCheckbox(fix, false);
691-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
691+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
692692

693693
for (const row of grid.rowList.toArray()) {
694694
GridSelectionFunctions.verifyRowHasCheckbox(row.nativeElement);
@@ -957,7 +957,7 @@ describe('IgxGrid - Row Selection #grid', () => {
957957
GridSelectionFunctions.verifyRowSelected(firstRow, false);
958958
GridSelectionFunctions.verifyHeaderRowHasCheckbox(fix);
959959
GridSelectionFunctions.verifyRowHasCheckbox(firstRow.nativeElement);
960-
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(fix, grid);
960+
GridSelectionFunctions.verifyHeaderAndRowCheckBoxesAlignment(grid);
961961

962962
// Click on a row
963963
UIInteractions.simulateClickEvent(firstRow.nativeElement);

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,6 @@ describe('IgxGrid - search API #grid', () => {
528528
});
529529

530530
it('Highlight should be updated when a column is hidden and there are other hidden columns', () => {
531-
pending('Related to the bug 3691');
532531
grid.columns[1].hidden = true;
533532
fix.detectChanges();
534533

projects/igniteui-angular/src/lib/grids/grid/row-drag.directive.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ describe('IgxGrid - Row Drag Tests #grid', () => {
593593
const dragIndicatorElement = dragIndicatorElements[2].nativeElement;
594594
const row = dragGridRows[1];
595595
const rowDragDirective = dragRows[1].injector.get(IgxRowDragDirective);
596-
expect(row.isSelected).toBeTruthy();
596+
expect(row.selected).toBeTruthy();
597597

598598
const startPoint: Point = UIInteractions.getPointFromElement(dragIndicatorElement);
599599
const movePoint: Point = UIInteractions.getPointFromElement(dragGridRows[4].nativeElement);
@@ -614,7 +614,7 @@ describe('IgxGrid - Row Drag Tests #grid', () => {
614614
expect(row.grid.rowDragging).toBeFalsy();
615615
verifyRowDragEndEvent(dragGrid, row, rowDragDirective, false);
616616
expect(dropGrid.rowList.length).toEqual(1);
617-
expect(row.isSelected).toBeTruthy();
617+
expect(row.selected).toBeTruthy();
618618
}));
619619
it('should not apply selection class to ghost element when dragging selected grid row', (async () => {
620620
dragGrid.rowSelection = GridSelectionMode.multiple;
@@ -624,7 +624,7 @@ describe('IgxGrid - Row Drag Tests #grid', () => {
624624

625625
const dragIndicatorElement = dragIndicatorElements[2].nativeElement;
626626
const row = dragGridRows[1];
627-
expect(row.isSelected).toBeTruthy();
627+
expect(row.selected).toBeTruthy();
628628

629629
const startPoint: Point = UIInteractions.getPointFromElement(dragIndicatorElement);
630630
const movePoint: Point = UIInteractions.getPointFromElement(dragGridRows[4].nativeElement);

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { GridBaseAPIService } from '../api.service';
33
import { ChangeDetectorRef, ElementRef, ChangeDetectionStrategy, Component,
44
OnInit, HostListener, NgZone } from '@angular/core';
55
import { IgxHierarchicalGridComponent } from './hierarchical-grid.component';
6-
import { IgxHierarchicalSelectionAPIService } from './selection';
76
import { IgxGridSelectionService, IgxGridCRUDService } from '../../core/grid-selection';
87
import { HammerGesturesManager } from '../../core/touch';
98

@@ -23,14 +22,12 @@ export class IgxHierarchicalGridCellComponent extends IgxGridCellComponent imple
2322
protected selectionService: IgxGridSelectionService,
2423
protected crudService: IgxGridCRUDService,
2524
public gridAPI: GridBaseAPIService<IgxHierarchicalGridComponent>,
26-
public selection: IgxHierarchicalSelectionAPIService,
2725
public cdr: ChangeDetectorRef,
2826
private helement: ElementRef,
2927
protected zone: NgZone,
3028
touchManager: HammerGesturesManager
3129
) {
3230
super(selectionService, crudService, gridAPI, cdr, helement, zone, touchManager);
33-
this.hSelection = <IgxHierarchicalSelectionAPIService>selection;
3431
}
3532

3633
ngOnInit() {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { IgxGridHierarchicalPipe, IgxGridHierarchicalPagingPipe } from './hierar
99
import { IgxRowIslandComponent } from './row-island.component';
1010
import { IgxChildGridRowComponent } from './child-grid-row.component';
1111
import { IgxHierarchicalGridCellComponent } from './hierarchical-cell.component';
12-
import { IgxHierarchicalSelectionAPIService } from './selection';
1312
import { IgxRowIslandAPIService } from './row-island-api.service';
1413
import { IgxSelectModule } from '../../select/index';
1514
import { IgxGridComponent } from '../grid/grid.component';
@@ -44,7 +43,6 @@ import { IgxGridComponent } from '../grid/grid.component';
4443
],
4544
providers: [
4645
IgxRowIslandAPIService,
47-
IgxHierarchicalSelectionAPIService
4846
],
4947
entryComponents: [
5048
IgxGridComponent

0 commit comments

Comments
 (0)