Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/oui-datagrid/src/datagrid.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
column="column"
index="rowIndex">
</oui-datagrid-cell>
<oui-skeleton ng-if="row && row.$promise && !$ctrl.hasProperty(row, column.name)"></oui-skeleton>
</td>
<td ng-if="$ctrl.hasActionMenu || $ctrl.customizable"
class="oui-datagrid__cell oui-datagrid__cell-sticky">
Expand Down
8 changes: 4 additions & 4 deletions packages/oui-datagrid/src/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ describe("ouiDatagrid", () => {
expect(getCell($firstRow, 2).children().html()).toBe(additionnalDataValue);
}));

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

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

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

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

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

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

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

it("should load data later and display it", inject(($q) => {
Expand Down
7 changes: 1 addition & 6 deletions packages/oui-dropdown/src/dropdown.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,7 @@ export default class {
this.popperElement.style.minWidth = `${this.getTriggerWidth()}px`;

this.popper = new Popper(this.triggerElement, this.popperElement, {
placement,
modifiers: {
preventOverflow: {
boundariesElement: this.$document[0].body
}
}
placement
});
}

Expand Down
10 changes: 5 additions & 5 deletions packages/oui-field/src/field.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export default class FieldController {
});

// Handle click on label to set focus on form element.
this.label = angular.element(this.$element[0].querySelector(LABEL_SELECTOR));
this.label.on("click", () => {
this.labelElement = angular.element(this.$element[0].querySelector(LABEL_SELECTOR));
this.labelElement.on("click", () => {
this.$scope.$broadcast("oui:focus");
});

Expand All @@ -106,7 +106,7 @@ export default class FieldController {
});
}

$destroy () {
$onDestroy () {
Object.keys(this.controls).forEach(name => {
const namedControls = this.controls[name];
namedControls.forEach(control => {
Expand All @@ -115,8 +115,8 @@ export default class FieldController {
});
});

if (this.label) {
this.label.off("click");
if (this.labelElement) {
this.labelElement.off("click");
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/oui-popover/src/popover.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class PopoverController {
this.setTrigger();
}

$destroy () {
$onDestroy () {
this.closePopover();
}

Expand Down
8 changes: 5 additions & 3 deletions packages/oui-select-picker/src/select-picker.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class SelectPickerController {
}

if (this.picture) {
this.isImgPath = /^data:/.test(this.picture) || /\.(gif|png|jpg)$/.test(this.picture);
this.isImgPath = /^data:/.test(this.picture) || /\.(gif|png|jpg|svg)$/.test(this.picture);
}

if (this.values) {
Expand Down Expand Up @@ -68,8 +68,10 @@ export default class SelectPickerController {
});
}

$destroy () {
this.labelElement.off("click");
$onDestroy () {
if (this.labelElement) {
this.labelElement.off("click");
}
}

getFirstValueMatch (path) {
Expand Down
2 changes: 1 addition & 1 deletion packages/oui-select/src/select.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class {
this.unregisterFocus = this.$scope.$on("oui:focus", () => this.$select.setFocus());
}

$destroy () {
$onDestroy () {
if (this.unregisterFocus) {
this.unregisterFocus();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/oui-slideshow/src/slideshow.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class {
});
}

$destroy () {
$onDestroy () {
this.closeOnBoarding();
}

Expand Down
6 changes: 4 additions & 2 deletions packages/oui-textarea/src/textarea.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@ export default class {
}
}

$destroy () {
this.$footer.off("click");
$onDestroy () {
if (this.$footer) {
this.$footer.off("click");
}
}

onTextareaChange () {
Expand Down