Skip to content

Commit f7d3ccb

Browse files
authored
Merge branch 'master' into enrich-deprecation-msgs-m
2 parents a3bf39c + b8b33e2 commit f7d3ccb

File tree

16 files changed

+533
-173
lines changed

16 files changed

+533
-173
lines changed

CHANGELOG.md

+24-2
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
@@ -91,7 +91,29 @@ All notable changes for each version of this project will be documented in this
9191
- **Breaking Change**:
9292
- `onPagingDone` output is removed. Use the `paging` and `pagingDone` outputs exposed by the `IgxPaginator`.
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)
94-
94+
- IgxButton
95+
- 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+
- `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`
95117
96118
## 11.0.4
97119

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

+77
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

+119
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/schematics/ng-add/index.spec.ts

+53-18
Original file line numberDiff line numberDiff line change
@@ -93,46 +93,70 @@ describe('ng-add schematics', () => {
9393
expect(pkgJsonData.dependencies['hammerjs']).toBeTruthy();
9494
});
9595

96-
it('should add hammer.js to the main.ts file', async () => {
96+
it('should NOT add hammer.js to the main.ts file', async () => {
9797
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
9898
const mainTs = tree.read(`${sourceRoot}/main.ts`).toString();
99-
expect(mainTs).toContain('import \'hammerjs\';');
99+
expect(mainTs).not.toContain('import \'hammerjs\';');
100100
});
101101

102-
it('should not add hammer.js if it exists in angular.json build options', async () => {
102+
it('should NOT add hammer.js to the test.ts file', async () => {
103+
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
104+
const testTs = tree.read(`${sourceRoot}/test.ts`).toString();
105+
expect(testTs).not.toContain('import \'hammerjs\';');
106+
});
107+
108+
it('should add hammer.js in angular.json build options under scripts', async () => {
109+
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
110+
const ngJsonConfigResult = JSON.parse(tree.read('/angular.json').toString());
111+
expect(ngJsonConfigResult.projects.testProj.architect.build.options.scripts).toContain('./node_modules/hammerjs/hammer.min.js');
112+
});
113+
114+
it('should add hammer.js in angular.json test options under scripts', async () => {
115+
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
116+
const ngJsonConfigResult = JSON.parse(tree.read('/angular.json').toString());
117+
expect(ngJsonConfigResult.projects.testProj.architect.test.options.scripts).toContain('./node_modules/hammerjs/hammer.min.js');
118+
});
119+
120+
it('should NOT duplicate hammer.js if it exists in angular.json build options', async () => {
103121
const ngJsonConfig1 = JSON.parse(tree.read('/angular.json').toString());
104122
ngJsonConfig1.projects.testProj.architect.build.options.scripts.push('./node_modules/hammerjs/hammer.min.js');
105123
tree.overwrite('/angular.json', JSON.stringify(ngJsonConfig1));
106124
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
107125

108-
const newContent = tree.read(`${sourceRoot}/main.ts`).toString();
109-
expect(newContent.split('import \'hammerjs\';\n// test comment').length).toEqual(1);
126+
const ngJsonConfigResult = JSON.parse(tree.read('/angular.json').toString());
127+
expect(ngJsonConfigResult.projects.testProj.architect.build.options.scripts.length).toBe(1);
128+
expect(ngJsonConfigResult.projects.testProj.architect.build.options.scripts).toMatch('./node_modules/hammerjs/hammer.min.js');
110129
});
111130

112-
it('should add hammer.js to the test.ts file', async () => {
131+
it('should NOT duplicate hammer.js if it exists in angular.json test options', async () => {
132+
const ngJsonConfig1 = JSON.parse(tree.read('/angular.json').toString());
133+
ngJsonConfig1.projects.testProj.architect.test.options.scripts.push('./node_modules/hammerjs/hammer.min.js');
134+
tree.overwrite('/angular.json', JSON.stringify(ngJsonConfig1));
113135
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
114-
const testTs = tree.read(`${sourceRoot}/test.ts`).toString();
115-
expect(testTs).toContain('import \'hammerjs\';');
136+
137+
const ngJsonConfigResult = JSON.parse(tree.read('/angular.json').toString());
138+
expect(ngJsonConfigResult.projects.testProj.architect.test.options.scripts.length).toBe(1);
139+
expect(ngJsonConfigResult.projects.testProj.architect.test.options.scripts).toMatch('./node_modules/hammerjs/hammer.min.js');
116140
});
117141

118-
it('should not add hammer.js if it exists in angular.json test options', async () => {
142+
it('should NOT add hammer.js to main.ts if it exists in angular.json build options', async () => {
119143
const ngJsonConfig1 = JSON.parse(tree.read('/angular.json').toString());
120-
ngJsonConfig1.projects.testProj.architect.test.options.scripts.push('./node_modules/hammerjs/hammer.min.js');
144+
ngJsonConfig1.projects.testProj.architect.build.options.scripts.push('./node_modules/hammerjs/hammer.min.js');
121145
tree.overwrite('/angular.json', JSON.stringify(ngJsonConfig1));
122146
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
123147

124-
const testTs = tree.read(`${sourceRoot}/test.ts`).toString();
125-
expect(testTs).toMatch('// test comment');
148+
const newContent = tree.read(`${sourceRoot}/main.ts`).toString();
149+
expect(newContent).toMatch('// test comment');
126150
});
127151

128-
it('should not add hammer.js if it exists in main.ts', async () => {
129-
const mainTsPath = `${sourceRoot}/main.ts`;
130-
const content = tree.read(mainTsPath).toString();
131-
tree.overwrite(mainTsPath, 'import \'hammerjs\';\n' + content);
152+
it('should NOT add hammer.js to test.ts if it exists in angular.json test options', async () => {
153+
const ngJsonConfig1 = JSON.parse(tree.read('/angular.json').toString());
154+
ngJsonConfig1.projects.testProj.architect.test.options.scripts.push('./node_modules/hammerjs/hammer.min.js');
155+
tree.overwrite('/angular.json', JSON.stringify(ngJsonConfig1));
132156
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
133157

134-
const newContent = tree.read(mainTsPath).toString();
135-
expect(newContent.split('import \'hammerjs\';\n// test comment').length).toEqual(2);
158+
const newContent = tree.read(`${sourceRoot}/test.ts`).toString();
159+
expect(newContent).toMatch('// test comment');
136160
});
137161

138162
it('should add hammer.js to package.json dependencies', async () => {
@@ -141,6 +165,17 @@ describe('ng-add schematics', () => {
141165
expect(pkgJsonData.dependencies['hammerjs']).toBeTruthy();
142166
});
143167

168+
it('should NOT add hammer.js to angular.json if it exists in main.ts options', async () => {
169+
const mainTsPath = `${sourceRoot}/main.ts`;
170+
const content = tree.read(mainTsPath).toString();
171+
tree.overwrite(mainTsPath, 'import \'hammerjs\';\n' + content);
172+
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
173+
174+
const ngJsonConfigResult = JSON.parse(tree.read('/angular.json').toString());
175+
expect(ngJsonConfigResult.projects.testProj.architect.build.options.scripts.length).toBe(0);
176+
expect(ngJsonConfigResult.projects.testProj.architect.build.options.scripts).not.toContain('./node_modules/hammerjs/hammer.min.js');
177+
});
178+
144179
it('should add the CLI only to devDependencies', async () => {
145180
await runner.runSchematicAsync('ng-add', { normalizeCss: false }, tree).toPromise();
146181
const pkgJsonData = JSON.parse(tree.readContent('/package.json'));

0 commit comments

Comments
 (0)