Skip to content

Commit 5924250

Browse files
committed
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular into mtsvyatkova/fix-8786-master
2 parents a572f13 + 1215431 commit 5924250

35 files changed

+314
-792
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "../../common/schema/binding.schema.json",
3+
"changes": [
4+
{
5+
"name": "onColumnChange",
6+
"replaceWith": "columnChange",
7+
"owner": {
8+
"selector": "igx-column",
9+
"type": "component"
10+
}
11+
}
12+
]
13+
}

projects/igniteui-angular/migrations/update-12_0_0/index.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,31 @@ $theme: igx-avatar-theme(
5656
$color: black,
5757
$border-radius: 14px
5858
);
59+
`
60+
);
61+
});
62+
63+
it('should update onColumnChange', async () => {
64+
appTree.create(
65+
`/testSrc/appPrefix/component/test.component.html`,
66+
`
67+
<igx-grid>
68+
<igx-column (onColumnChange)="columnChanged()"></igx-column>
69+
</igx-grid>
70+
`
71+
);
72+
73+
const tree = await runner
74+
.runSchematicAsync(migrationName, {}, appTree)
75+
.toPromise();
76+
77+
expect(
78+
tree.readContent('/testSrc/appPrefix/component/test.component.html')
79+
).toEqual(
80+
`
81+
<igx-grid>
82+
<igx-column (columnChange)="columnChanged()"></igx-column>
83+
</igx-grid>
5984
`
6085
);
6186
});

projects/igniteui-angular/src/lib/calendar/calendar.component.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -777,19 +777,19 @@ describe('IgxCalendar - ', () => {
777777

778778
UIInteractions.triggerKeyDownEvtUponElem('PageUp', component.nativeElement);
779779
fixture.detectChanges();
780-
tick(100);
780+
tick();
781781
expect(calendar.viewDate.getMonth()).toEqual(4);
782782

783783
calendar.viewDate = new Date(2017, 5, 13);
784784
fixture.detectChanges();
785785
UIInteractions.triggerKeyDownEvtUponElem('PageDown', component.nativeElement);
786786
fixture.detectChanges();
787-
tick(100);
787+
tick();
788788

789789
expect(calendar.viewDate.getMonth()).toEqual(6);
790790
UIInteractions.triggerKeyDownEvtUponElem('PageUp', component.nativeElement, true, false, true);
791791
fixture.detectChanges();
792-
tick(100);
792+
tick();
793793

794794
expect(calendar.viewDate.getFullYear()).toEqual(2016);
795795

@@ -798,7 +798,7 @@ describe('IgxCalendar - ', () => {
798798

799799
UIInteractions.triggerKeyDownEvtUponElem('PageDown', component.nativeElement, true, false, true);
800800
fixture.detectChanges();
801-
tick(100);
801+
tick();
802802

803803
expect(calendar.viewDate.getFullYear()).toEqual(2018);
804804
}));
@@ -1957,13 +1957,13 @@ describe('IgxCalendar - ', () => {
19571957
// Have no idea how this test worked before,
19581958
// changing expectation based on my udnerstanding of that the test does
19591959
UIInteractions.simulateMouseEvent('mousedown', prevMonthBtn, 0, 0);
1960-
tick(900);
1960+
tick();
19611961
UIInteractions.simulateMouseEvent('mouseup', prevMonthBtn, 0, 0);
19621962
fixture.detectChanges();
19631963
expect(calendar.viewDate.getMonth()).toEqual(4);
19641964

19651965
UIInteractions.simulateMouseEvent('mousedown', nextMonthBtn, 0, 0);
1966-
tick(900);
1966+
tick();
19671967
UIInteractions.simulateMouseEvent('mouseup', nextMonthBtn, 0, 0);
19681968
fixture.detectChanges();
19691969
flush();
@@ -1975,13 +1975,13 @@ describe('IgxCalendar - ', () => {
19751975

19761976
prevMonthBtn.focus();
19771977
UIInteractions.triggerKeyDownEvtUponElem('Enter', prevMonthBtn);
1978-
tick(800);
1978+
tick(100);
19791979
fixture.detectChanges();
19801980
expect(calendar.viewDate.getMonth()).toEqual(4);
19811981

19821982
nextMonthBtn.focus();
19831983
UIInteractions.triggerKeyDownEvtUponElem('Enter', nextMonthBtn);
1984-
tick(800);
1984+
tick(100);
19851985
fixture.detectChanges();
19861986
expect(calendar.viewDate.getMonth()).toEqual(5);
19871987
}));

projects/igniteui-angular/src/lib/directives/template-outlet/template_outlet.directive.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class IgxTemplateOutletDirective implements OnChanges {
3838
constructor(public _viewContainerRef: ViewContainerRef, private _zone: NgZone, public cdr: ChangeDetectorRef) {
3939
}
4040

41-
ngOnChanges(changes: SimpleChanges) {
41+
public ngOnChanges(changes: SimpleChanges) {
4242
const actionType: TemplateOutletAction = this._getActionType(changes);
4343
switch (actionType) {
4444
case TemplateOutletAction.CreateView: this._recreateView(); break;

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
165165
return args;
166166
}
167167

168-
update_cell(cell: IgxCell, value: any, event?: Event) {
168+
public update_cell(cell: IgxCell, value: any, event?: Event) {
169169
cell.editValue = value;
170170
const args = cell.createEditEventArgs(true, event);
171171

@@ -195,31 +195,15 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
195195
if (!this.grid.rowEditable || !this.grid.crudService.row ||
196196
this.grid.crudService.row.id !== cell.id.rowID || !this.grid.transactions.enabled) {
197197
this.grid.summaryService.clearSummaryCache(args);
198-
(this.grid as any)._pipeTrigger++;
198+
this.grid.pipeTrigger++;
199199
}
200200

201201
const doneArgs = cell.createDoneEditEventArgs(args.newValue, event);
202202
this.grid.cellEditDone.emit(doneArgs);
203203
return args;
204204
}
205205

206-
_update_row(row: IgxRow, value?: any) {
207-
const grid = this.grid;
208-
209-
const rowInEditMode = grid.crudService.row;
210-
row.newData = value ?? rowInEditMode.transactionState;
211-
212-
213-
if (rowInEditMode && row.id === rowInEditMode.id) {
214-
row.data = { ...row.data, ...rowInEditMode.transactionState };
215-
// TODO: Workaround for updating a row in edit mode through the API
216-
} else if (this.grid.transactions.enabled) {
217-
const state = grid.transactions.getState(row.id);
218-
row.data = state ? Object.assign({}, row.data, state.value) : row.data;
219-
}
220-
}
221-
222-
update_row(row: IgxRow, value: any, event?: Event) {
206+
public update_row(row: IgxRow, value: any, event?: Event) {
223207
const grid = this.grid;
224208
const selected = grid.selectionService.isRowSelected(row.id);
225209
const rowInEditMode = grid.crudService.row;
@@ -269,7 +253,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
269253
if (hasSummarized) {
270254
grid.summaryService.removeSummaries(newId);
271255
}
272-
(grid as any)._pipeTrigger++;
256+
grid.pipeTrigger++;
273257

274258
const doneArgs = row.createDoneEditEventArgs(cachedRowData, event);
275259
grid.rowEditDone.emit(doneArgs);
@@ -448,7 +432,7 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
448432
} else {
449433
grid.selectionService.clearHeaderCBState();
450434
}
451-
(grid as any)._pipeTrigger++;
435+
grid.pipeTrigger++;
452436
grid.notifyChanges();
453437
// Data needs to be recalculated if transactions are in place
454438
// If no transactions, `data` will be a reference to the grid getter, otherwise it will be stale
@@ -652,4 +636,20 @@ export class GridBaseAPIService <T extends IgxGridBaseDirective & GridType> {
652636
return this.get_column_by_name(fieldName) ?
653637
this.get_column_by_name(fieldName).sortStrategy : undefined;
654638
}
639+
640+
private _update_row(row: IgxRow, value?: any) {
641+
const grid = this.grid;
642+
643+
const rowInEditMode = grid.crudService.row;
644+
row.newData = value ?? rowInEditMode.transactionState;
645+
646+
647+
if (rowInEditMode && row.id === rowInEditMode.id) {
648+
row.data = { ...row.data, ...rowInEditMode.transactionState };
649+
// TODO: Workaround for updating a row in edit mode through the API
650+
} else if (this.grid.transactions.enabled) {
651+
const state = grid.transactions.getState(row.id);
652+
row.data = state ? Object.assign({}, row.data, state.value) : row.data;
653+
}
654+
}
655655
}

0 commit comments

Comments
 (0)