Skip to content

Commit 2485c1d

Browse files
committed
Merge remote-tracking branch 'refs/remotes/IgniteUI/master'
2 parents d3fb0db + 370bd11 commit 2485c1d

File tree

7 files changed

+114
-50
lines changed

7 files changed

+114
-50
lines changed

samples/igDialog/igDialog.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
77
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet" />
88
<!-- 1. Load libraries -->
9-
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
9+
<script src="http://code.jquery.com/jquery-1.12.3.js"></script>
1010
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
11-
<!-- IE required polyfills, in this exact order -->
11+
<!-- IE required polyfills, in this exact order -->
1212
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script>
1313
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.20/system-polyfills.js"></script>
14-
<script src="https://npmcdn.com/[email protected].0/es6/dev/src/testing/shims_for_IE.js"></script>
15-
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2-polyfills.js"></script>
14+
<script src="https://npmcdn.com/[email protected].14/es6/dev/src/testing/shims_for_IE.js"></script>
15+
<script src="https://code.angularjs.org/2.0.0-beta.14/angular2-polyfills.js"></script>
1616
<script src="https://code.angularjs.org/tools/system.js"></script>
1717
<script src="https://code.angularjs.org/tools/typescript.js"></script>
18-
<script src="https://code.angularjs.org/2.0.0-beta.0/Rx.js"></script>
19-
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2.dev.js"></script>
18+
<script src="https://code.angularjs.org/2.0.0-beta.14/Rx.js"></script>
19+
<script src="https://code.angularjs.org/2.0.0-beta.14/angular2.dev.js"></script>
2020
<!-- Ignite UI Required Combined JavaScript Files -->
2121
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
2222
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>

samples/igHtmlEditor/igHtmlEditor.html

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,21 @@
33
<head>
44
<title>HTML Editor - Ignite UI integration with AngularJS</title>
55
<!-- Ignite UI Required Combined CSS Files -->
6+
<!-- Ignite UI Required Combined CSS Files -->
67
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
78
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet" />
89
<!-- 1. Load libraries -->
9-
10-
11-
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
12-
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
10+
<script src="http://code.jquery.com/jquery-1.12.3.js"></script>
11+
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
1312
<!-- IE required polyfills, in this exact order -->
1413
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script>
1514
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.20/system-polyfills.js"></script>
16-
<script src="https://npmcdn.com/[email protected]/es6/dev/src/testing/shims_for_IE.js"></script>
17-
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2-polyfills.js"></script>
15+
<script src="https://npmcdn.com/[email protected]/es6/dev/src/testing/shims_for_IE.js"></script>
16+
<script src="https://code.angularjs.org/2.0.0-beta.14/angular2-polyfills.js"></script>
1817
<script src="https://code.angularjs.org/tools/system.js"></script>
1918
<script src="https://code.angularjs.org/tools/typescript.js"></script>
20-
<script src="https://code.angularjs.org/2.0.0-beta.0/Rx.js"></script>
21-
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2.dev.js"></script>
19+
<script src="https://code.angularjs.org/2.0.0-beta.14/Rx.js"></script>
20+
<script src="https://code.angularjs.org/2.0.0-beta.14/angular2.dev.js"></script>
2221
<!-- Ignite UI Required Combined JavaScript Files -->
2322
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
2423
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>

samples/igLayoutManager/igLayoutManager.html

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@
66
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
77
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet" />
88
<!-- 1. Load libraries -->
9-
10-
11-
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
12-
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
9+
<script src="http://code.jquery.com/jquery-1.12.3.js"></script>
10+
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
1311
<!-- IE required polyfills, in this exact order -->
1412
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.35.0/es6-shim.min.js"></script>
1513
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.19.20/system-polyfills.js"></script>
16-
<script src="https://npmcdn.com/[email protected].0/es6/dev/src/testing/shims_for_IE.js"></script>
17-
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2-polyfills.js"></script>
14+
<script src="https://npmcdn.com/[email protected].14/es6/dev/src/testing/shims_for_IE.js"></script>
15+
<script src="https://code.angularjs.org/2.0.0-beta.14/angular2-polyfills.js"></script>
1816
<script src="https://code.angularjs.org/tools/system.js"></script>
1917
<script src="https://code.angularjs.org/tools/typescript.js"></script>
20-
<script src="https://code.angularjs.org/2.0.0-beta.0/Rx.js"></script>
21-
<script src="https://code.angularjs.org/2.0.0-beta.0/angular2.dev.js"></script>
18+
<script src="https://code.angularjs.org/2.0.0-beta.14/Rx.js"></script>
19+
<script src="https://code.angularjs.org/2.0.0-beta.14/angular2.dev.js"></script>
2220
<!-- Ignite UI Required Combined JavaScript Files -->
2321
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
2422
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>

