Skip to content

Commit b218ba5

Browse files
admin: make empty table message configurable
This commit provides a new field at the Table level for the empty state message. The field defaults to the original message, “No objects found.” The icon has long been configurable, but not the message. It makes sense to customize this message and let people know if they’re looking at files, properties, applications, and other objects. Co-authored-by: Ken Sternberg <[email protected]>
1 parent 94ae8b7 commit b218ba5

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

web/src/elements/table/Table.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ export abstract class Table<T extends object>
101101
*/
102102
protected abstract row(item: T): SlottedTemplateResult[];
103103

104+
/**
105+
* Customize the "No objects found" message.
106+
*/
107+
protected emptyStateMessage = msg("No objects found.");
108+
104109
/**
105110
* The total number of defined and additional columns in the table.
106111
*/
@@ -368,7 +373,7 @@ export abstract class Table<T extends object>
368373
<div class="pf-l-bullseye">
369374
${inner ??
370375
html`<ak-empty-state
371-
><span>${msg("No objects found.")}</span>
376+
><span>${this.emptyStateMessage}</span>
372377
<div slot="primary">${this.renderObjectCreate()}</div>
373378
</ak-empty-state>`}
374379
</div>

web/src/elements/table/TablePage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export abstract class TablePage<T extends object> extends Table<T> {
119119
${inner
120120
? inner
121121
: html`<ak-empty-state icon=${this.pageIcon}
122-
><span>${msg("No objects found.")}</span>
122+
><span>${this.emptyStateMessage}</span>
123123
<div slot="body">
124124
${this.searchEnabled ? this.renderEmptyClearSearch() : nothing}
125125
</div>

0 commit comments

Comments
 (0)