diff --git a/resources/js/entity-list/EntityList.ts b/resources/js/entity-list/EntityList.ts
index 25f55f146..c5b2044b5 100644
--- a/resources/js/entity-list/EntityList.ts
+++ b/resources/js/entity-list/EntityList.ts
@@ -148,13 +148,17 @@ export class EntityList implements EntityListData {
);
}
+ instanceHasBadge(instance: EntityListInstance, field: EntityListFieldData): boolean {
+ return (
+ instance[field.key] === true
+ || typeof instance[field.key] === 'number'
+ || typeof instance[field.key] === 'string' && instance[field.key].length > 0
+ );
+ }
+
fieldShouldBeVisible(field: EntityListFieldData, showEntityState: boolean): boolean {
if(field.type === 'badge') {
- return this.data.some(item =>
- item[field.key] === true
- || typeof item[field.key] === 'number'
- || typeof item[field.key] === 'string' && item[field.key].length > 0
- );
+ return this.data.some(item => this.instanceHasBadge(item, field));
}
if(field.type === 'state') {
diff --git a/resources/js/entity-list/components/EntityList.vue b/resources/js/entity-list/components/EntityList.vue
index 7b84cc2e0..f64498794 100644
--- a/resources/js/entity-list/components/EntityList.vue
+++ b/resources/js/entity-list/components/EntityList.vue
@@ -756,28 +756,30 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item[field.key] }}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item[field.key] }}
+
+
+
+
+
+
+
+
+
+