Skip to content

Commit b8b33e2

Browse files
authored
Merge pull request #8993 from IgniteUI/gedinakova/fix-8982-master
Renamed exporters' onColumnExport and onRowExport events
2 parents bfa8130 + 9450101 commit b8b33e2

File tree

7 files changed

+271
-55
lines changed

7 files changed

+271
-55
lines changed

CHANGELOG.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ All notable changes for each version of this project will be documented in this
1313
- Added support for filtering based on the formatted cell values using the `FormattedValuesFilteringStrategy` for `IgxGrid`/`IgxHierarchicalGrid` and `TreeGridFormattedValuesFilteringStrategy` for `IgxTreeGrid`.
1414
- `IgxPaginator`
1515
- `paging` and `pagingDone` events are now emitted.
16-
- `IgxInput` now supports `type="file"` and its styling upon all themes.
16+
- `IgxInput` now supports `type="file"` and its styling upon all themes.
1717
_Note: validation of file type input is not yet supported._
1818

1919
### General
@@ -93,7 +93,27 @@ All notable changes for each version of this project will be documented in this
9393
- `page`, `perPage`, `paginate`, `nextPage`, `previousPage` and `totalPages` in the grids are deprecated and will be removed. Use the corresponding `IgxPaginator` outputs/inputs. When using an external paginator, take care to provide the corresponding slice of data. See [`Paging with Custom Template`](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/paging#remote-paging-with-custom-template)
9494
- IgxButton
9595
- IgxIcon(s) placed in a button now include margin if there are one or more sibling elements to give them some breathing room. The amount of margin applied depends on the display density of the button.
96-
96+
- `IgxListComponent`
97+
- **Breaking Change** - The following outputs are renamed:
98+
- `onLeftPan` to `leftPan`
99+
- `onRightPan` to `rightPan`
100+
- `onPanStateChange` to `panStateChange`
101+
- `onItemClicked` to `itemClicked`
102+
- `IgxNavbarComponent`
103+
- **Breaking Change** - The `onAction` output is renamed to `action`.
104+
- `IgxTabsComponent`
105+
- **Breaking Change** - The following outputs are renamed:
106+
- `onTabItemSelected` to `tabItemSelected`
107+
- `onTabItemDeselected` to `tabItemDeselected`
108+
- `IgxTooltipTargetDirective`
109+
- **Breaking Change** - The following outputs are renamed:
110+
- `onTooltipShow` to `tooltipShow`
111+
- `onTooltipHide` to `tooltipHide`
112+
- `IgxBaseExporter`, `IgxExcelExporterService`, `IgxCsvExporterService`
113+
- **Breaking Change** - The following outputs are renamed:
114+
- `onColumnExport` to `columnExporting`
115+
- `onRowExport` to `rowExporting`
116+
- `onExportEnded` to `exportEnded`
97117
98118
## 11.0.4
99119

projects/igniteui-angular/migrations/update-11_1_0/changes/members.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,83 @@
282282
"definedIn": [
283283
"IgxMonthsViewComponent"
284284
]
285+
},
286+
{
287+
"member": "onRowExport",
288+
"replaceWith": "rowExporting",
289+
"definedIn": [
290+
"IgxBaseExporter"
291+
]
292+
},
293+
{
294+
"member": "onColumnExport",
295+
"replaceWith": "columnExporting",
296+
"definedIn": [
297+
"IgxBaseExporter"
298+
]
299+
},
300+
{
301+
"member": "onAction",
302+
"replaceWith": "action",
303+
"definedIn": [
304+
"IgxNavbarComponent"
305+
]
306+
},
307+
{
308+
"member": "onLeftPan",
309+
"replaceWith": "leftPan",
310+
"definedIn": [
311+
"IgxListComponent"
312+
]
313+
},
314+
{
315+
"member": "onRightPan",
316+
"replaceWith": "rightPan",
317+
"definedIn": [
318+
"IgxListComponent"
319+
]
320+
},
321+
{
322+
"member": "onPanStateChange",
323+
"replaceWith": "panStateChange",
324+
"definedIn": [
325+
"IgxListComponent"
326+
]
327+
},
328+
{
329+
"member": "onItemClicked",
330+
"replaceWith": "itemClicked",
331+
"definedIn": [
332+
"IgxListComponent"
333+
]
334+
},
335+
{
336+
"member": "onTabItemSelected",
337+
"replaceWith": "tabItemSelected",
338+
"definedIn": [
339+
"IgxTabsComponent"
340+
]
341+
},
342+
{
343+
"member": "onTabItemDeselected",
344+
"replaceWith": "tabItemDeselected",
345+
"definedIn": [
346+
"IgxTabsComponent"
347+
]
348+
},
349+
{
350+
"member": "onTooltipShow",
351+
"replaceWith": "tooltipShow",
352+
"definedIn": [
353+
"IgxTooltipTargetDirective"
354+
]
355+
},
356+
{
357+
"member": "onTooltipHide",
358+
"replaceWith": "tooltipHide",
359+
"definedIn": [
360+
"IgxTooltipTargetDirective"
361+
]
285362
}
286363
]
287364
}

