Skip to content

Commit 6660f81

Browse files
authored
Merge branch 'master' into roadmap-update-m19-12-oct
2 parents 533be89 + d4eed07 commit 6660f81

15 files changed

+106
-42
lines changed

CHANGELOG.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@ All notable changes for each version of this project will be documented in this
66

77
### New Features
88
- `IgxCsvExporterService`, `IgxExcelExporterService`
9-
- Exporter services are no longer required to be provided in the application since they are now injected on a root level.
9+
- Exporter services are no longer required to be provided in the application since they are now injected on a root level.
10+
11+
### General
12+
13+
- `IgxDialog`
14+
- **Breaking Change** - The default positionSettings open/close animation has been changed to `fadeIn`/`fadeOut`. The open/close animation can be set through the position settings, e.g. change the animation to the previously default open/close animation:
15+
16+
```typescript
17+
import { slideInBottom, slideOutTop } from 'igniteui-angular';
18+
19+
@ViewChild('alert', { static: true }) public alert: IgxDialogComponent;
20+
public newPositionSettings: PositionSettings = {
21+
openAnimation: useAnimation(slideInBottom, { params: { fromPosition: 'translateY(100%)' } }),
22+
closeAnimation: useAnimation(slideOutTop, { params: { toPosition: 'translateY(-100%)'} })
23+
};
24+
this.alert.positionSettings = this.newPositionSettings;
25+
```
1026

1127
## 12.2.1
1228

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useAnimation } from '@angular/animations';
21
import { CommonModule } from '@angular/common';
32
import {
43
Component,
@@ -22,7 +21,7 @@ import { IgxRippleModule } from '../directives/ripple/ripple.directive';
2221
import { IgxDialogActionsDirective, IgxDialogTitleDirective } from './dialog.directives';
2322
import { IgxToggleModule, IgxToggleDirective } from '../directives/toggle/toggle.directive';
2423
import { OverlaySettings, GlobalPositionStrategy, NoOpScrollStrategy, PositionSettings } from '../services/public_api';
25-
import { slideInBottom, slideOutTop } from '../animations/slide/index';
24+
import {fadeIn, fadeOut} from '../animations/fade/index';
2625
import { IgxFocusModule } from '../directives/focus/focus.directive';
2726
import { CancelableEventArgs, IBaseEventArgs } from '../core/utils';
2827

@@ -459,8 +458,8 @@ export class IgxDialogComponent implements IToggleView, OnInit, OnDestroy, After
459458
protected destroy$ = new Subject<boolean>();
460459

461460
private _positionSettings: PositionSettings = {
462-
openAnimation: useAnimation(slideInBottom, { params: { fromPosition: 'translateY(100%)' } }),
463-
closeAnimation: useAnimation(slideOutTop, { params: { toPosition: 'translateY(-100%)' } })
461+
openAnimation: fadeIn,
462+
closeAnimation: fadeOut
464463
};
465464

466465
private _overlayDefaultSettings: OverlaySettings;

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,10 @@ export class IgxFilteringService implements OnDestroy {
277277
}
278278
}
279279

280+
const emptyFilter = new FilteringExpressionsTree(null, field);
280281
const onFilteringEventArgs: IFilteringEventArgs = {
281282
owner: this.grid,
282-
filteringExpressions: null,
283+
filteringExpressions: emptyFilter,
283284
cancel: false };
284285

