Skip to content

Commit 166922f

Browse files
ktranDevtools-frontend LUCI CQ
authored andcommitted
Fix missing styles for interest group empty state
After dropping the `adoptedStyleSheets` the styles went missing for the interest group tab's empty state. This CL moves the rendering of the empty state into the main `render` method, under which we also include the correct styles. Before: https://i.imgur.com/N3xS6DM.png After: https://i.imgur.com/3W26pvn.png Bug: none Change-Id: If8eed04ec054e199d08053337cd3e6b2d3112c5e Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6376103 Commit-Queue: Benedikt Meurer <[email protected]> Auto-Submit: Kim-Anh Tran <[email protected]> Reviewed-by: Benedikt Meurer <[email protected]>
1 parent ec23749 commit 166922f

File tree

1 file changed

+15
-21
lines changed

1 file changed

+15
-21
lines changed

front_end/panels/application/components/InterestGroupAccessGrid.ts

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,29 @@ export class InterestGroupAccessGrid extends HTMLElement {
8080
}
8181

8282
#render(): void {
83-
if (this.#datastores.length === 0) {
84-
Lit.render(this.#renderEmptyState(), this.#shadow, {host: this});
85-
return;
86-
}
8783
// clang-format off
8884
Lit.render(html`
8985
<style>${interestGroupAccessGridStyles.cssText}</style>
9086
<style>${inspectorCommonStyles.cssText}</style>
91-
<div>
92-
<span class="heading">Interest Groups</span>
93-
<devtools-icon class="info-icon"
94-
title=${i18nString(UIStrings.allInterestGroupStorageEvents)}
95-
.data=${{iconName: 'info', color: 'var(--icon-default)', width: '16px'}}>
96-
</devtools-icon>
97-
${this.#renderGrid()}
98-
</div>
87+
${this.#datastores.length === 0 ?
88+
html`
89+
<div class="empty-state">
90+
<span class="empty-state-header">${i18nString(UIStrings.noEvents)}</span>
91+
<span class="empty-state-description">${i18nString(UIStrings.interestGroupDescription)}</span>
92+
</div>`:
93+
html`
94+
<div>
95+
<span class="heading">Interest Groups</span>
96+
<devtools-icon class="info-icon"
97+
title=${i18nString(UIStrings.allInterestGroupStorageEvents)}
98+
.data=${{iconName: 'info', color: 'var(--icon-default)', width: '16px'}}>
99+
</devtools-icon>
100+
${this.#renderGrid()}
101+
</div>`}
99102
`, this.#shadow, {host: this});
100103
// clang-format on
101104
}
102105

103-
#renderEmptyState(): Lit.TemplateResult {
104-
return html`
105-
<div class="empty-state">
106-
<span class="empty-state-header">${i18nString(UIStrings.noEvents)}</span>
107-
<span class="empty-state-description">${i18nString(UIStrings.interestGroupDescription)}</span>
108-
</div>
109-
`;
110-
}
111-
112106
#renderGrid(): Lit.TemplateResult {
113107
return html`
114108
<devtools-data-grid @select=${this.#onSelect} striped inline>

0 commit comments

Comments
 (0)