Skip to content

Commit 8ca1a04

Browse files
authored
Merge branch 'master' into mkirova/fix-7698-master
2 parents 9e72e34 + 0f46840 commit 8ca1a04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+624
-161
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ All notable changes for each version of this project will be documented in this
77
### General
88
- `igxCombo`
99
- **Behavioral Change** - Change default positioning strategy from `ConnectedPositioningStrategy` to `AutoPositionStrategy`. The [`Auto`](https://www.infragistics.com/products/ignite-ui-angular/angular/components/overlay_position.html#auto) strategy will initially try to show the element like the Connected strategy does. If the element goes out of the viewport Auto will flip the starting point and the direction, i.e. if the direction is 'bottom', it will switch it to 'top' and so on. If after flipping direction the content goes out of the view, auto strategy will revert to initial start point and direction and will push the content into the view. Note after pushing the content it may hide the combo's input.
10-
10+
- `IgxOverlay`
11+
- Added new property - `closeOnEsc` - in `OverlaySettings`. The overlay can now be prevented from closing, on escape keypress, by setting the property to `false`, by default it's `true`.
12+
- `igxDialog`
13+
- Added `closeOnEscapeKey` - with it, the dialog can be allowed or prevented from closing when `Esc` is pressed.
14+
- `IgxNavbar`:
15+
- **Breaking Changes** - The `igx-action-icon` has been renamed to `igx-navbar-action`. It should get renamed in your components via `ng update`;
1116
### New Features
1217
- `IgxGridState` directive
1318
- Added support for expansion states, column selection and row pinning.
@@ -20,6 +25,8 @@ All notable changes for each version of this project will be documented in this
2025
- `IgxSnackbar`
2126
- `message` property has been deprecated. You can place the *message text* in the snackbar content or pass it as parameter to `show` method instead.
2227
- An optional string parameter `message` has been added to `show()` method.
28+
- `IgxNavbar`
29+
- Added new `igx-navbar-title, igxNavbarTitle` directive that can be used to provide custom content for navbar title. It would override the value of `title` input property.
2330

2431
## 10.0.0
2532

angularDocsPostDeploy.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Write-Host "Check file exists: " ([System.IO.File]::Exists($filePath))
6161
Write-Host "Check dir exists:" ([System.IO.Directory]::Exists($angularDocsRootFolder));
6262

6363
if([System.IO.File]::Exists($filePath) -and [System.IO.Directory]::Exists($angularDocsRootFolder)) {
64-
$folders = Get-ChildItem -Path $angularDocsRootFolder -Directory -Exclude $tagFolder,"sass","typescript";
64+
$folders = Get-ChildItem -Path $angularDocsRootFolder -Directory -Exclude $tagFolder,"sass","typescript" -Name | Sort-Object @{Expression = {[double]($_.Substring(0, $_.LastIndexOf('.'))) }};
6565
$textToUpdate = "";
6666
foreach($item in $folders) {
6767
$textToUpdate += '"' + $item.Name + '"';
@@ -72,4 +72,4 @@ if([System.IO.File]::Exists($filePath) -and [System.IO.Directory]::Exists($angul
7272
$content = [System.IO.File]::ReadAllText($filePath);
7373
$newContent = $content -replace "\[.*\]", $textToUpdate;
7474
[System.IO.File]::WriteAllText($filePath,$newContent);
75-
}
75+
}

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
"version": "9.1.0",
7676
"description": "Updates Ignite UI for Angular from v9.0.x to v9.1.0",
7777
"factory": "./update-9_1_0"
78+
},
79+
"migration-16": {
80+
"version": "10.1.0",
81+
"description": "Updates Ignite UI for Angular from v10.0.x to v10.1.0",
82+
"factory": "./update-10_1_0"
7883
}
7984
}
8085
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "../../common/schema/class.schema.json",
3+
"changes": [
4+
{
5+
"name": "IgxActionIconDirective",
6+
"replaceWith": "IgxNavbarActionDirective"
7+
}
8+
]
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "../../common/schema/selector.schema.json",
3+
"changes": [
4+
{
5+
"type": "component",
6+
"selector": "igx-action-icon",
7+
"replaceWith": "igx-navbar-action"
8+
}
9+
]
10+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
import * as path from 'path';
2+
3+
// tslint:disable:no-implicit-dependencies
4+
import { virtualFs } from '@angular-devkit/core';
5+
import { EmptyTree } from '@angular-devkit/schematics';
6+
// tslint:disable-next-line:no-submodule-imports
7+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
8+
9+
describe('Update 10.1.0', () => {
10+
let appTree: UnitTestTree;
11+
const schematicRunner = new SchematicTestRunner('ig-migrate', path.join(__dirname, '../migration-collection.json'));
12+
const configJson = {
13+
defaultProject: 'testProj',
14+
projects: {
15+
testProj: {
16+
sourceRoot: '/testSrc'
17+
}
18+
},
19+
schematics: {
20+
'@schematics/angular:component': {
21+
prefix: 'appPrefix'
22+
}
23+
}
24+
};
25+
26+
beforeEach(() => {
27+
appTree = new UnitTestTree(new EmptyTree());
28+
appTree.create('/angular.json', JSON.stringify(configJson));
29+
});
30+
31+
it('should upgrade the igx-action-icon to igx-navbar-action', async () => {
32+
appTree.create(
33+
'/testSrc/appPrefix/component/custom.component.html',
34+
`<igx-navbar title="Test title">
35+
<igx-action-icon>
36+
<igx-icon>arrow_back</igx-icon>
37+
</igx-action-icon>
38+
</igx-navbar>`);
39+
const tree = await schematicRunner.runSchematicAsync('migration-16', {}, appTree)
40+
.toPromise();
41+
42+
expect(tree.readContent('/testSrc/appPrefix/component/custom.component.html'))
43+
.toEqual(
44+
`<igx-navbar title="Test title">
45+
<igx-navbar-action>
46+
<igx-icon>arrow_back</igx-icon>
47+
</igx-navbar-action>
48+
</igx-navbar>`);
49+
});
50+
51+
it('should update IgxActionIconDirective to IgxNavbarActionDirective', async () => {
52+
appTree.create('/testSrc/appPrefix/component/custom.component.ts',
53+
`import { IgxActionIconDirective } from 'igniteui-angular';
54+
export class TestNavbar {
55+
@ViewChild(IgxActionIconDirective, { read: IgxActionIconDirective })
56+
private actionIcon: IgxActionIconDirective; }`);
57+
58+
const tree = await schematicRunner.runSchematicAsync('migration-16', {}, appTree).toPromise();
59+
60+
expect(tree.readContent('/testSrc/appPrefix/component/custom.component.ts'))
61+
.toEqual(
62+
`import { IgxNavbarActionDirective } from 'igniteui-angular';
63+
export class TestNavbar {
64+
@ViewChild(IgxNavbarActionDirective, { read: IgxNavbarActionDirective })
65+
private actionIcon: IgxNavbarActionDirective; }`);
66+
});
67+
68+
it('should update DropPosition.None', async () => {
69+
const origFileContent =
70+
`import { Component, Injectable, ViewChild } from "@angular/core";` +
71+
`import { IgxGridComponent, DropPosition } from "igniteui-angular";` +
72+
`import { IgxColumnComponent } from "igniteui-angular";\r\n` +
73+
`@Component({` +
74+
` providers: [RemoteService]` +
75+
`})` +
76+
`export class GridSampleComponent {` +
77+
` @ViewChild("grid1", { read: IgxGridComponent }) public grid1: IgxGridComponent;` +
78+
` public move() {` +
79+
` const column: IgxColumnComponent = this.grid1.columns[0];` +
80+
` const column2: IgxColumnComponent = this.grid1.columns[1];` +
81+
` this.grid1.moveColumn(col1, col2, DropPosition.None);` +
82+
` }` +
83+
`}`;
84+
const expectedFileContent =
85+
`import { Component, Injectable, ViewChild } from "@angular/core";` +
86+
`import { IgxGridComponent, DropPosition } from "igniteui-angular";` +
87+
`import { IgxColumnComponent } from "igniteui-angular";\r\n` +
88+
`@Component({` +
89+
` providers: [RemoteService]` +
90+
`})` +
91+
`export class GridSampleComponent {` +
92+
` @ViewChild("grid1", { read: IgxGridComponent }) public grid1: IgxGridComponent;` +
93+
` public move() {` +
94+
` const column: IgxColumnComponent = this.grid1.columns[0];` +
95+
` const column2: IgxColumnComponent = this.grid1.columns[1];` +
96+
` this.grid1.moveColumn(col1, col2, DropPosition.AfterDropTarget);` +
97+
` }` +
98+
`}`;
99+
appTree.create(
100+
'/testSrc/appPrefix/component/drop.component.ts',
101+
origFileContent);
102+
103+
const tree = await schematicRunner.runSchematicAsync('migration-16', {}, appTree).toPromise();
104+
expect(tree.readContent('/testSrc/appPrefix/component/drop.component.ts'))
105+
.toEqual(expectedFileContent);
106+
});
107+
108+
});
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import {
2+
Rule,
3+
SchematicContext,
4+
Tree
5+
} from '@angular-devkit/schematics';
6+
import { UpdateChanges } from '../common/UpdateChanges';
7+
import { getIdentifierPositions } from '../common/tsUtils';
8+
9+
const version = '10.1.0';
10+
11+
export default function(): Rule {
12+
return (host: Tree, context: SchematicContext) => {
13+
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
14+
15+
const update = new UpdateChanges(__dirname, host, context);
16+
update.applyChanges();
17+
18+
// replace DropPosition.None with DropPosition.AfterDropTarget
19+
for (const entryPath of update.tsFiles) {
20+
let content = host.read(entryPath).toString();
21+
if (content.indexOf('DropPosition.None') !== -1) {
22+
const pos = getIdentifierPositions(content, 'DropPosition');
23+
for (let i = pos.length; i--;) {
24+
const end = pos[i].end + 5;
25+
const isMatch = content.slice(pos[i].start, end) === 'DropPosition.None';
26+
if (isMatch) {
27+
content = content.slice(0, pos[i].start) + 'DropPosition.AfterDropTarget' + content.slice(end);
28+
}
29+
}
30+
host.overwrite(entryPath, content);
31+
}
32+
}
33+
};
34+
}

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { Directive, Inject } from '@angular/core';
22
import { IgxActionStripComponent } from '../action-strip.component';
33
import { IgxRowDirective } from '../../grids/public_api';
4+
import { IgxGridIconService } from '../../grids/common/grid-icon.service';
45

56
@Directive({
67
selector: '[igxGridActionsBase]'
78
})
89
export class IgxGridActionsBaseDirective {
9-
constructor(@Inject(IgxActionStripComponent) protected strip: IgxActionStripComponent) { }
10+
constructor(@Inject(IgxActionStripComponent) protected strip: IgxActionStripComponent, protected iconService: IgxGridIconService) { }
1011

1112
/**
1213
* Getter to be used in template
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* tslint:disable */
2+
export const PINNING_ACTIONS_ICONS_FONT_SET = 'pinning-actions-icons';
3+
export const PINNING_ACTIONS_ICONS = [
4+
{
5+
name: 'jump_up',
6+
value: `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
7+
<path d="M6 8l4 4H7c0 3.31 2.69 6 6 6 1.01 0 1.97-.25 2.8-.7l1.46 1.46A7.93 7.93 0 0113 20c-4.42 0-8-3.58-8-8H2l4-4zm15-5v2H5V3h16z"/>
8+
</svg>`
9+
},
10+
{
11+
name: 'jump_down',
12+
value: `<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
13+
<path d="M21 19v2H5v-2h16zM13 4c1.57 0 3.03.46 4.26 1.24L15.8 6.7A5.87 5.87 0 0013 6c-3.31 0-6 2.69-6 6h3l-4 4-4-4h3c0-4.42 3.58-8 8-8z"/>
14+
</svg>`
15+
}
16+
];
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<ng-container *ngIf="isRowContext">
22
<button *ngIf="inPinnedArea && pinnedTop" igxRipple igxButton="icon" (click)="scrollToRow($event)">
3-
<igx-icon fontSet="filtering-icons" name="jump_down"></igx-icon>
3+
<igx-icon fontSet="pinning-actions-icons" name="jump_down"></igx-icon>
44
</button>
55
<button *ngIf="inPinnedArea && !pinnedTop" igxRipple igxButton="icon" (click)="scrollToRow($event)">
6-
<igx-icon fontSet="filtering-icons" name="jump_up"></igx-icon>
6+
<igx-icon fontSet="pinning-actions-icons" name="jump_up"></igx-icon>
77
</button>
88
<button *ngIf="!pinned" igxRipple igxButton="icon" (click)="pin($event)">
9-
<igx-icon fontSet="filtering-icons" name="pin"></igx-icon>
9+
<igx-icon fontSet="pinning-icons" name="pin"></igx-icon>
1010
</button>
1111
<button *ngIf="pinned" igxRipple igxButton="icon" (click)="unpin($event)">
12-
<igx-icon fontSet="filtering-icons" name="unpin"></igx-icon>
12+
<igx-icon fontSet="pinning-icons" name="unpin"></igx-icon>
1313
</button>
1414
</ng-container>

0 commit comments

Comments
 (0)