Do not show account status icons on comment filter
The user intent here is about filtering by name, so the account status
icons are likely not helpful and serve as clutter. The avatar still
serves to disambiguate and quickly identify users.
https://imgur.com/a/rpkX8Ug
Google-Bug-Id: b/218503833
Release-Notes: skip
Change-Id: Icb3e2ef59411a26d87bddaf5b2a6e8eb6dd1ede8
diff --git a/polygerrit-ui/app/elements/change/gr-thread-list/gr-thread-list.ts b/polygerrit-ui/app/elements/change/gr-thread-list/gr-thread-list.ts
index b41147b..477f579 100644
--- a/polygerrit-ui/app/elements/change/gr-thread-list/gr-thread-list.ts
+++ b/polygerrit-ui/app/elements/change/gr-thread-list/gr-thread-list.ts
@@ -429,6 +429,7 @@
.account="${account}"
@click="${this.handleAccountClicked}"
selectionChipStyle
+ noStatusIcons
?selected="${selected}"
></gr-account-label>
`;
diff --git a/polygerrit-ui/app/elements/change/gr-thread-list/gr-thread-list_test.ts b/polygerrit-ui/app/elements/change/gr-thread-list/gr-thread-list_test.ts
index 5b85092..33a4e21 100644
--- a/polygerrit-ui/app/elements/change/gr-thread-list/gr-thread-list_test.ts
+++ b/polygerrit-ui/app/elements/change/gr-thread-list/gr-thread-list_test.ts
@@ -321,22 +321,27 @@
<gr-account-label
deselected=""
selectionchipstyle=""
+ nostatusicons=""
></gr-account-label>
<gr-account-label
deselected=""
selectionchipstyle=""
+ nostatusicons=""
></gr-account-label>
<gr-account-label
deselected=""
selectionchipstyle=""
+ nostatusicons=""
></gr-account-label>
<gr-account-label
deselected=""
selectionchipstyle=""
+ nostatusicons=""
></gr-account-label>
<gr-account-label
deselected=""
selectionchipstyle=""
+ nostatusicons=""
></gr-account-label>
</div>
<div id="threads" part="threads">
diff --git a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.ts b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.ts
index 274601f..43f49d9 100644
--- a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.ts
+++ b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.ts
@@ -91,6 +91,9 @@
@property({type: Boolean, reflect: true})
selectionChipStyle = false;
+ @property({type: Boolean, reflect: true})
+ noStatusIcons = false;
+
@property({
type: Boolean,
reflect: true,
@@ -268,7 +271,7 @@
}
private renderAccountStatusPlugins() {
- if (!this.account?._account_id) {
+ if (!this.account?._account_id || this.noStatusIcons) {
return;
}
return html`
diff --git a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_test.ts b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_test.ts
index 820cb0e..654fb33 100644
--- a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_test.ts
+++ b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_test.ts
@@ -18,6 +18,7 @@
import '../../../test/common-test-setup-karma';
import './gr-account-label';
import {
+ query,
queryAndAssert,
spyRestApi,
stubRestApi,
@@ -151,5 +152,19 @@
assert.isTrue(apiSpy.calledOnce);
assert.equal(apiSpy.lastCall.args[1], 42);
});
+
+ test('no status icons attribute', async () => {
+ queryAndAssert(
+ element,
+ 'gr-endpoint-decorator[name="account-status-icon"]'
+ );
+
+ element.noStatusIcons = true;
+ await element.updateComplete;
+
+ assert.notExists(
+ query(element, 'gr-endpoint-decorator[name="account-status-icon"]')
+ );
+ });
});
});