diff --git a/web/src/elements/table/Table.ts b/web/src/elements/table/Table.ts index f671e7b37..b9cf20b14 100644 --- a/web/src/elements/table/Table.ts +++ b/web/src/elements/table/Table.ts @@ -23,7 +23,7 @@ import PFToolbar from "@patternfly/patternfly/components/Toolbar/toolbar.css"; import PFBullseye from "@patternfly/patternfly/layouts/Bullseye/bullseye.css"; import PFBase from "@patternfly/patternfly/patternfly-base.css"; -import { Pagination } from "@goauthentik/api"; +import { Pagination, ResponseError } from "@goauthentik/api"; export class TableColumn { title: string; @@ -260,7 +260,9 @@ export abstract class Table extends AKElement { renderError(): TemplateResult { return html` -
${this.hasError?.toString()}
+ ${this.hasError instanceof ResponseError + ? html`
${this.hasError.message}
` + : html`
${this.hasError?.toString()}
`}
`; } @@ -268,8 +270,8 @@ export abstract class Table extends AKElement { if (this.hasError) { return [this.renderEmpty(this.renderError())]; } - if (!this.data) { - return; + if (!this.data || this.isLoading) { + return [this.renderLoading()]; } if (this.data.pagination.count === 0) { return [this.renderEmpty()]; @@ -499,7 +501,7 @@ export abstract class Table extends AKElement { ${this.columns().map((col) => col.render(this))} - ${this.isLoading || !this.data ? this.renderLoading() : this.renderRows()} + ${this.renderRows()} ${this.paginated ? html`