Skip to content

Commit 29d68b6

Browse files
committed
refactor(grid-summary): remove redundant code
1 parent 22dad59 commit 29d68b6

File tree

5 files changed

+67
-12
lines changed

5 files changed

+67
-12
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,11 @@
226226
"version": "19.2.0",
227227
"description": "Updates Ignite UI for Angular from v19.1.0 to v19.2.0",
228228
"factory": "./update-19_2_0"
229+
},
230+
"migration-46": {
231+
"version": "20.0.0",
232+
"description": "Updates Ignite UI for Angular from v19.2.0 to v20.0.0",
233+
"factory": "./update-20_0_0"
229234
}
230235
}
231236
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "../../common/schema/theme-changes.schema.json",
3+
"changes": [
4+
{
5+
"name": "$focus-background-color",
6+
"remove": true,
7+
"owner": "grid-summary-theme",
8+
"type": "property"
9+
}
10+
]
11+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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.0.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-46';
17+
18+
it('should remove the $focus-background-color property from the grid summary theme', async () => {
19+
const testFilePath = `/testSrc/appPrefix/component/test.component.scss`;
20+
21+
appTree.create(
22+
testFilePath,
23+
`$my-grid-theme: grid-summary-theme(
24+
$label-color: white,
25+
$focus-background-color: orange,
26+
);`
27+
);
28+
29+
const tree = await schematicRunner.runSchematic(migrationName, {}, appTree);
30+
31+
expect(tree.readContent(testFilePath)).toEqual(
32+
`$my-grid-theme: grid-summary-theme(
33+
$label-color: white,
34+
);`
35+
);
36+
});
37+
});
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.0.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+
};

projects/igniteui-angular/src/lib/core/styles/components/grid-summary/_grid-summary-theme.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
1414
/// @param {Color} $background-color [null] - The summaries background color is inherited form igx-grid__tfoot
15-
/// @param {Color} $focus-background-color [null] - The background color when a summary item is on focus.
1615
/// @param {Color} $label-color [null] - The summaries label color.
1716
/// @param {Color} $result-color [null] - The summaries value/result color.
1817
/// @param {Color} $border-color [null] - The summaries border color.
@@ -32,7 +31,6 @@
3231
$schema: $light-material-schema,
3332
3433
$background-color: null,
35-
$focus-background-color: null,
3634
$label-color: null,
3735
$result-color: null,
3836
$border-color: null,
@@ -74,7 +72,6 @@
7472
name: $name,
7573
selector: $selector,
7674
background-color: $background-color,
77-
focus-background-color: $focus-background-color,
7875
label-color: $label-color,
7976
result-color: $result-color,
8077
border-color: $border-color,
@@ -131,15 +128,6 @@
131128
overflow: hidden;
132129
outline-style: none;
133130

134-
&::after {
135-
position: absolute;
136-
inset: 0;
137-
}
138-
139-
&:focus::after {
140-
background: var-get($theme, 'focus-background-color');
141-
}
142-
143131
@if $variant == 'indigo' {
144132
border-top: rem(1px) solid var-get($theme, 'border-color');
145133
}

0 commit comments

Comments
 (0)