src/igniteui.angular2.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ export class IgGridBase<Model> extends IgControlBase<Model> {
352352
column = element.data(this._widgetName).columnByKey(diff[i].txlog[j].key);
353353
if (column) {
354354
if (column.template) {
355-
newFormattedVal = grid._renderTemplatedCell(diff[i].txlog[j].newVal, column).substring(1);
355+
newFormattedVal = grid._renderTemplatedCell(diff[i].txlog[j].newVal, column);
356356
} else {
357357
newFormattedVal = grid._renderCell(diff[i].txlog[j].newVal, column, record);
358358
}
@@ -424,7 +424,7 @@ export class IgTreeGridComponent extends IgGridBase<IgTreeGrid> {
424424
column = element.data(this._widgetName).columnByKey(diff[i].txlog[j].key);
425425
if (column) {
426426
if (column.template) {
427-
newFormattedVal = grid._renderTemplatedCell(diff[i].txlog[j].newVal, column).substring(1);
427+
newFormattedVal = grid._renderTemplatedCell(diff[i].txlog[j].newVal, column);
428428
} else {
429429
newFormattedVal = grid._renderCell(diff[i].txlog[j].newVal, column, record);
430430
}
@@ -502,7 +502,7 @@ export class IgHierarchicalGridComponent extends IgGridBase<IgHierarchicalGrid>
502502
column = mainGrid.columnByKey(diff[i].txlog[j].key);
503503
if (column) {
504504
if (column.template) {
505-
newFormattedVal = mainGrid._renderTemplatedCell(diff[i].txlog[j].newVal, column).substring(1);
505+
newFormattedVal = mainGrid._renderTemplatedCell(diff[i].txlog[j].newVal, column);
506506
} else {
507507
newFormattedVal = mainGrid._renderCell(diff[i].txlog[j].newVal, column, record);
508508
}
@@ -703,9 +703,16 @@ export class IgTreeComponent extends IgControlBase<IgTree> {
703703
}
704704

705705
export class IgContentControlBase<Model> extends IgControlBase<Model> {
706+
private childNodes: Array<any>;
707+
706708
constructor(el: ElementRef, renderer: Renderer, differs: IterableDiffers) {
707709
super(el, renderer, differs);
708-
jQuery(this._el).append(el.nativeElement.childNodes);
710+
this.childNodes = el.nativeElement.childNodes;
711+
}
712+
713+
ngOnInit() {
714+
jQuery(this._el).append(this.childNodes);
715+
super.ngOnInit();
709716
}
710717
}
711718

tests/karma.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = function(config){
2929
{ pattern: "node_modules/rxjs/**/*.js", included: false, watched: false },
3030

3131
// paths loaded via module imports
32-
{pattern: "src/*.js", included: false, watched: true},
32+
{pattern: "src/*", included: false, watched: true},
3333

3434
// spec files need to be loaded in the shim file IN CONTEXT of the main module, don't include:
3535
{ pattern: "tests/unit/**/*.spec.js", included: false, watched: true }

tests/unit/igdialog/dialog.spec.ts

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ import * as Infragistics from '../../../src/igniteui.angular2';
55

66
export function main() {
77
describe('Infragistics Angular2 Dialog', () => {
8-
it('should initialize correctly', injectAsync([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
9-
var template = '<div><ig-dialog widgetId="dialog" [(options)]="opts"><div>Test Content</div></ig-dialog></div>';
10-
tcb.overrideTemplate(TestComponent, template)
11-
.createAsync(TestComponent)
12-
.then((fixture) => {
13-
fixture.detectChanges();
14-
expect(fixture.debugElement.componentInstance.viewChild).toBeAnInstanceOf(Infragistics.IgDialogComponent);
15-
//expect($("#dialog").igDialog("content")).toBe("<div>Test Content</div>");
16-
async.done();
17-
});
18-
}));
19-
8+
it('should initialize correctly', injectAsync([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
9+
var template = '<div><ig-dialog widgetId="dialog" [(options)]="opts"><div>Test Content</div></ig-dialog></div>';
10+
tcb.overrideTemplate(TestComponent, template)
11+
.createAsync(TestComponent)
12+
.then((fixture) => {
13+
fixture.detectChanges();
14+
expect(fixture.debugElement.componentInstance.viewChild).toBeAnInstanceOf(Infragistics.IgDialogComponent);
15+
expect($(fixture.debugElement.nativeElement).find("#dialog").igDialog("content")[0].innerHTML)
16+
.toBe("<div>Test Content</div>");
17+
async.done();
18+
});
19+
}));
20+
2021
});
2122
}
2223

@@ -26,14 +27,14 @@ export function main() {
2627
directives: [Infragistics.IgDialogComponent]
2728
})
2829
class TestComponent {
29-
private opts: any;
30+
private opts: any;
3031

31-
@ViewChild(Infragistics.IgDialogComponent) public viewChild: Infragistics.IgDialogComponent;
32-
33-
constructor() {
34-
this.opts = {
32+
@ViewChild(Infragistics.IgDialogComponent) public viewChild: Infragistics.IgDialogComponent;
33+
34+
constructor() {
35+
this.opts = {
3536
headerText : "Header Text",
3637
height: "500px"
37-
};
38-
}
38+
};
39+
}
3940
}

tests/unit/iggrid/grid.spec.ts

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,53 @@ export function main() {
139139
}, 10);
140140
});
141141
}));
142+
143+
it('should allow column templates', injectAsync([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
144+
var template = '<div><ig-grid [(widgetId)]="gridID" [(options)]="opts1" [changeDetectionInterval]="cdi"></ig-grid></div>';
145+
tcb.overrideTemplate(TestComponent, template)
146+
.createAsync(TestComponent)
147+
.then((fixture) => {
148+
fixture.detectChanges();
149+
fixture.componentInstance.data[0].Age = 42;
150+
setTimeout(() => {
151+
fixture.detectChanges();
152+
expect($(fixture.debugElement.nativeElement).find("#grid1 tr[data-id='1'] td[aria-describedby='grid1_Age']").text())
153+
.toBe("Age: 42");
154+
async.done();
155+
}, 10);
156+
});
157+
}));
158+
159+
it('should detect and apply changes of date columns to model', injectAsync([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
160+
var template = '<div><ig-grid [(widgetId)]="gridID" [(options)]="opts1" [changeDetectionInterval]="cdi"></ig-grid></div>';
161+
tcb.overrideTemplate(TestComponent, template)
162+
.createAsync(TestComponent)
163+
.then((fixture) => {
164+
fixture.detectChanges();
165+
$(fixture.debugElement.nativeElement).find("#grid1 tr[data-id='2'] td[aria-describedby='grid1_HireDate']").click();
166+
$(fixture.debugElement.nativeElement).find("#grid1").igGridUpdating("setCellValue", 2, "HireDate", "11/11/2016");
167+
$(fixture.debugElement.nativeElement).find("#grid1_container #grid1_updating_done").click();
168+
expect(fixture.debugElement.componentInstance.data[1].HireDate.getTime())
169+
.toBe(new Date("11/11/2016").getTime());
170+
async.done();
171+
});
172+
}));
173+
174+
it('should detect and apply changes of dates columns from model', injectAsync([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
175+
var template = '<div><ig-grid [(widgetId)]="gridID" [(options)]="opts1" [changeDetectionInterval]="cdi"></ig-grid></div>';
176+
tcb.overrideTemplate(TestComponent, template)
177+
.createAsync(TestComponent)
178+
.then((fixture) => {
179+
fixture.detectChanges();
180+
fixture.componentInstance.data[0].HireDate = new Date("11/11/2016");
181+
setTimeout(() => {
182+
fixture.detectChanges();
183+
expect($(fixture.debugElement.nativeElement).find("#grid1 tr:first td[aria-describedby='grid1_HireDate']").text())
184+
.toBe("11/11/2016");
185+
async.done();
186+
}, 10);
187+
});
188+
}));
142189
});
143190
}
144191

