-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
themes(all): remove param from component themes (#15191)
- Loading branch information
Showing
24 changed files
with
177 additions
and
41 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
119 changes: 119 additions & 0 deletions
119
projects/igniteui-angular/migrations/update-19_1_0/changes/theme-changes.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,119 @@ | ||
{ | ||
"$schema": "../../common/schema/theme-changes.schema.json", | ||
"changes": [ | ||
{ | ||
"name": "$elevations", | ||
"owner": "badge-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "bottom-nav-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "button-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "card-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "carousel-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "chip-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "column-actions-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "dialog-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "drop-down-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "grid-toolbar-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "grid-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "icon-button-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "input-group-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "navbar-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "navdrawer-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "query-builder-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "snackbar-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "splitter-theme", | ||
"remove": true, | ||
"type": "property" | ||
}, | ||
{ | ||
"name": "$elevations", | ||
"owner": "time-picker-theme", | ||
"remove": true, | ||
"type": "property" | ||
} | ||
] | ||
} |
39 changes: 39 additions & 0 deletions
39
projects/igniteui-angular/migrations/update-19_1_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,39 @@ | ||
import * as path from 'path'; | ||
|
||
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing'; | ||
import { setupTestTree } from '../common/setup.spec'; | ||
|
||
const version = '19.1.0'; | ||
const themes = [ | ||
'badge-theme', 'bottom-nav-theme', 'button-theme', 'card-theme', 'carousel-theme', | ||
'chip-theme', 'column-actions-theme', 'dialog-theme', 'drop-down-theme', 'grid-toolbar-theme', | ||
'grid-theme', 'icon-button-theme', 'input-group-theme', 'navbar-theme', 'navdrawer-theme', | ||
'query-builder-theme', 'snackbar-theme', 'splitter-theme', 'time-picker-theme' | ||
]; | ||
const testFilePath = '/testSrc/appPrefix/component/${theme}.component.scss'; | ||
|
||
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-42'; | ||
|
||
themes.forEach(theme => { | ||
it('should remove the $elevations property from all component themes', async () => { | ||
appTree.create( | ||
testFilePath, | ||
`$custom-${theme}: ${theme}($elevations: $my-elevations);` | ||
); | ||
|
||
const tree = await schematicRunner.runSchematic(migrationName, {}, appTree); | ||
|
||
expect(tree.readContent(testFilePath)).toEqual( | ||
`$custom-${theme}: ${theme}();` | ||
); | ||
}); | ||
}); | ||
}); |
14 changes: 14 additions & 0 deletions
14
projects/igniteui-angular/migrations/update-19_1_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,14 @@ | ||
import type { | ||
Rule, | ||
SchematicContext, | ||
Tree | ||
} from '@angular-devkit/schematics'; | ||
import { UpdateChanges } from '../common/UpdateChanges'; | ||
|
||
const version = '19.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(); | ||
}; |
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.