Skip to content

Commit 79c3e3c

Browse files
authored
Merge branch 'master' into gedinakova/fix-4947-master
2 parents e00789d + e5f9722 commit 79c3e3c

File tree

5 files changed

+108
-33
lines changed

5 files changed

+108
-33
lines changed

CHANGELOG.md

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Ignite UI for Angular Change Log
22

33
All notable changes for each version of this project will be documented in this file.
4-
54
## 8.0.0
65
- `IgxCombo`: Removed the following deprecated (since 6.2.0) template selectors:
76
- `#emptyTemplate`
@@ -38,7 +37,7 @@ All notable changes for each version of this project will be documented in this
3837
<igx-icon igxListAction>info</igx-icon>
3938
</igx-list-item>
4039
</igx-list>
41-
40+
4241
<igx-list>
4342
<igx-list-item [isHeader]="true">List items</igx-list-item>
4443
<igx-list-item>
@@ -50,7 +49,8 @@ All notable changes for each version of this project will be documented in this
5049
```
5150

5251
## 7.3.4
53-
52+
- `IgxGrid` - summaries
53+
- `clearSummaryCache()` and `recalculateSummaries()` methods are now removed from the IgxGrid API, beacause they are no longer needed; summaries are updated when some change is perform and the summary cache is cleared automatically when needed;
5454
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
5555
- **Breaking Change** The **condition** parameter of the `filterGlobal` method is no longer optional. When the filterGlobal method is called with an invalid condition, it will not clear the existing filters for all columns.
5656

@@ -110,7 +110,7 @@ All notable changes for each version of this project will be documented in this
110110
- `igx-core()` now includes some styles for printing layout.
111111
In order to turn them off, you need to pass an argument and set it to `false`
112112
```
113-
@include igx-core($print-layout: false);
113+
@include igx-core($print-layout: false);
114114
```
115115

116116
- `Pager`
@@ -140,6 +140,11 @@ In order to turn them off, you need to pass an argument and set it to `false`
140140
- Group comparer is not taken into consideration when column is dragged to grouped area #4663
141141

142142
## 7.3.1
143+
`igx-core()` now includes some styles for printing layout. In order to turn them off, you need to pass an argument and set it to `false`
144+
145+
```
146+
@include igx-core($print-layout: false);
147+
```
143148
- `IgxGrid` Custom keyboard navigation
144149
- `onFocusChange` event is deprecated.
145150
- `onGridKeydown` event is exposed which is emitted when `keydown` is triggered over element inside grid's body
@@ -184,7 +189,7 @@ In order to turn them off, you need to pass an argument and set it to `false`
184189
- **Feature** Grid components now supports [Grid Row Dragging ](https://github.com/IgniteUI/igniteui-angular/wiki/Row-Dragging). It lets users pass the data of a grid record on to another surface, which has been configured to process/render this data. It can be enabled by using the `rowDraggable` input of the grid.
185190
186191
- **Feature** The Excel Style Filter dialog and its sub-dialogs now have a display density based on the `displayDensity` input of their respective grid.
187-
- `igxTreeGrid`
192+
- `igxTreeGrid`
188193
- **Feature** The `IgxTreeGridComponent` now supports loading child rows on demand using the newly added `loadChildrenOnDemand` and `hasChildrenKey` input properties.
189194
- `IgxListComponent`
190195
- **Feature** The `IgxListComponent` now provides the ability to choose a display density from a predefined set of options: **compact**, **cosy** and **comfortable** (default one). It can be set by using the `displayDensity` input of the list.
@@ -268,9 +273,9 @@ In order to turn them off, you need to pass an argument and set it to `false`
268273
## 7.2.9
269274
`igx-core()` now includes some styles for printing layout.
270275
In order to turn them off, you need to pass an argument and set it to `false`
271-
276+
272277
```
273-
@include igx-core($print-layout: false);
278+
@include igx-core($print-layout: false);
274279
```
275280
276281
- `Pager`
@@ -288,7 +293,7 @@ In order to turn them off, you need to pass an argument and set it to `false`
288293
- [igx-grid] some cells don't go into edit state or selected state when resizing window. #4746
289294
- igx-tree-grid when no data in grid pagination shows wrong #4666
290295
- ElasticPositionStrategy should resize shown element with Center/Middle directions #4564
291-
- ESF custom dialog new filter not fully visible #4639
296+
- ESF custom dialog new filter not fully visible #4639
292297
- igx-grid: row virtualization doesn't work when setting height in percent if you fetch and bind data after initial rendering. #3949
293298
- Grid height is calculated wrongly as grid width narrows #4745
294299
- [igx-grid][IE11] filtering problems with IME mode. #4636

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

-14
Original file line numberDiff line numberDiff line change
@@ -3718,13 +3718,6 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
37183718
this.gridAPI.clear_sort(name);
37193719
}
37203720

3721-
/**
3722-
* @hidden
3723-
*/
3724-
@DeprecateMethod('There is no need to call clearSummaryCache method.The summary cache is cleared automatically when needed.')
3725-
public clearSummaryCache(args?) {
3726-
}
3727-
37283721
/**
37293722
* @hidden
37303723
*/
@@ -3775,13 +3768,6 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
37753768
this.calculateGridSizes();
37763769
}
37773770

3778-
/**
3779-
* @hidden
3780-
*/
3781-
@DeprecateMethod('There is no need to call recalculateSummaries method. The summaries are recalculated automatically when needed.')
3782-
public recalculateSummaries() {
3783-
}
3784-
37853771
/**
37863772
* Finds the next occurrence of a given string in the grid and scrolls to the cell if it isn't visible.
37873773
* Returns how many times the grid contains the string.

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

+89
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,55 @@ describe('IgxGrid - Summaries', () => {
706706

707707
});
708708

709+
it('CRUD: should not recalc summaries when update cell and rowEditing is set to TRUE', async() => {
710+
const fixture = TestBed.createComponent(SummariesGroupByWithScrollsComponent);
711+
await wait(30);
712+
fixture.detectChanges();
713+
const grid = fixture.componentInstance.grid;
714+
grid.getColumnByName('ID').editable = true;
715+
grid.getColumnByName('ParentID').editable = true;
716+
fixture.detectChanges();
717+
grid.rowEditable = true;
718+
fixture.detectChanges();
719+
720+
grid.groupBy({
721+
fieldName: 'ID', dir: SortingDirection.Asc, ignoreCase: false
722+
});
723+
fixture.detectChanges();
724+
const cell = grid.getCellByColumn(1, 'ParentID');
725+
cell.nativeElement.focus();
726+
fixture.detectChanges();
727+
728+
let summaryRow = fixture.debugElement.query(By.css(SUMMARY_ROW));
729+
HelperUtils.verifyColumnSummaries(summaryRow, 1,
730+
['Count', 'Min', 'Max', 'Sum', 'Avg'], ['1', '17', '17', '17', '17']);
731+
732+
UIInteractions.triggerKeyDownEvtUponElem('enter', cell.nativeElement, true);
733+
await wait(50);
734+
fixture.detectChanges();
735+
736+
const editTemplate = fixture.debugElement.query(By.css('input[type=\'number\']'));
737+
UIInteractions.sendInput(editTemplate, 87);
738+
fixture.detectChanges();
739+
740+
UIInteractions.triggerKeyDownEvtUponElem('tab', cell.nativeElement, true, false, true);
741+
await wait(50);
742+
fixture.detectChanges();
743+
744+
summaryRow = fixture.debugElement.query(By.css(SUMMARY_ROW));
745+
HelperUtils.verifyColumnSummaries(summaryRow, 1,
746+
['Count', 'Min', 'Max', 'Sum', 'Avg'], ['1', '17', '17', '17', '17']);
747+
748+
const idCell = grid.getCellByColumn(1, 'ID');
749+
UIInteractions.triggerKeyDownEvtUponElem('enter', idCell.nativeElement, true);
750+
await wait(50);
751+
fixture.detectChanges();
752+
753+
summaryRow = fixture.debugElement.query(By.css(SUMMARY_ROW));
754+
HelperUtils.verifyColumnSummaries(summaryRow, 1,
755+
['Count', 'Min', 'Max', 'Sum', 'Avg'], ['1', '87', '87', '87', '87']);
756+
});
757+
709758
it('CRUD and GroupBy: recalculate summaries when update cell which is grouped', fakeAsync(/** height/width setter rAF */() => {
710759
const fixture = TestBed.createComponent(SummariesGroupByWithScrollsComponent);
711760
fixture.detectChanges();
@@ -1484,6 +1533,46 @@ describe('IgxGrid - Summaries', () => {
14841533
HelperUtils.verifyColumnSummariesBySummaryRowIndex(fix, 15, 4, ['Min', 'Max'], ['19', '25']);
14851534
}));
14861535

1536+
it('CRUD: summaries should be updated when row is submitted when rowEditable=true', (async () => {
1537+
grid.getColumnByName('Age').editable = true;
1538+
grid.getColumnByName('HireDate').editable = true;
1539+
fix.detectChanges();
1540+
grid.rowEditable = true;
1541+
fix.detectChanges();
1542+
1543+
grid.groupBy({
1544+
fieldName: 'ParentID', dir: SortingDirection.Asc, ignoreCase: false
1545+
});
1546+
fix.detectChanges();
1547+
const cell = grid.getCellByColumn(1, 'Age');
1548+
1549+
let summaryRow = fix.debugElement.query(By.css(SUMMARY_ROW));
1550+
HelperUtils.verifyColumnSummaries(summaryRow, 4, ['Min', 'Max'], ['27', '50']);
1551+
1552+
UIInteractions.triggerKeyDownEvtUponElem('enter', cell.nativeElement, true);
1553+
await wait(50);
1554+
fix.detectChanges();
1555+
1556+
const editTemplate = fix.debugElement.query(By.css('input[type=\'number\']'));
1557+
UIInteractions.sendInput(editTemplate, 87);
1558+
fix.detectChanges();
1559+
1560+
UIInteractions.triggerKeyDownEvtUponElem('tab', cell.nativeElement, true, false, true);
1561+
await wait(50);
1562+
fix.detectChanges();
1563+
1564+
summaryRow = fix.debugElement.query(By.css(SUMMARY_ROW));
1565+
HelperUtils.verifyColumnSummaries(summaryRow, 4, ['Min', 'Max'], ['27', '50']);
1566+
1567+
const hireDateCell = grid.getCellByColumn(1, 'HireDate');
1568+
UIInteractions.triggerKeyDownEvtUponElem('enter', hireDateCell.nativeElement, true);
1569+
await wait(50);
1570+
fix.detectChanges();
1571+
1572+
summaryRow = fix.debugElement.query(By.css(SUMMARY_ROW));
1573+
HelperUtils.verifyColumnSummaries(summaryRow, 4, ['Min', 'Max'], ['27', '87']);
1574+
}));
1575+
14871576
it('Grouping: Update row and change grouping', (async () => {
14881577
grid.groupBy({
14891578
fieldName: 'ParentID', dir: SortingDirection.Asc, ignoreCase: false

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

-1
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,6 @@ describe('IgxGrid Component Tests', () => {
27772777
(<any>grid).gridAPI.get_cell_inEditMode().value = newDate;
27782778
// targetCell.update(newDate);
27792779
fix.detectChanges();
2780-
grid.recalculateSummaries();
27812780

27822781
// get the summaries for a particular column
27832782
const summaries = targetCell.gridAPI.get_summary_data();

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

+6-10
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,23 @@ export class IgxGridSummaryService {
3131
return;
3232
}
3333
if (args.data) {
34-
let rowID = args.rowID;
35-
if (!args.rowID) {
36-
rowID = this.grid.primaryKey ? args.data[this.grid.primaryKey] : args.data;
37-
}
34+
const rowID = this.grid.primaryKey ? args.data[this.grid.primaryKey] : args.data;
3835
this.removeSummaries(rowID);
3936
}
4037
if (args.rowID !== undefined && args.rowID !== null) {
41-
const columnName = args.cellID ? this.grid.columnList.find(col => col.index === args.cellID.columnID).field : undefined;
38+
let columnName = args.cellID ? this.grid.columnList.find(col => col.index === args.cellID.columnID).field : undefined;
39+
if (columnName && this.grid.rowEditable) { return; }
40+
4241
const isGroupedColumn = this.grid.groupingExpressions &&
4342
this.grid.groupingExpressions.map(expr => expr.fieldName).indexOf(columnName) !== -1;
44-
if (columnName && isGroupedColumn) {
45-
this.removeSummaries(args.rowID);
46-
return;
43+
if (columnName && isGroupedColumn ) {
44+
columnName = undefined;
4745
}
4846
this.removeSummaries(args.rowID, columnName);
4947
}
5048
}
5149

5250
public removeSummaries(rowID, columnName?) {
53-
if (this.summaryCacheMap.size === 0) { return; }
5451
this.deleteSummaryCache(this.rootSummaryID, columnName);
5552
if (this.summaryCacheMap.size === 1 && this.summaryCacheMap.has(this.rootSummaryID)) { return; }
5653
if (this.isTreeGrid) {
@@ -65,7 +62,6 @@ export class IgxGridSummaryService {
6562
if (this.grid.transactions.enabled && this.deleteOperation) {
6663
this.deleteOperation = false;
6764
this.summaryCacheMap.clear();
68-
return;
6965
}
7066
} else {
7167
const summaryIds = this.getSummaryID(rowID, this.grid.groupingExpressions);

0 commit comments

Comments
 (0)