Mark pillar table rows as corrupt if init fails
This commit is contained in:
@@ -5,6 +5,7 @@ class RowBase {
|
|||||||
constructor(underlyingObject) {
|
constructor(underlyingObject) {
|
||||||
this.underlyingObject = underlyingObject;
|
this.underlyingObject = underlyingObject;
|
||||||
this.isInitialized = false;
|
this.isInitialized = false;
|
||||||
|
this.isCorrupt = false;
|
||||||
this.isSelected = false;
|
this.isSelected = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,7 +15,12 @@ class RowBase {
|
|||||||
thenInit() {
|
thenInit() {
|
||||||
return this._thenInitImpl()
|
return this._thenInitImpl()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.isInitialized = true
|
this.isInitialized = true;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.warn(err);
|
||||||
|
this.isCorrupt = true;
|
||||||
|
throw err;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,7 +48,9 @@ class RowBase {
|
|||||||
*/
|
*/
|
||||||
getRowClasses() {
|
getRowClasses() {
|
||||||
return {
|
return {
|
||||||
"is-busy": !this.isInitialized
|
"active": this.isSelected,
|
||||||
|
"is-busy": !this.isInitialized,
|
||||||
|
"is-corrupt": this.isCorrupt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,9 +26,7 @@ Vue.component('pillar-table-row', {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
rowClasses() {
|
rowClasses() {
|
||||||
let classes = this.rowObject.getRowClasses()
|
return this.rowObject.getRowClasses();
|
||||||
classes['active'] = this.rowObject.isSelected;
|
|
||||||
return classes;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user