diff --git a/projects/igniteui-angular/migrations/update-13_0_0/changes/members.json b/projects/igniteui-angular/migrations/update-13_0_0/changes/members.json index 66533b0031d..7a34214ce0f 100644 --- a/projects/igniteui-angular/migrations/update-13_0_0/changes/members.json +++ b/projects/igniteui-angular/migrations/update-13_0_0/changes/members.json @@ -41,6 +41,33 @@ "IgxHierarchicalGridComponent", "IgxRowIslandComponent" ] + }, + { + "member": "rowData", + "replaceWith": "data", + "definedIn": [ + "IgxGridRowComponent", + "IgxTreeGridRowComponent", + "IgxHierarchicalGridRowComponent", + "IgxChildGridRowComponent", + "IgxGridRow", + "IgxTreeGridRow", + "IgxHierarchicalGridRow" + ] + }, + { + "member": "rowID", + "replaceWith": "key", + "definedIn": [ + "IgxGridRowComponent", + "IgxTreeGridRowComponent", + "IgxHierarchicalGridRowComponent", + "IgxChildGridRowComponent", + "IgxGridRow", + "IgxTreeGridRow", + "IgxHierarchicalGridRow", + "IgxRowDirective" + ] } ] } diff --git a/projects/igniteui-angular/migrations/update-13_0_0/index.spec.ts b/projects/igniteui-angular/migrations/update-13_0_0/index.spec.ts index 9797e2b393a..29d1858f181 100644 --- a/projects/igniteui-angular/migrations/update-13_0_0/index.spec.ts +++ b/projects/igniteui-angular/migrations/update-13_0_0/index.spec.ts @@ -190,4 +190,68 @@ schemas: [] export class AppModule {} `); }); + + it('Should properly rename rowData property to data', async () => { + pending('set up tests for migrations through lang service'); + appTree.create('/testSrc/appPrefix/component/test.component.ts', + ` + import { IgxGridRow, IgxTreeGridRow, IgxHierarchicalGridRow, IgxChildGridRowComponent, IgxRowDirective } from 'igniteui-angular'; + export class MyClass { + @ViewChild(IgxGridComponent, { read: IgxGridComponent }) + public grid: IgxGridComponent; + public tgrid: IgxGridComponent; + public hgrid: IgxGridComponent; + public ngAfterViewInit() { + // rowData + const rowData = this.grid.getRowByIndex(0).rowData; + const rowData2 = this.tgrid.getRowByIndex(0).rowData; + const rowData3 = this.hgrid.getRowByIndex(0).rowData; + const rowData4 = this.grid.rowList.first.rowData; + const rowData5 = this.tgrid.rowList.first.rowData; + const rowData6 = this.hgrid.rowList.first.rowData; + // rowID + const rowID = this.grid.getRowByIndex(0).rowID; + const rowID2 = this.tgrid.getRowByIndex(0).rowID; + const rowID3 = this.hgrid.getRowByIndex(0).rowID; + const rowID4 = this.grid.rowList.first.rowID; + const rowID5 = this.tgrid.rowList.first.rowID; + const rowID6 = this.hgrid.rowList.first.rowID; + } + } + `); + + const tree = await schematicRunner + .runSchematicAsync(migrationName, {}, appTree) + .toPromise(); + + expect( + tree.readContent('/testSrc/appPrefix/component/test.component.ts') + ).toEqual( + ` + import { IgxGridRow, IgxTreeGridRow, IgxHierarchicalGridRow, IgxChildGridRowComponent, IgxRowDirective } from 'igniteui-angular'; + export class MyClass { + @ViewChild(IgxGridComponent, { read: IgxGridComponent }) + public grid: IgxGridComponent; + public tgrid: IgxGridComponent; + public hgrid: IgxGridComponent; + public ngAfterViewInit() { + // rowData + const rowData = this.grid.getRowByIndex(0).data; + const rowData2 = this.tgrid.getRowByIndex(0).data; + const rowData3 = this.hgrid.getRowByIndex(0).data; + const rowData4 = this.grid.rowList.first.data; + const rowData5 = this.tgrid.rowList.first.data; + const rowData6 = this.hgrid.rowList.first.data; + // rowID + const rowID = this.grid.getRowByIndex(0).key; + const rowID2 = this.tgrid.getRowByIndex(0).key; + const rowID3 = this.hgrid.getRowByIndex(0).key; + const rowID4 = this.grid.rowList.first.key; + const rowID5 = this.tgrid.rowList.first.key; + const rowID6 = this.hgrid.rowList.first.key; + } + } + ` + ); + }); }); diff --git a/projects/igniteui-angular/package.json b/projects/igniteui-angular/package.json index a68b6ac5f9a..03c0645760d 100644 --- a/projects/igniteui-angular/package.json +++ b/projects/igniteui-angular/package.json @@ -80,14 +80,6 @@ "uuid": "^8.3.0", "@igniteui/material-icons-extended": "^2.10.0" }, - "exports": { - "./schematics/*": { - "default": "./schematics/*" - }, - "./migrations/*": { - "default": "./migrations/*" - } - }, "peerDependencies": { "@angular/common": "^13.0.0", "@angular/core": "^13.0.0", @@ -102,6 +94,12 @@ }, "schematics": "./schematics/collection.json", "exports": { + "./schematics/*": { + "default": "./schematics/*" + }, + "./migrations/*": { + "default": "./migrations/*" + }, "./lib/core/styles/themes/index": { "sass": "./lib/core/styles/themes/_index.scss" },