-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c9412a
commit 3b49eb5
Showing
4 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
projects/igniteui-angular/migrations/update-8_2_0/changes/selectors.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"$schema": "../../common/schema/selector.schema.json", | ||
"changes": [ | ||
{ | ||
"type": "directive", | ||
"selector": "igxExcelStyleSortingTemplate", | ||
"replaceWith": "igxExcelStyleSorting" | ||
}, | ||
{ | ||
"type": "directive", | ||
"selector": "igxExcelStyleMovingTemplate", | ||
"replaceWith": "igxExcelStyleMoving" | ||
}, | ||
{ | ||
"type": "directive", | ||
"selector": "igxExcelStyleHidingTemplate", | ||
"replaceWith": "igxExcelStyleHiding" | ||
}, | ||
{ | ||
"type": "directive", | ||
"selector": "igxExcelStylePinningTemplate", | ||
"replaceWith": "igxExcelStylePinning" | ||
} | ||
] | ||
} |
53 changes: 53 additions & 0 deletions
53
projects/igniteui-angular/migrations/update-8_2_0/index.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import * as path from 'path'; | ||
|
||
// tslint:disable:no-implicit-dependencies | ||
import { virtualFs } from '@angular-devkit/core'; | ||
import { EmptyTree } from '@angular-devkit/schematics'; | ||
// tslint:disable-next-line:no-submodule-imports | ||
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; | ||
|
||
describe('Update 8.2.0', () => { | ||
let appTree: UnitTestTree; | ||
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json')); | ||
const configJson = { | ||
defaultProject: 'testProj', | ||
projects: { | ||
testProj: { | ||
sourceRoot: '/testSrc' | ||
} | ||
}, | ||
schematics: { | ||
'@schematics/angular:component': { | ||
prefix: 'appPrefix' | ||
} | ||
} | ||
}; | ||
|
||
beforeEach(() => { | ||
appTree = new UnitTestTree(new EmptyTree()); | ||
appTree.create('/angular.json', JSON.stringify(configJson)); | ||
}); | ||
|
||
it('should update Excel Style Filtering template selectors', done => { | ||
appTree.create( | ||
'/testSrc/appPrefix/component/custom.component.html', | ||
`<igx-grid [data]="data" height="500px" [autoGenerate]="true" [allowFiltering]='true' [filterMode]="'excelStyleFilter'"> | ||
<ng-template igxExcelStyleSortingTemplate><div class="esf-custom-sorting">Sorting Template</div></ng-template> | ||
<ng-template igxExcelStyleHidingTemplate><div class="esf-custom-hiding">Hiding Template</div></ng-template> | ||
<ng-template igxExcelStyleMovingTemplate><div class="esf-custom-moving">Moving Template</div></ng-template> | ||
<ng-template igxExcelStylePinningTemplate><div class="esf-custom-pinning">Pinning Template</div></ng-template> | ||
</igx-grid>`); | ||
|
||
const tree = schematicRunner.runSchematic('migration-10', {}, appTree); | ||
expect(tree.readContent('/testSrc/appPrefix/component/custom.component.html')) | ||
.toEqual( | ||
`<igx-grid [data]="data" height="500px" [autoGenerate]="true" [allowFiltering]='true' [filterMode]="'excelStyleFilter'"> | ||
<ng-template igxExcelStyleSorting><div class="esf-custom-sorting">Sorting Template</div></ng-template> | ||
<ng-template igxExcelStyleHiding><div class="esf-custom-hiding">Hiding Template</div></ng-template> | ||
<ng-template igxExcelStyleMoving><div class="esf-custom-moving">Moving Template</div></ng-template> | ||
<ng-template igxExcelStylePinning><div class="esf-custom-pinning">Pinning Template</div></ng-template> | ||
</igx-grid>`); | ||
|
||
done(); | ||
}); | ||
}); |
17 changes: 17 additions & 0 deletions
17
projects/igniteui-angular/migrations/update-8_2_0/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { | ||
Rule, | ||
SchematicContext, | ||
Tree | ||
} from '@angular-devkit/schematics'; | ||
import { UpdateChanges } from '../common/UpdateChanges'; | ||
|
||
const version = '8.2.0'; | ||
|
||
export default function(): Rule { | ||
return (host: Tree, context: SchematicContext) => { | ||
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`); | ||
|
||
const update = new UpdateChanges(__dirname, host, context); | ||
update.applyChanges(); | ||
}; | ||
} |