From ff03db61a8bfa8344154c2a8786b9990ee86bf59 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 13 Dec 2021 13:21:14 +0100 Subject: [PATCH] web/admin: fix rendering of applications with custom icon Signed-off-by: Jens Langhammer --- .../pages/applications/ApplicationListPage.ts | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/web/src/pages/applications/ApplicationListPage.ts b/web/src/pages/applications/ApplicationListPage.ts index 450ff28a6..3acf06ef1 100644 --- a/web/src/pages/applications/ApplicationListPage.ts +++ b/web/src/pages/applications/ApplicationListPage.ts @@ -2,6 +2,7 @@ import { t } from "@lingui/macro"; import { CSSResult, TemplateResult, css, html } from "lit"; import { customElement, property } from "lit/decorators.js"; +import { ifDefined } from "lit/directives/if-defined.js"; import PFAvatar from "@patternfly/patternfly/components/Avatar/avatar.css"; @@ -94,15 +95,24 @@ export class ApplicationListPage extends TablePage { `; } + renderIcon(item: Application): TemplateResult { + if (item?.metaIcon) { + if (item.metaIcon.startsWith("fa://")) { + const icon = item.metaIcon.replaceAll("fa://", ""); + return html``; + } + return html`${t`Application Icon`}`; + } + return html``; + } + row(item: Application): TemplateResult[] { return [ - item.metaIcon - ? html`${t`Application Icon`}` - : html``, + this.renderIcon(item), html`
${item.name}
${item.metaPublisher ? html`${item.metaPublisher}` : html``}