Skip to content

Commit 674afef

Browse files
committed
Merge remote-tracking branch 'origin/master' into dpetev/date-util-test-fix
2 parents 4d41f36 + 22c3d77 commit 674afef

File tree

8 files changed

+281
-134
lines changed

8 files changed

+281
-134
lines changed

CHANGELOG.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
All notable changes for each version of this project will be documented in this file.
44

55
## 15.1.0
6-
76
### General
87
- `IgxPivotGrid`
98
- The `IgxPivotDateDimension` properties `inBaseDimension` and `inOption` have been deprecated and renamed to `baseDimension` and `options` respectively.
109
- `IgxGrid`
1110
- **Breaking Change** The `onGroupingDone` output has been renamed to `groupingDone` to not violate the no on-prefixed outputs convention. Automatic migrations are available and will be applied on `ng update`.
1211
- `DisplayDensity`
13-
- **Breaking Change** The `onDensityChanged` output has been renamed to `densityChanged` to not violate the no on-prefixed outputs convention. All components expolsing this event are affected. Automatic migrations are available and will be applied on `ng update`.
12+
- **Breaking Change** The `onDensityChanged` output has been renamed to `densityChanged` to not violate the no on-prefixed outputs convention. All components exposing this event are affected. Automatic migrations are available and will be applied on `ng update`.
13+
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
14+
- **Breaking Change** - `rowSelectionChanging` event arguments are changed. Now the `oldSelection`, `newSelection`, `added` and `removed` collections no longer consist of the row keys of the selected elements when the grid has set a primaryKey, but now in any case the row data is emitted.
15+
When the grid is working with remote data and a primary key has been set- for the selected rows that are not currently part of the grid view, will be emitted a partial row data object.
16+
- **Behavioral Change** - When selected row is deleted from the grid component `rowSelectionChanging` event will no longer be emitted.
1417
- `IgxCarousel`
1518
- **Breaking Change** The `onSlideChanged`, `onSlideAdded`, `onSlideRemoved`, `onCarouselPaused` and `onCarouselPlaying` outputs have been renamed to `slideChanged`, `slideAdded`, `slideRemoved`, `carouselPaused` and `carouselPlaying` to not violate the no on-prefixed outputs convention. Automatic migrations are available and will be applied on `ng update`.
1619
- `IgxRadio`, `IgxRadioGroup`
@@ -24,7 +27,7 @@ All notable changes for each version of this project will be documented in this
2427
- `igxPivotGrid`
2528
- Adding `aggregatorName` for pivot value configuration as an alternative to setting `aggregator` function. If both are set `aggregatorName` takes precedent. If none are set an error is thrown.
2629
- `IgxSimpleCombo`
27-
- **Behavioral Change**
30+
- **Behavioral Change**
2831
- When the user clicks on the combo's input, the dropdown opens up.
2932
- Keyboard navigation `ArrowUp` - when the combo is opened `ArrowUp` will close the dropdown if the search input is focused. If the active item is the first one in the list, the focus will be moved back to the search input while also selecting all of the text in the input. Otherwise `ArrowUp` will move to the previous list item.
3033

@@ -109,7 +112,7 @@ All notable changes for each version of this project will be documented in this
109112

110113
### New Features
111114
- The filtering logic inside the grid's Advanced Filtering is now extracted as a separate `IgxQueryBuilder` component. The Query Builder allows you to build complex queries by specifying AND/OR operators, conditions and values using the UI. It outputs an object describing the structure of the query. Use the `locale` property to modify the locale settings. The default value is resolved to the global Angular application locale. The `resourceStrings` allows changing the displayed strings.
112-
115+
113116
- Code example below:
114117

115118
```html
@@ -145,7 +148,7 @@ All notable changes for each version of this project will be documented in this
145148
<ng-template igxPivotValueChip let-value>
146149
{{ value.member }}
147150
</ng-template>
148-
```
151+
```
149152
- Add support for usage with igxGridState to persist state of the pivotConfiguration with an additional `pivotConfiguration` option:
150153

151154
```html
@@ -161,7 +164,7 @@ All notable changes for each version of this project will be documented in this
161164
```
162165

163166
One known issue of the igxGridState directive is that it cannot store functions as the state is stored as string.
164-
As a result any custom functions set to `memberFunction`, `aggregator`, `formatter`, `styles` etc. will not be stored. Restoring any of these can be achieved with code on application level.
167+
As a result any custom functions set to `memberFunction`, `aggregator`, `formatter`, `styles` etc. will not be stored. Restoring any of these can be achieved with code on application level.
165168
Hence we have also exposed 2 new events:
166169
- `dimensionInit` - emits when a dimension from the configuration is being initialized.
167170
- `valueInit` - emits when a value from the configuration is being initialized.
@@ -221,7 +224,7 @@ All notable changes for each version of this project will be documented in this
221224
<column width='auto' ...>
222225
```
223226
- Added support for restoring filtering expressions with custom filtering operands for the `IgxGridStateDirective`.
224-
227+
225228

