Skip to content

Commit f716f83

Browse files
adrianptrvkdinevdesig9steinsimeonoff
authored
refactor(grid): remove grid theme advanced styling params (#16178)
Co-authored-by: Konstantin Dinev <kdinev@mail.bw.edu> Co-authored-by: Marin Popov <desig9stein@users.noreply.github.com> Co-authored-by: Simeon Simeonoff <sim.simeonoff@gmail.com>
1 parent 86584bf commit f716f83

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

projects/igniteui-angular/migrations/migration-collection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@
241241
"version": "20.0.6",
242242
"description": "Updates Ignite UI for Angular from v20.0.2 to v20.0.6",
243243
"factory": "./update-20_0_6"
244+
},
245+
"migration-49": {
246+
"version": "20.1.0",
247+
"description": "Updates Ignite UI for Angular from v20.0.6 to v20.1.0",
248+
"factory": "./update-20_1_0"
244249
}
245250
}
246251
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"$schema": "../../common/schema/theme-changes.schema.json",
3+
"changes": [
4+
{
5+
"name": "$filtering-background-and",
6+
"remove": true,
7+
"owner": "grid-theme",
8+
"type": "property"
9+
},
10+
{
11+
"name": "$filtering-background-and--focus",
12+
"remove": true,
13+
"owner": "grid-theme",
14+
"type": "property"
15+
},
16+
{
17+
"name": "$filtering-background-or",
18+
"remove": true,
19+
"owner": "grid-theme",
20+
"type": "property"
21+
},
22+
{
23+
"name": "$filtering-background-or--focus",
24+
"remove": true,
25+
"owner": "grid-theme",
26+
"type": "property"
27+
}
28+
]
29+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import * as path from 'path';
2+
3+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
4+
import { setupTestTree } from '../common/setup.spec';
5+
6+
const version = '20.1.0';
7+
8+
describe(`Update to ${version}`, () => {
9+
let appTree: UnitTestTree;
10+
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
11+
12+
beforeEach(() => {
13+
appTree = setupTestTree();
14+
});
15+
16+
const migrationName = 'migration-49';
17+
18+
it('should remove properties related to the advanced filtering from the grid theme', async () => {
19+
const testFilePath = `/testSrc/appPrefix/component/test.component.scss`;
20+
21+
appTree.create(
22+
testFilePath,
23+
`$my-input-group-theme: grid-theme(
24+
$filtering-row-background: #ccc,
25+
$filtering-background-and: red,
26+
$filtering-background-and--focus: blue,
27+
$filtering-background-or: yellow,
28+
$filtering-background-or--focus: green
29+
);`
30+
);
31+
32+
const tree = await schematicRunner.runSchematic(migrationName, {}, appTree);
33+
34+
expect(tree.readContent(testFilePath)).toEqual(
35+
`$my-input-group-theme: grid-theme(
36+
$filtering-row-background: #ccc
37+
);`
38+
);
39+
});
40+
});
41+
42+
43+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import type {
2+
Rule,
3+
SchematicContext,
4+
Tree
5+
} from '@angular-devkit/schematics';
6+
import { UpdateChanges } from '../common/UpdateChanges';
7+
8+
const version = '20.1.0';
9+
10+
export default (): Rule => async (host: Tree, context: SchematicContext) => {
11+
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
12+
const update = new UpdateChanges(__dirname, host, context);
13+
update.applyChanges();
14+
};

0 commit comments

Comments
 (0)