File tree Expand file tree Collapse file tree 4 files changed +79
-0
lines changed
projects/igniteui-angular/migrations Expand file tree Collapse file tree 4 files changed +79
-0
lines changed Original file line number Diff line number Diff line change 75
75
"version" : " 9.1.0" ,
76
76
"description" : " Updates Ignite UI for Angular from v9.0.x to v9.1.0" ,
77
77
"factory" : " ./update-9_1_0"
78
+ },
79
+ "migration-16" : {
80
+ "version" : " 10.1.0" ,
81
+ "description" : " Updates Ignite UI for Angular from v9.1.x to v10.1.0" ,
82
+ "factory" : " ./update-10_1_0"
78
83
}
79
84
}
80
85
}
Original file line number Diff line number Diff line change
1
+ {
2
+ "$schema" : " ../../common/schema/binding.schema.json" ,
3
+ "changes" : [
4
+ {
5
+ "name" : " onDataPreLoad" ,
6
+ "replaceWith" : " onScroll" ,
7
+ "owner" : {
8
+ "selector" : " igx-tree-grid" ,
9
+ "type" : " component"
10
+ }
11
+ }
12
+ ]
13
+ }
Original file line number Diff line number Diff line change
1
+ import * as path from 'path' ;
2
+
3
+ // tslint:disable:no-implicit-dependencies
4
+ import { virtualFs } from '@angular-devkit/core' ;
5
+ import { EmptyTree } from '@angular-devkit/schematics' ;
6
+ // tslint:disable-next-line:no-submodule-imports
7
+ import { SchematicTestRunner , UnitTestTree } from '@angular-devkit/schematics/testing' ;
8
+
9
+ describe ( 'Update 10.1.0' , ( ) => {
10
+ let appTree : UnitTestTree ;
11
+ const schematicRunner = new SchematicTestRunner ( 'ig-migrate' , path . join ( __dirname , '../migration-collection.json' ) ) ;
12
+ const configJson = {
13
+ defaultProject : 'testProj' ,
14
+ projects : {
15
+ testProj : {
16
+ sourceRoot : '/testSrc'
17
+ }
18
+ } ,
19
+ schematics : {
20
+ '@schematics/angular:component' : {
21
+ prefix : 'appPrefix'
22
+ }
23
+ }
24
+ } ;
25
+
26
+ beforeEach ( ( ) => {
27
+ appTree = new UnitTestTree ( new EmptyTree ( ) ) ;
28
+ appTree . create ( '/angular.json' , JSON . stringify ( configJson ) ) ;
29
+ } ) ;
30
+
31
+ it ( 'should replace onDataPreLoad with onScroll ' , async ( ) => {
32
+ appTree . create (
33
+ `/testSrc/appPrefix/component/tree-grid.component.html` ,
34
+ '<igx-tree-grid (onDataPreLoad)="handleEvent($event)"></igx-tree-grid>'
35
+ ) ;
36
+
37
+ const tree = await schematicRunner . runSchematicAsync ( 'migration-16' , { } , appTree )
38
+ . toPromise ( ) ;
39
+
40
+ expect ( tree . readContent ( '/testSrc/appPrefix/component/tree-grid.component.html' ) )
41
+ . toEqual ( '<igx-tree-grid (onScroll)="handleEvent($event)"></igx-tree-grid>' ) ;
42
+
43
+ } ) ;
44
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import {
2
+ Rule ,
3
+ SchematicContext ,
4
+ Tree
5
+ } from '@angular-devkit/schematics' ;
6
+ import { UpdateChanges , InputPropertyType , BoundPropertyObject } from '../common/UpdateChanges' ;
7
+
8
+ const version = '10.1.0' ;
9
+
10
+ export default function ( ) : Rule {
11
+ return ( host : Tree , context : SchematicContext ) => {
12
+ context . logger . info ( `Applying migration for Ignite UI for Angular to version ${ version } ` ) ;
13
+
14
+ const update = new UpdateChanges ( __dirname , host , context ) ;
15
+ update . applyChanges ( ) ;
16
+ } ;
17
+ }
You can’t perform that action at this time.
0 commit comments