Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@
"version": "20.1.0",
"description": "Updates Ignite UI for Angular from v20.0.6 to v20.1.0",
"factory": "./update-20_1_0"
},
"migration-50": {
"version": "20.2.0",
"description": "Updates Ignite UI for Angular from v20.1.0 to v20.2.0",
"factory": "./update-20_2_0"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "../../common/schema/theme-changes.schema.json",
"changes": [
{
"name": "$resting-shadow",
"remove": true,
"owner": "outlined-button-theme",
"type": "property"
},
{
"name": "$hover-shadow",
"remove": true,
"owner": "outlined-button-theme",
"type": "property"
},
{
"name": "$focus-shadow",
"remove": true,
"owner": "outlined-button-theme",
"type": "property"
},
{
"name": "$active-shadow",
"remove": true,
"owner": "outlined-button-theme",
"type": "property"
},
{
"name": "$resting-shadow",
"remove": true,
"owner": "flat-button-theme",
"type": "property"
},
{
"name": "$hover-shadow",
"remove": true,
"owner": "flat-button-theme",
"type": "property"
},
{
"name": "$focus-shadow",
"remove": true,
"owner": "flat-button-theme",
"type": "property"
},
{
"name": "$active-shadow",
"remove": true,
"owner": "flat-button-theme",
"type": "property"
}
]
}
63 changes: 63 additions & 0 deletions projects/igniteui-angular/migrations/update-20_2_0/index.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import * as path from 'path';

import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
import { setupTestTree } from '../common/setup.spec';

const version = '20.2.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-50';

it('should remove properties related to box-shadows from the outlined-button theme', async () => {
const testFilePath = `/testSrc/appPrefix/component/test.component.scss`;

appTree.create(
testFilePath,
`$my-outlined-button-theme: outlined-button-theme(
$shadow-color: #ffff00,
$resting-shadow: 5px 5px #ff0000,
$hover-shadow: 5px 5px #0000ff,
$focus-shadow: 5px 5px #008000,
$active-shadow: 5px 5px #ffa500
);`
);

const tree = await schematicRunner.runSchematic(migrationName, {}, appTree);

expect(tree.readContent(testFilePath)).toEqual(
`$my-outlined-button-theme: outlined-button-theme(
$shadow-color: #ffff00
);`
);
});

it('should remove properties related to box-shadows from the flat-button theme', async () => {
const testFilePath = `/testSrc/appPrefix/component/test.component.scss`;

appTree.create(
testFilePath,
`$my-flat-button-theme: flat-button-theme(
$shadow-color: #ffff00,
$resting-shadow: 5px 5px #ff0000,
$hover-shadow: 5px 5px #0000ff,
$focus-shadow: 5px 5px #008000,
$active-shadow: 5px 5px #ffa500
);`
);

const tree = await schematicRunner.runSchematic(migrationName, {}, appTree);

expect(tree.readContent(testFilePath)).toEqual(
`$my-flat-button-theme: flat-button-theme(
$shadow-color: #ffff00
);`
);
});
});
14 changes: 14 additions & 0 deletions projects/igniteui-angular/migrations/update-20_2_0/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type {
Rule,
SchematicContext,
Tree
} from '@angular-devkit/schematics';
import { UpdateChanges } from '../common/UpdateChanges';

const version = '20.2.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();
};
Loading