Skip to content

Commit 43e7387

Browse files
committed
chore(row-drag): remove generateData methods
1 parent 971ca8c commit 43e7387

File tree

1 file changed

+2
-38
lines changed

1 file changed

+2
-38
lines changed

projects/igniteui-angular/src/lib/grids/grid/row-drag.directive.spec.ts

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,25 +1316,7 @@ export class IgxHierarchicalGridTestComponent {
13161316
@ViewChild('rowIsland2', { read: IgxRowIslandComponent, static: true }) public rowIsland2: IgxRowIslandComponent;
13171317

13181318
constructor() {
1319-
this.data = this.generateData(2, 3);
1320-
}
1321-
generateData(count: number, level: number) {
1322-
const prods = [];
1323-
const currLevel = level;
1324-
let children;
1325-
for (let i = 0; i < count; i++) {
1326-
const item = {
1327-
ID: i, ChildLevels: currLevel, ProductName: 'Product: A' + i, 'Col1': i,
1328-
'Col2': i, 'Col3': i
1329-
};
1330-
if (currLevel > 1) {
1331-
children = this.generateData(count / 2, currLevel - 1);
1332-
const childProp = currLevel === 3 ? 'childData' : 'childData2';
1333-
item[childProp] = children;
1334-
}
1335-
prods.push(item);
1336-
}
1337-
return prods;
1319+
this.data = SampleTestData.generateHGridData(2, 3);
13381320
}
13391321
public onRowDrop(args) {
13401322
args.cancel = true;
@@ -1371,25 +1353,7 @@ export class IgxHierarchicalGridCustomGhostTestComponent {
13711353
@ViewChild('rowIsland2', { read: IgxRowIslandComponent, static: true }) public rowIsland2: IgxRowIslandComponent;
13721354

13731355
constructor() {
1374-
this.data = this.generateData(2, 3);
1375-
}
1376-
generateData(count: number, level: number) {
1377-
const prods = [];
1378-
const currLevel = level;
1379-
let children;
1380-
for (let i = 0; i < count; i++) {
1381-
const item = {
1382-
ID: i, ChildLevels: currLevel, ProductName: 'Product: A' + i, 'Col1': i,
1383-
'Col2': i, 'Col3': i
1384-
};
1385-
if (currLevel > 1) {
1386-
children = this.generateData(count / 2, currLevel - 1);
1387-
const childProp = currLevel === 3 ? 'childData' : 'childData2';
1388-
item[childProp] = children;
1389-
}
1390-
prods.push(item);
1391-
}
1392-
return prods;
1356+
this.data = SampleTestData.generateHGridData(2, 3);
13931357
}
13941358
}
13951359

0 commit comments

Comments
 (0)