@@ -160,9 +207,9 @@ class TestComponent {
160207
this.gridID = "grid1";
161208
this.cdi = 0;
162209
this.data = [
163-
{ "Id": 1, "Name": "John Smith", "Age": 45 },
164-
{ "Id": 2, "Name": "Mary Johnson", "Age": 32 },
165-
{ "Id": 3, "Name": "Bob Ferguson", "Age": 27 }
210+
{ "Id": 1, "Name": "John Smith", "Age": 45, "HireDate": "\/Date(704678400000)\/" },
211+
{ "Id": 2, "Name": "Mary Johnson", "Age": 32, "HireDate": "\/Date(794678400000)\/" },
212+
{ "Id": 3, "Name": "Bob Ferguson", "Age": 27, "HireDate": "\/Date(834678400000)\/" }
166213
]
167214
this.opts = {
168215
primaryKey: "Id",
@@ -175,7 +222,19 @@ class TestComponent {
175222

176223
this.opts1 = {
177224
dataSource: this.data,
178-
height: "300px"
225+
height: "300px",
226+
autoGenerateColumns: false,
227+
primaryKey: "Id",
228+
columns: [
229+
{ key: "Id", headerText: "Id", dataType: "number", hidden: true },
230+
{ key: "Name", headerText: "Name", dataType: "string", width: "100px" },
231+
{ key: "Age", headerText: "Age", dataType: "number", width: "100px", template: "Age: ${Age}" },
232+
{ key: "HireDate", headerText: "HireDate", dataType: "date", width: "100px" },
233+
],
234+
autoCommit: true,
235+
features: [
236+
{ name: "Updating" }
237+
]
179238
};
180239
}
181240

0 commit comments

Comments
 (0)