226229
- Added the `IgcFormControl` directive that, when imported with its `IgcFormsModule`, is designed to seamlessly attach to form components from the Ignite UI for WebComponents package and allows using them in Angular templates and reactive forms with support for `ngModel` and `formControlName` directives. Currently the only Web Component with support through the directive is `igc-rating`.
227230

@@ -236,7 +239,7 @@ All notable changes for each version of this project will be documented in this
236239

237240
## 14.0.0
238241

239-
- Added additional theme properties for the `IgxCalendar` so that it's easier to style the `:hover` and `:focus` states inside the selected date or range of dates.
242+
- Added additional theme properties for the `IgxCalendar` so that it's easier to style the `:hover` and `:focus` states inside the selected date or range of dates.
240243
- `IgxDatePicker` and `IgxDateRangePicker` now expose a `weekStart` input property like the `IgxCalendar`
241244
- `IgxCombo` and `IgxSimpleComboComponent`
242245
- The combobox `role`, `aria-haspopup`, `aria-expanded`, `aria-controls` and `aria-labelledby` attributes have been moved from combo wrapper to the combo input. Additionally the `IgxSimpleComboComponent` input is marked with `aria-readonly="false"` and `aria-autocomplete="list"` attributes. The `aria-labelled` attribute is applied to the combo dropdown as well and can be set by the `ariaLabelledBy` property, the combo label or placeholder. The serach input within the combo dropdown is now marked as `role="searchbox"`, `aria-label="search"` and `aria-autocomplete="list"`. The dropdown item container has `aria-activedescendant` attribute to identify the currently active element of the item list. The `IgxCombo` container is also marked as `aria-multiselectable="true"`. The dropdown header items role has been changed to `group`.

