From 455b63e60deda623f52feb980cb14c967c689222 Mon Sep 17 00:00:00 2001 From: Adrian Petrov Date: Tue, 26 Aug 2025 15:47:51 +0300 Subject: [PATCH] refactor(grid): remove grid theme advanced styling params --- .../migrations/migration-collection.json | 5 +++ .../update-20_1_0/changes/theme-changes.json | 29 +++++++++++++ .../migrations/update-20_1_0/index.spec.ts | 43 +++++++++++++++++++ .../migrations/update-20_1_0/index.ts | 14 ++++++ 4 files changed, 91 insertions(+) create mode 100644 projects/igniteui-angular/migrations/update-20_1_0/changes/theme-changes.json create mode 100644 projects/igniteui-angular/migrations/update-20_1_0/index.spec.ts create mode 100644 projects/igniteui-angular/migrations/update-20_1_0/index.ts diff --git a/projects/igniteui-angular/migrations/migration-collection.json b/projects/igniteui-angular/migrations/migration-collection.json index fff8a4ac96e..11566729ac0 100644 --- a/projects/igniteui-angular/migrations/migration-collection.json +++ b/projects/igniteui-angular/migrations/migration-collection.json @@ -241,6 +241,11 @@ "version": "20.0.6", "description": "Updates Ignite UI for Angular from v20.0.2 to v20.0.6", "factory": "./update-20_0_6" + }, + "migration-49": { + "version": "20.1.0", + "description": "Updates Ignite UI for Angular from v20.0.6 to v20.1.0", + "factory": "./update-20_1_0" } } } diff --git a/projects/igniteui-angular/migrations/update-20_1_0/changes/theme-changes.json b/projects/igniteui-angular/migrations/update-20_1_0/changes/theme-changes.json new file mode 100644 index 00000000000..f73a7b6872c --- /dev/null +++ b/projects/igniteui-angular/migrations/update-20_1_0/changes/theme-changes.json @@ -0,0 +1,29 @@ +{ + "$schema": "../../common/schema/theme-changes.schema.json", + "changes": [ + { + "name": "$filtering-background-and", + "remove": true, + "owner": "grid-theme", + "type": "property" + }, + { + "name": "$filtering-background-and--focus", + "remove": true, + "owner": "grid-theme", + "type": "property" + }, + { + "name": "$filtering-background-or", + "remove": true, + "owner": "grid-theme", + "type": "property" + }, + { + "name": "$filtering-background-or--focus", + "remove": true, + "owner": "grid-theme", + "type": "property" + } + ] +} diff --git a/projects/igniteui-angular/migrations/update-20_1_0/index.spec.ts b/projects/igniteui-angular/migrations/update-20_1_0/index.spec.ts new file mode 100644 index 00000000000..d0c64749457 --- /dev/null +++ b/projects/igniteui-angular/migrations/update-20_1_0/index.spec.ts @@ -0,0 +1,43 @@ +import * as path from 'path'; + +import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; +import { setupTestTree } from '../common/setup.spec'; + +const version = '20.1.0'; + +describe(`Update to ${version}`, () => { + let appTree: UnitTestTree; + const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json')); + + beforeEach(() => { + appTree = setupTestTree(); + }); + + const migrationName = 'migration-49'; + + it('should remove properties related to the advanced filtering from the grid theme', async () => { + const testFilePath = `/testSrc/appPrefix/component/test.component.scss`; + + appTree.create( + testFilePath, + `$my-input-group-theme: grid-theme( + $filtering-row-background: #ccc, + $filtering-background-and: red, + $filtering-background-and--focus: blue, + $filtering-background-or: yellow, + $filtering-background-or--focus: green + );` + ); + + const tree = await schematicRunner.runSchematic(migrationName, {}, appTree); + + expect(tree.readContent(testFilePath)).toEqual( + `$my-input-group-theme: grid-theme( + $filtering-row-background: #ccc + );` + ); + }); +}); + + + diff --git a/projects/igniteui-angular/migrations/update-20_1_0/index.ts b/projects/igniteui-angular/migrations/update-20_1_0/index.ts new file mode 100644 index 00000000000..e2949a913e0 --- /dev/null +++ b/projects/igniteui-angular/migrations/update-20_1_0/index.ts @@ -0,0 +1,14 @@ +import type { + Rule, + SchematicContext, + Tree +} from '@angular-devkit/schematics'; +import { UpdateChanges } from '../common/UpdateChanges'; + +const version = '20.1.0'; + +export default (): Rule => async (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(); +};