Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

Commit fb8ce2f

Browse files
euhmeuhAxelPeter
authored andcommitted
fix(oui-datagrid): fix empty cells when loading data (#348)
1 parent 8e2ddce commit fb8ce2f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

packages/oui-datagrid/src/datagrid.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
column="column"
6666
index="rowIndex">
6767
</oui-datagrid-cell>
68+
<oui-skeleton ng-if="row && row.$promise && !$ctrl.hasProperty(row, column.name)"></oui-skeleton>
6869
</td>
6970
<td ng-if="$ctrl.hasActionMenu || $ctrl.customizable"
7071
class="oui-datagrid__cell oui-datagrid__cell-sticky">

packages/oui-datagrid/src/index.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ describe("ouiDatagrid", () => {
115115
expect(getCell($firstRow, 2).children().html()).toBe(additionnalDataValue);
116116
}));
117117

118-
it("should keep undefined when a cell is not loaded", inject(($q) => {
118+
it("should display a skeleton when a cell is not loaded", inject(($q) => {
119119
const deferred = $q.defer();
120120
const loadRowSpy = jasmine.createSpy("loadRow");
121121

@@ -138,7 +138,7 @@ describe("ouiDatagrid", () => {
138138
expect(loadRowSpy.calls.count()).toEqual(1);
139139

140140
expect(getCell($firstRow, 0).children().html()).toBe(fakeData[0].firstName);
141-
expect(getCell($firstRow, 2).children().html()).toBeUndefined();
141+
expect(getCell($firstRow, 2).children()[0].tagName.toLowerCase()).toBe("oui-skeleton");
142142
}));
143143

144144
it("should load data later and display it", inject(($q) => {
@@ -557,7 +557,7 @@ describe("ouiDatagrid", () => {
557557
expect(getCell($fifthRow, 1).children().html()).toBe(fakeData[4].lastName);
558558
});
559559

560-
it("should keep undefined when a cell is not loaded", inject(($q) => {
560+
it("should display a skeleton when a cell is not loaded", inject(($q) => {
561561
const deferred = $q.defer();
562562
const loadRowSpy = jasmine.createSpy("loadRow");
563563

@@ -590,7 +590,7 @@ describe("ouiDatagrid", () => {
590590
expect(loadRowSpy.calls.count()).toEqual(1);
591591

592592
expect(getCell($firstRow, 0).children().html()).toBe(fakeData[0].firstName);
593-
expect(getCell($firstRow, 2).children().html()).toBeUndefined();
593+
expect(getCell($firstRow, 2).children()[0].tagName.toLowerCase()).toBe("oui-skeleton");
594594
}));
595595

596596
it("should load data later and display it", inject(($q) => {

0 commit comments

Comments
 (0)