projects/igniteui-angular/src/lib/grids/api.service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ export class GridBaseAPIService<T extends GridType> implements GridServiceType {
355355
this.deleteRowFromData(rowId, index);
356356

357357
if (grid.selectionService.isRowSelected(rowId)) {
358-
grid.selectionService.deselectRow(rowId);
358+
grid.selectionService.deselectRowsWithNoEvent([rowId]);
359359
} else {
360360
grid.selectionService.clearHeaderCBState();
361361
}

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

+64-46
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ describe('IgxGrid - Row Selection #grid', () => {
4949
describe('Base tests', () => {
5050
let fix: ComponentFixture<RowSelectionComponent>;
5151
let grid: IgxGridComponent;
52+
const gridData = SampleTestData.foodProductDataExtended();
5253

5354
beforeEach(() => {
5455
fix = TestBed.createComponent(RowSelectionComponent);
@@ -134,14 +135,16 @@ describe('IgxGrid - Row Selection #grid', () => {
134135
}));
135136

136137
it('Header checkbox should select/deselect all rows', () => {
137-
const allRowsArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];
138+
const allRows = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19];
139+
const allRowsArray = [gridData[0], gridData[1], gridData[2], gridData[3], gridData[4], gridData[5], gridData[6], gridData[7], gridData[8], gridData[9],
140+
gridData[10], gridData[11], gridData[12], gridData[13], gridData[14], gridData[15], gridData[16], gridData[17], gridData[18]];
138141
spyOn(grid.rowSelectionChanging, 'emit').and.callThrough();
139142
GridSelectionFunctions.clickHeaderRowCheckbox(fix);
140143
fix.detectChanges();
141144

142145
GridSelectionFunctions.verifyHeaderRowCheckboxState(fix, true);
143146
GridSelectionFunctions.verifyRowsArraySelected(grid.rowList.toArray());
144-
expect(grid.selectedRows).toEqual(allRowsArray);
147+
expect(grid.selectedRows).toEqual(allRows);
145148
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(1);
146149
let args: IRowSelectionEventArgs = {
147150
added: allRowsArray,
@@ -150,7 +153,8 @@ describe('IgxGrid - Row Selection #grid', () => {
150153
newSelection: allRowsArray,
151154
oldSelection: [],
152155
removed: [],
153-
allRowsSelected: true
156+
allRowsSelected: true,
157+
owner: grid
154158
};
155159
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
156160

@@ -168,7 +172,8 @@ describe('IgxGrid - Row Selection #grid', () => {
168172
removed: allRowsArray,
169173
event: jasmine.anything() as any,
170174
cancel: false,
171-
allRowsSelected: false
175+
allRowsSelected: false,
176+
owner: grid
172177
};
173178
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
174179
});
@@ -213,13 +218,14 @@ describe('IgxGrid - Row Selection #grid', () => {
213218

214219
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(1);
215220
let args: IRowSelectionEventArgs = {
216-
added: [1],
221+
added: [gridData[0]],
217222
cancel: false,
218223
event: jasmine.anything() as any,
219-
newSelection: [1],
224+
newSelection: [gridData[0]],
220225
oldSelection: [],
221226
removed: [],
222-
allRowsSelected: false
227+
allRowsSelected: false,
228+
owner: grid
223229
};
224230
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
225231

@@ -237,13 +243,14 @@ describe('IgxGrid - Row Selection #grid', () => {
237243
expect(grid.selectedRows).toEqual([1, 2]);
238244
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(2);
239245
args = {
240-
added: [2],
246+
added: [gridData[1]],
241247
cancel: false,
242248
event: jasmine.anything() as any,
243-
newSelection: [1, 2],
244-
oldSelection: [1],
249+
newSelection: [gridData[0], gridData[1]],
250+
oldSelection: [gridData[0]],
245251
removed: [],
246-
allRowsSelected: false
252+
allRowsSelected: false,
253+
owner: grid
247254
};
248255
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
249256

@@ -259,10 +266,11 @@ describe('IgxGrid - Row Selection #grid', () => {
259266
added: [],
260267
cancel: false,
261268
event: jasmine.anything() as any,
262-
newSelection: [2],
263-
oldSelection: [1, 2],
264-
removed: [1],
265-
allRowsSelected: false
269+
newSelection: [gridData[1]],
270+
oldSelection: [gridData[0], gridData[1]],
271+
removed: [gridData[0]],
272+
allRowsSelected: false,
273+
owner: grid
266274
};
267275
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
268276

@@ -278,9 +286,10 @@ describe('IgxGrid - Row Selection #grid', () => {
278286
cancel: false,
279287
event: jasmine.anything() as any,
280288
newSelection: [],
281-
oldSelection: [2],
282-
removed: [2],
283-
allRowsSelected: false
289+
oldSelection: [gridData[1]],
290+
removed: [gridData[1]],
291+
allRowsSelected: false,
292+
owner: grid
284293
};
285294
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
286295
});
@@ -299,13 +308,14 @@ describe('IgxGrid - Row Selection #grid', () => {
299308
expect(grid.selectedRows).toEqual([2]);
300309
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(1);
301310
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith({
302-
added: [2],
311+
added: [gridData[1]],
303312
cancel: false,
304313
event: mockEvent,
305-
newSelection: [2],
314+
newSelection: [gridData[1]],
306315
oldSelection: [],
307316
removed: [],
308-
allRowsSelected: false
317+
allRowsSelected: false,
318+
owner: grid
309319
});
310320

311321
// Click again on same row
@@ -325,13 +335,14 @@ describe('IgxGrid - Row Selection #grid', () => {
325335
expect(grid.selectedRows).toEqual([3]);
326336
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(2);
327337
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith({
328-
added: [3],
338+
added: [gridData[2]],
329339
cancel: false,
330340
event: mockEvent,
331-
newSelection: [3],
332-
oldSelection: [2],
333-
removed: [2],
334-
allRowsSelected: false
341+
newSelection: [gridData[2]],
342+
oldSelection: [gridData[1]],
343+
removed: [gridData[1]],
344+
allRowsSelected: false,
345+
owner: grid
335346
});
336347
});
337348
it('Should select the row only on checkbox click when selectRowOnClick has value false', () => {
@@ -521,13 +532,14 @@ describe('IgxGrid - Row Selection #grid', () => {
521532
expect(grid.selectedRows).toEqual([2, 3, 4, 5]);
522533
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(2);
523534
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith({
524-
added: [3, 4, 5],
535+
added: [gridData[2], gridData[3], gridData[4]],
525536
cancel: false,
526537
event: mockEvent,
527-
newSelection: [2, 3, 4, 5],
528-
oldSelection: [2],
538+
newSelection: [gridData[1], gridData[2], gridData[3], gridData[4]],
539+
oldSelection: [gridData[1]],
529540
removed: [],
530-
allRowsSelected: false
541+
allRowsSelected: false,
542+
owner: grid
531543
});
532544

533545
for (let index = 1; index < 5; index++) {
@@ -704,7 +716,7 @@ describe('IgxGrid - Row Selection #grid', () => {
704716
const secondRow = grid.gridAPI.get_row_by_index(1);
705717
const thirdRow = grid.gridAPI.get_row_by_index(2);
706718
grid.rowSelectionChanging.subscribe((e: IRowSelectionEventArgs) => {
707-
if (e.added.length > 0 && (e.added[0]) % 2 === 0) {
719+
if (e.added.length > 0 && (e.added[0].ProductID) % 2 === 0) {
708720
e.newSelection = e.oldSelection || [];
709721
}
710722
});
@@ -819,6 +831,7 @@ describe('IgxGrid - Row Selection #grid', () => {
819831
describe('RowSelection single', () => {
820832
let fix: ComponentFixture<SingleRowSelectionComponent>;
821833
let grid: IgxGridComponent;
834+
const gridData = SampleTestData.foodProductDataExtended();
822835

823836
beforeEach(() => {
824837
fix = TestBed.createComponent(SingleRowSelectionComponent);
@@ -865,13 +878,14 @@ describe('IgxGrid - Row Selection #grid', () => {
865878

866879
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(1);
867880
let args: IRowSelectionEventArgs = {
868-
added: [1],
881+
added: [gridData[0]],
869882
cancel: false,
870883
event: jasmine.anything() as any,
871-
newSelection: [1],
884+
newSelection: [gridData[0]],
872885
oldSelection: [],
873886
removed: [],
874-
allRowsSelected: false
887+
allRowsSelected: false,
888+
owner: grid
875889
};
876890
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
877891

@@ -888,13 +902,14 @@ describe('IgxGrid - Row Selection #grid', () => {
888902
expect(grid.selectedRows).toEqual([2]);
889903
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(2);
890904
args = {
891-
added: [2],
905+
added: [gridData[1]],
892906
cancel: false,
893907
event: jasmine.anything() as any,
894-
newSelection: [2],
895-
oldSelection: [1],
896-
removed: [1],
897-
allRowsSelected: false
908+
newSelection: [gridData[1]],
909+
oldSelection: [gridData[0]],
910+
removed: [gridData[0]],
911+
allRowsSelected: false,
912+
owner: grid
898913
};
899914
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
900915
});
@@ -1041,13 +1056,14 @@ describe('IgxGrid - Row Selection #grid', () => {
10411056
expect(grid.selectedRows).toEqual([5]);
10421057
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledTimes(2);
10431058
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith({
1044-
added: [5],
1059+
added: [gridData[4]],
10451060
cancel: false,
10461061
event: mockEvent,
1047-
newSelection: [5],
1048-
oldSelection: [2],
1049-
removed: [2],
1050-
allRowsSelected: false
1062+
newSelection: [gridData[4]],
1063+
oldSelection: [gridData[1]],
1064+
removed: [gridData[1]],
1065+
allRowsSelected: false,
1066+
owner: grid
10511067
});
10521068

10531069
GridSelectionFunctions.verifyRowSelected(secondRow);
@@ -1383,7 +1399,8 @@ describe('IgxGrid - Row Selection #grid', () => {
13831399
newSelection: [gridData[1]],
13841400
oldSelection: [],
13851401
removed: [],
1386-
allRowsSelected: false
1402+
allRowsSelected: false,
1403+
owner: grid
13871404
};
13881405
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
13891406

@@ -1399,7 +1416,8 @@ describe('IgxGrid - Row Selection #grid', () => {
13991416
newSelection: [gridData[1], gridData[2], gridData[3], gridData[4]],
14001417
oldSelection: [gridData[1]],
14011418
removed: [],
1402-
allRowsSelected: false
1419+
allRowsSelected: false,
1420+
owner: grid
14031421
};
14041422
expect(grid.rowSelectionChanging.emit).toHaveBeenCalledWith(args);
14051423
});

0 commit comments

Comments
 (0)