projects/igniteui-angular/migrations/update-11_1_0/index.spec.ts

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,4 +630,123 @@ export class CsvExportComponent {
630630
></igx-month-picker>`
631631
);
632632
});
633+
634+
it('should update Excel exporter onColumnExport and onRowExport event names to columnmExporting and rowExporting', async () => {
635+
pending('set up tests for migrations through lang service');
636+
appTree.create(
637+
'/testSrc/appPrefix/component/excel-export.component.ts',
638+
`import { Component } from '@angular/core';
639+
import { IgxExcelExporterService } from "igniteui-angular";
640+
641+
@Component({
642+
selector: "app-excel-export",
643+
styleUrls: ["./excel-export.component.scss"],
644+
templateUrl: "./excel-export.component.html"
645+
})
646+
export class ExcelExportComponent {
647+
constructor(private excelExportService: IgxExcelExporterService) {
648+
this.excelExportService.onColumnExport.subscribe();
649+
this.excelExportService.onRowExport.subscribe();
650+
}
651+
}
652+
@NgModule({
653+
declarations: [ExcelExportComponent],
654+
exports: [ExcelExportComponent],
655+
imports: [],
656+
providers: [IgxExcelExporterService]
657+
});
658+
`);
659+
660+
const tree = await runner
661+
.runSchematicAsync('migration-19', {}, appTree)
662+
.toPromise();
663+
664+
const expectedContent =
665+
`import { Component } from '@angular/core';
666+
import { IgxExcelExporterService } from "igniteui-angular";
667+
668+
@Component({
669+
selector: "app-excel-export",
670+
styleUrls: ["./excel-export.component.scss"],
671+
templateUrl: "./excel-export.component.html"
672+
})
673+
export class ExcelExportComponent {
674+
constructor(private excelExportService: IgxExcelExporterService) {
675+
this.excelExportService.columnExporting.subscribe();
676+
this.excelExportService.rowExporting.subscribe();
677+
}
678+
}
679+
@NgModule({
680+
declarations: [ExcelExportComponent],
681+
exports: [ExcelExportComponent],
682+
imports: [],
683+
providers: [IgxExcelExporterService]
684+
});
685+
`;
686+
687+
expect(
688+
tree.readContent(
689+
'/testSrc/appPrefix/component/excel-export.component.ts'
690+
)
691+
).toEqual(expectedContent);
692+
});
693+
694+
it('should update CSV exporter onColumnExport and onRowExport event names to columnmExporting and rowExporting', async () => {
695+
pending('set up tests for migrations through lang service');
696+
appTree.create(
697+
'/testSrc/appPrefix/component/csv-export.component.ts',
698+
`import { Component } from '@angular/core';
699+
import { IgxCsvExporterService } from "igniteui-angular";
700+
701+
@Component({
702+
selector: "app-csv-export",
703+
styleUrls: ["./csv-export.component.scss"],
704+
templateUrl: "./csv-export.component.html"
705+
})
706+
export class CsvExportComponent {
707+
constructor(private csvExportService: IgxCsvExporterService) {
708+
this.csvExportService.onColumnExport.subscribe();
709+
this.csvExportService.onRowExport.subscribe();
710+
}
711+
}
712+
@NgModule({
713+
declarations: [CsvExportComponent],
714+
exports: [CsvExportComponent],
715+
imports: [],
716+
providers: [IgxCsvExporterService]
717+
});
718+
`);
719+
720+
const tree = await runner
721+
.runSchematicAsync('migration-19', {}, appTree)
722+
.toPromise();
723+
724+
const expectedContent =
725+
`import { Component } from '@angular/core';
726+
import { IgxCsvExporterService } from "igniteui-angular";
727+
728+
@Component({
729+
selector: "app-csv-export",
730+
styleUrls: ["./csv-export.component.scss"],
731+
templateUrl: "./csv-export.component.html"
732+
})
733+
export class CsvExportComponent {
734+
constructor(private csvExportService: IgxCsvExporterService) {
735+
this.csvExportService.columnExporting.subscribe();
736+
this.csvExportService.rowExporting.subscribe();
737+
}
738+
}
739+
@NgModule({
740+
declarations: [CsvExportComponent],
741+
exports: [CsvExportComponent],
742+
imports: [],
743+
providers: [IgxCsvExporterService]
744+
});
745+
`;
746+
expect(
747+
tree.readContent(
748+
'/testSrc/appPrefix/component/csv-export.component.ts'
749+
)
750+
).toEqual(expectedContent);
751+
});
633752
});

projects/igniteui-angular/src/lib/services/csv/csv-exporter-grid.spec.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ describe('CSV Grid Exporter', () => {
4949
}));
5050

5151
afterEach(waitForAsync(() => {
52-
exporter.onColumnExport.unsubscribe();
53-
exporter.onRowExport.unsubscribe();
52+
exporter.columnExporting.unsubscribe();
53+
exporter.rowExporting.unsubscribe();
5454
}));
5555

5656
it('should export grid as displayed.', async () => {
@@ -212,14 +212,14 @@ describe('CSV Grid Exporter', () => {
212212
wrapper.verifyData(wrapper.simpleGridData, 'Name should not have been the first field!');
213213
});
214214

215-
it('should fire \'onColumnExport\' for each grid column.', async () => {
215+
it('should fire \'columnExporting\' for each grid column.', async () => {
216216
const fix = TestBed.createComponent(GridIDNameJobTitleComponent);
217217
fix.detectChanges();
218218

219219
const grid = fix.componentInstance.grid;
220220
const cols = [];
221221

222-
exporter.onColumnExport.subscribe((value) => {
222+
exporter.columnExporting.subscribe((value) => {
223223
cols.push({ header: value.header, index: value.columnIndex });
224224
});
225225

@@ -234,14 +234,14 @@ describe('CSV Grid Exporter', () => {
234234
wrapper.verifyData(wrapper.simpleGridData);
235235
});
236236

237-
it('should fire \'onColumnExport\' for each visible grid column.', async () => {
237+
it('should fire \'columnExporting\' for each visible grid column.', async () => {
238238
const fix = TestBed.createComponent(GridIDNameJobTitleComponent);
239239
fix.detectChanges();
240240

241241
const grid = fix.componentInstance.grid;
242242
const cols = [];
243243

244-
exporter.onColumnExport.subscribe((value) => {
244+
exporter.columnExporting.subscribe((value) => {
245245
cols.push({ header: value.header, index: value.columnIndex });
246246
});
247247

@@ -258,28 +258,28 @@ describe('CSV Grid Exporter', () => {
258258
wrapper.verifyData(wrapper.gridNameJobTitle);
259259
});
260260

261-
it('should not export columns when \'onColumnExport\' is canceled.', async () => {
261+
it('should not export columns when \'columnExporting\' is canceled.', async () => {
262262
const fix = TestBed.createComponent(GridIDNameJobTitleComponent);
263263
fix.detectChanges();
264264

265265
const grid = fix.componentInstance.grid;
266266

267-
exporter.onColumnExport.subscribe((value: IColumnExportingEventArgs) => {
267+
exporter.columnExporting.subscribe((value: IColumnExportingEventArgs) => {
268268
value.cancel = true;
269269
});
270270

271271
const wrapper = await getExportedData(grid, options);
272272
wrapper.verifyData('');
273273
});
274274

275-
it('should fire \'onRowExport\' for each grid row.', async () => {
275+
it('should fire \'rowExporting\' for each grid row.', async () => {
276276
const fix = TestBed.createComponent(GridIDNameJobTitleComponent);
277277
fix.detectChanges();
278278

279279
const grid = fix.componentInstance.grid;
280280
const rows = [];
281281

282-
exporter.onRowExport.subscribe((value: IRowExportingEventArgs) => {
282+
exporter.rowExporting.subscribe((value: IRowExportingEventArgs) => {
283283
rows.push({ data: value.rowData, index: value.rowIndex });
284284
});
285285

@@ -292,13 +292,13 @@ describe('CSV Grid Exporter', () => {
292292
}
293293
});
294294

295-
it('should not export rows when \'onRowExport\' is canceled.', async () => {
295+
it('should not export rows when \'rowExporting\' is canceled.', async () => {
296296
const fix = TestBed.createComponent(GridIDNameJobTitleComponent);
297297
fix.detectChanges();
298298

299299
const grid = fix.componentInstance.grid;
300300

301-
exporter.onRowExport.subscribe((value: IRowExportingEventArgs) => {
301+
exporter.rowExporting.subscribe((value: IRowExportingEventArgs) => {
302302
value.cancel = true;
303303
});
304304

@@ -318,14 +318,14 @@ describe('CSV Grid Exporter', () => {
318318
let wrapper = await getExportedData(grid, options);
319319
wrapper.verifyData(wrapper.simpleGridDataFormatted, 'Columns\' formatter should not be skipped.');
320320

321-
exporter.onColumnExport.subscribe((val: IColumnExportingEventArgs) => {
321+
exporter.columnExporting.subscribe((val: IColumnExportingEventArgs) => {
322322
val.skipFormatter = true;
323323
});
324324
grid.cdr.detectChanges();
325325
wrapper = await getExportedData(grid, options);
326326
wrapper.verifyData(wrapper.simpleGridData, 'Columns formatter should be skipped.');
327327

328-
exporter.onColumnExport.subscribe((val: IColumnExportingEventArgs) => {
328+
exporter.columnExporting.subscribe((val: IColumnExportingEventArgs) => {
329329
val.skipFormatter = false;
330330
});
331331
grid.cdr.detectChanges();
@@ -430,10 +430,10 @@ describe('CSV Grid Exporter', () => {
430430
wrapper.verifyData(wrapper.treeGridDataFilterSorted);
431431
});
432432

433-
it('should fire \'onRowExport\' for each tree grid row.', async () => {
433+
it('should fire \'rowExporting\' for each tree grid row.', async () => {
434434
const rows = [];
435435

436-
exporter.onRowExport.subscribe((value: IRowExportingEventArgs) => {
436+
exporter.rowExporting.subscribe((value: IRowExportingEventArgs) => {
437437
rows.push({ data: value.rowData, index: value.rowIndex });
438438
});
439439

@@ -446,7 +446,7 @@ describe('CSV Grid Exporter', () => {
446446
}
447447
});
448448

449-
it('should skip the column formatter when onColumnExporting skipFormatter is true.', async () => {
449+
it('should skip the column formatter when columnExportinging skipFormatter is true.', async () => {
450450
treeGrid.columns[3].formatter = ((val: string) => val.toLowerCase());
451451
treeGrid.columns[4].formatter = ((val: number) =>
452452
val * 12 // months
@@ -455,13 +455,13 @@ describe('CSV Grid Exporter', () => {
455455
let wrapper = await getExportedData(treeGrid, options);
456456
wrapper.verifyData(wrapper.treeGridDataFormatted, 'Columns\' formatter should be applied.');
457457

458-
exporter.onColumnExport.subscribe((val: IColumnExportingEventArgs) => {
458+
exporter.columnExporting.subscribe((val: IColumnExportingEventArgs) => {
459459
val.skipFormatter = true;
460460
});
461461
wrapper = await getExportedData(treeGrid, options);
462462
wrapper.verifyData(wrapper.treeGridData, 'Columns\' formatter should be skipped.');
463463

464-
exporter.onColumnExport.subscribe((val: IColumnExportingEventArgs) => {
464+
exporter.columnExporting.subscribe((val: IColumnExportingEventArgs) => {
465465
val.skipFormatter = false;
466466
});
467467
wrapper = await getExportedData(treeGrid, options);

0 commit comments

Comments
 (0)