Skip to content

Commit 7b04eaa

Browse files
author
Santosh
committed
fix(WebUI): remove duplicate headers, move i18n descriptions to breadcrumb
1 parent f155a5f commit 7b04eaa

13 files changed

Lines changed: 1668 additions & 1429 deletions

File tree

‎ui/src/styles/layout.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,11 @@
168168
text-overflow: ellipsis;
169169
}
170170

171+
.topnav-shell .dashboard-header__breadcrumb-desc {
172+
color: var(--muted);
173+
font-weight: normal;
174+
}
175+
171176
.topbar-status {
172177
display: flex;
173178
align-items: center;

‎ui/src/ui/app-render.ts‎

Lines changed: 1019 additions & 977 deletions
Large diffs are not rendered by default.

‎ui/src/ui/components/dashboard-header.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { LitElement, html } from "lit";
1+
import { LitElement, html, nothing } from "lit";
22
import { property } from "lit/decorators.js";
3-
import { titleForTab, type Tab } from "../navigation.js";
3+
import { subtitleForTab, titleForTab, type Tab } from "../navigation.js";
44

55
export class DashboardHeader extends LitElement {
66
override createRenderRoot() {
@@ -11,6 +11,7 @@ export class DashboardHeader extends LitElement {
1111

1212
override render() {
1313
const label = titleForTab(this.tab);
14+
const subtitle = subtitleForTab(this.tab);
1415

1516
return html`
1617
<div class="dashboard-header">
@@ -26,6 +27,11 @@ export class DashboardHeader extends LitElement {
2627
</span>
2728
<span class="dashboard-header__breadcrumb-sep">›</span>
2829
<span class="dashboard-header__breadcrumb-current">${label}</span>
30+
${
31+
subtitle
32+
? html`<span class="dashboard-header__breadcrumb-sep">—</span><span class="dashboard-header__breadcrumb-desc">${subtitle}</span>`
33+
: nothing
34+
}
2935
</div>
3036
<div class="dashboard-header__actions">
3137
<slot></slot>

‎ui/src/ui/views/channels.ts‎

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,16 @@ export function renderChannels(props: ChannelsProps) {
7575
7676
<section class="card" style="margin-top: 18px;">
7777
<div class="row" style="justify-content: space-between;">
78-
<div>
79-
<div class="card-title">${t("channels.health.title")}</div>
80-
<div class="card-sub">${t("channels.health.subtitle")}</div>
81-
</div>
78+
<div></div>
8279
<div class="muted">
8380
${props.lastSuccessAt ? formatRelativeTimestamp(props.lastSuccessAt) : t("common.na")}
8481
</div>
8582
</div>
86-
${props.lastError
87-
? html`<div class="callout danger" style="margin-top: 12px;">${props.lastError}</div>`
88-
: nothing}
83+
${
84+
props.lastError
85+
? html`<div class="callout danger" style="margin-top: 12px;">${props.lastError}</div>`
86+
: nothing
87+
}
8988
<pre class="code-block" style="margin-top: 12px;">
9089
${props.snapshot ? JSON.stringify(props.snapshot, null, 2) : t("channels.health.noSnapshotYet")}
9190
</pre
@@ -199,13 +198,14 @@ function renderGenericChannelCard(
199198
<div class="card-title">${label}</div>
200199
<div class="card-sub">${t("channels.generic.subtitle")}</div>
201200
${accountCountLabel}
202-
${accounts.length > 0
203-
? html`
201+
${
202+
accounts.length > 0
203+
? html`
204204
<div class="account-card-list">
205205
${accounts.map((account) => renderGenericAccount(account))}
206206
</div>
207207
`
208-
: html`
208+
: html`
209209
<div class="status-list" style="margin-top: 16px;">
210210
<div>
211211
<span class="label">${t("common.configured")}</span>
@@ -220,10 +220,13 @@ function renderGenericChannelCard(
220220
<span>${formatNullableBoolean(displayState.connected)}</span>
221221
</div>
222222
</div>
223-
`}
224-
${lastError
225-
? html`<div class="callout danger" style="margin-top: 12px;">${lastError}</div>`
226-
: nothing}
223+
`
224+
}
225+
${
226+
lastError
227+
? html`<div class="callout danger" style="margin-top: 12px;">${lastError}</div>`
228+
: nothing
229+
}
227230
${renderChannelConfigSection({ channelId: key, props })}
228231
</div>
229232
`;
@@ -303,14 +306,18 @@ function renderGenericAccount(account: ChannelAccountSnapshot) {
303306
<div>
304307
<span class="label">${t("common.lastInbound")}</span>
305308
<span
306-
>${account.lastInboundAt
307-
? formatRelativeTimestamp(account.lastInboundAt)
308-
: t("common.na")}</span
309+
>${
310+
account.lastInboundAt
311+
? formatRelativeTimestamp(account.lastInboundAt)
312+
: t("common.na")
313+
}</span
309314
>
310315
</div>
311-
${account.lastError
312-
? html` <div class="account-card-error">${account.lastError}</div> `
313-
: nothing}
316+
${
317+
account.lastError
318+
? html` <div class="account-card-error">${account.lastError}</div> `
319+
: nothing
320+
}
314321
</div>
315322
</div>
316323
`;

‎ui/src/ui/views/cron.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ describe("cron view", () => {
226226
expect(container.textContent).toContain("Latest runs for Daily ping.");
227227

228228
const cards = Array.from(container.querySelectorAll(".card"));
229-
const runHistoryCard = cards.find(
230-
(card) => card.querySelector(".card-title")?.textContent?.trim() === "Run history",
231-
);
229+
const runHistoryCard = cards.find((card) => card.querySelector(".cron-run-filters") !== null);
232230
expect(runHistoryCard).not.toBeUndefined();
233231

234232
const summaries = Array.from(

0 commit comments

Comments
 (0)