285286
this.grid.filtering.emit(onFilteringEventArgs);
@@ -292,7 +293,7 @@ export class IgxFilteringService implements OnDestroy {
292293
this.clear_filter(field);
293294

294295
// Wait for the change detection to update filtered data through the pipes and then emit the event.
295-
requestAnimationFrame(() => this.grid.filteringDone.emit(null));
296+
requestAnimationFrame(() => this.grid.filteringDone.emit(emptyFilter));
296297

297298
if (field) {
298299
const expressions = this.getExpressions(field);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6942,7 +6942,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
69426942

69436943
// eslint-disable-next-line prefer-const
69446944
for (let [row, set] of selectionMap) {
6945-
row = this.paginator ? row + (this.paginator.perPage * this.paginator.page) : row;
6945+
row = this.paginator && source === this.filteredSortedData ? row + (this.paginator.perPage * this.paginator.page) : row;
69466946
row = isRemote ? row - this.virtualizationState.startIndex : row;
69476947
if (!source[row] || source[row].detailsData !== undefined) {
69486948
continue;

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,9 +485,10 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
485485
GridFunctions.clickFilterCellChip(fix, columnName);
486486
GridFunctions.resetFilterRow(fix);
487487

488-
expect(grid.filtering.emit).toHaveBeenCalledWith({ owner: grid, cancel: false, filteringExpressions: null });
488+
const emptyFilter = new FilteringExpressionsTree(null, columnName);
489+
expect(grid.filtering.emit).toHaveBeenCalledWith({ owner: grid, cancel: false, filteringExpressions: emptyFilter });
489490
expect(grid.filtering.emit).toHaveBeenCalledTimes(2);
490-
expect(grid.filteringDone.emit).toHaveBeenCalledWith(null);
491+
expect(grid.filteringDone.emit).toHaveBeenCalledWith(emptyFilter);
491492
expect(grid.filteringDone.emit).toHaveBeenCalledTimes(2);
492493

493494
const filterUiRow = fix.debugElement.query(By.css(FILTER_UI_ROW));
@@ -512,9 +513,10 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
512513
tick(100);
513514
fix.detectChanges();
514515

515-
const args = { owner: grid, cancel: false, filteringExpressions: null };
516+
const emptyFilter = new FilteringExpressionsTree(null, columnName);
517+
const args = { owner: grid, cancel: false, filteringExpressions: emptyFilter };
516518
expect(grid.filtering.emit).toHaveBeenCalledWith(args);
517-
expect(grid.filteringDone.emit).toHaveBeenCalledWith(null);
519+
expect(grid.filteringDone.emit).toHaveBeenCalledWith(emptyFilter);
518520
}));
519521

520522
it('Removing second condition removes the And/Or button', fakeAsync(() => {
@@ -826,13 +828,14 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
826828
spyOn(grid.filtering, 'emit');
827829
spyOn(grid.filteringDone, 'emit');
828830

829-
grid.filter('ProductName', 'I', IgxStringFilteringOperand.instance().condition('startsWith'));
831+
const columnName = 'ProductName';
832+
grid.filter(columnName, 'I', IgxStringFilteringOperand.instance().condition('startsWith'));
830833
tick(30);
831834
fix.detectChanges();
832835

833836
expect(grid.rowList.length).toEqual(2);
834837

835-
const filteringExpressions = grid.filteringExpressionsTree.find('ProductName') as FilteringExpressionsTree;
838+
const filteringExpressions = grid.filteringExpressionsTree.find(columnName) as FilteringExpressionsTree;
836839
const args = { owner: grid, cancel: false, filteringExpressions };
837840
expect(grid.filtering.emit).toHaveBeenCalledWith(args);
838841
expect(grid.filtering.emit).toHaveBeenCalledTimes(1);
@@ -849,10 +852,11 @@ describe('IgxGrid - Filtering Row UI actions #grid', () => {
849852

850853
expect(grid.rowList.length).toEqual(8);
851854

852-
args.filteringExpressions = null;
855+
const emptyFilter = new FilteringExpressionsTree(null, columnName);
856+
args.filteringExpressions = emptyFilter;
853857
expect(grid.filtering.emit).toHaveBeenCalledWith(args);
854858
expect(grid.filtering.emit).toHaveBeenCalledTimes(2);
855-
expect(grid.filteringDone.emit).toHaveBeenCalledWith(null);
859+
expect(grid.filteringDone.emit).toHaveBeenCalledWith(emptyFilter);
856860
expect(grid.filteringDone.emit).toHaveBeenCalledTimes(2);
857861
}));
858862

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

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { TestBed, ComponentFixture, fakeAsync, tick } from '@angular/core/testin
33
import { configureTestSuite } from '../../test-utils/configure-suite';
44
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
55
import { By } from '@angular/platform-browser';
6-
import { UIInteractions, wait, waitForActiveNodeChange} from '../../test-utils/ui-interactions.spec';
6+
import { UIInteractions, wait, waitForActiveNodeChange } from '../../test-utils/ui-interactions.spec';
77
import { IgxGridModule } from './public_api';
88
import { IgxGridComponent } from './grid.component';
99
import { IgxGridRowComponent } from './grid-row.component';
@@ -42,7 +42,7 @@ describe('IgxGrid Master Detail #grid', () => {
4242
}));
4343

4444
describe('Basic', () => {
45-
beforeEach( fakeAsync(() => {
45+
beforeEach(fakeAsync(() => {
4646
fix = TestBed.createComponent(DefaultGridMasterDetailComponent);
4747
fix.detectChanges();
4848
grid = fix.componentInstance.grid;
@@ -689,7 +689,7 @@ describe('IgxGrid Master Detail #grid', () => {
689689

690690
describe('Integration', () => {
691691
describe('Paging', () => {
692-
it('Should not take into account expanded detail views as additional records.', fakeAsync(() => {
692+
it('Should not take into account expanded detail views as additional records.', fakeAsync(() => {
693693
fix = TestBed.createComponent(DefaultGridMasterDetailComponent);
694694
grid = fix.componentInstance.grid;
695695
fix.detectChanges();
@@ -859,6 +859,48 @@ describe('IgxGrid Master Detail #grid', () => {
859859
fix.detectChanges();
860860
expect(grid.getSelectedData()).toEqual(expectedData);
861861
}));
862+
863+
it('getSelectedData should return correct values when there are master details and paging is enabled', fakeAsync(() => {
864+
const range = { rowStart: 0, rowEnd: 5, columnStart: 'ContactName', columnEnd: 'ContactName' };
865+
const expectedDataFromSecondPage = [
866+
{ ContactName: 'Hanna Moos' },
867+
{ ContactName: 'Frédérique Citeaux' },
868+
{ ContactName: 'Martín Sommer' }
869+
];
870+
fix.componentInstance.paging = true;
871+
fix.detectChanges();
872+
grid.paginator.perPage = 5;
873+
fix.detectChanges();
874+
tick(16);
875+
grid.paginator.paginate(1);
876+
fix.detectChanges();
877+
tick(16);
878+
879+
grid.expandAll();
880+
tick(100);
881+
fix.detectChanges();
882+
883+
grid.selectRange(range);
884+
fix.detectChanges();
885+
expect(grid.getSelectedData()).toEqual(expectedDataFromSecondPage);
886+
887+
const expectedDataFromThirdPage = [
888+
{ ContactName: 'Victoria Ashworth' },
889+
{ ContactName: 'Patricio Simpson' },
890+
{ ContactName: 'Francisco Chang' }
891+
];
892+
grid.paginator.paginate(2);
893+
fix.detectChanges();
894+
tick(16);
895+
896+
grid.expandAll();
897+
tick(100);
898+
fix.detectChanges();
899+
900+
grid.selectRange(range);
901+
fix.detectChanges();
902+
expect(grid.getSelectedData()).toEqual(expectedDataFromThirdPage);
903+
}));
862904
});
863905

864906
describe('Row Selection', () => {

0 commit comments

Comments
 (0)