Merge "Replace "RESET VIEW" in results panel by "UNSELECT ALL" in runs panel"
diff --git a/polygerrit-ui/app/elements/checks/gr-checks-results.ts b/polygerrit-ui/app/elements/checks/gr-checks-results.ts
index 511837e..a4ac01d 100644
--- a/polygerrit-ui/app/elements/checks/gr-checks-results.ts
+++ b/polygerrit-ui/app/elements/checks/gr-checks-results.ts
@@ -60,8 +60,8 @@
} from '../../utils/common-util';
import {toggleClass, whenVisible} from '../../utils/dom-util';
import {durationString} from '../../utils/date-util';
-import {charsOnly, pluralize} from '../../utils/string-util';
-import {fireRunSelectionReset, isAttemptSelected} from './gr-checks-util';
+import {charsOnly} from '../../utils/string-util';
+import {isAttemptSelected} from './gr-checks-util';
import {ChecksTabState} from '../../types/events';
import {ConfigInfo, PatchSetNumber} from '../../types/common';
import {latestPatchNum$} from '../../services/change/change-model';
@@ -615,12 +615,6 @@
.filterDiv .selection {
padding: var(--spacing-s) var(--spacing-m);
}
- .filterDiv iron-icon.filter {
- color: var(--selected-foreground);
- }
- .filterDiv gr-button.reset {
- margin: calc(0px - var(--spacing-s)) var(--spacing-l);
- }
.categoryHeader {
margin-top: var(--spacing-l);
margin-left: var(--spacing-l);
@@ -850,28 +844,10 @@
placeholder="Filter results by regular expression"
@input="${this.onInput}"
/>
- <div class="selection">${this.renderSelectionFilter()}</div>
</div>
`;
}
- renderSelectionFilter() {
- const count = this.selectedRuns.length;
- if (count === 0) return;
- return html`
- <iron-icon class="filter" icon="gr-icons:filter"></iron-icon>
- <span>Filtered by ${pluralize(count, 'run')}</span>
- <gr-button link class="reset" @click="${this.handleClick}"
- >Reset View</gr-button
- >
- `;
- }
-
- handleClick() {
- this.filterRegExp = new RegExp('');
- fireRunSelectionReset(this);
- }
-
onInput() {
assertIsDefined(this.filterInput, 'filter <input> element');
this.filterRegExp = new RegExp(this.filterInput.value, 'i');
diff --git a/polygerrit-ui/app/elements/checks/gr-checks-runs.ts b/polygerrit-ui/app/elements/checks/gr-checks-runs.ts
index 1d65546..7346d5b 100644
--- a/polygerrit-ui/app/elements/checks/gr-checks-runs.ts
+++ b/polygerrit-ui/app/elements/checks/gr-checks-runs.ts
@@ -55,7 +55,11 @@
} from '../../services/checks/checks-model';
import {assertIsDefined} from '../../utils/common-util';
import {whenVisible} from '../../utils/dom-util';
-import {fireAttemptSelected, fireRunSelected} from './gr-checks-util';
+import {
+ fireAttemptSelected,
+ fireRunSelected,
+ fireRunSelectionReset,
+} from './gr-checks-util';
import {ChecksTabState} from '../../types/events';
import {charsOnly} from '../../utils/string-util';
@@ -350,6 +354,10 @@
padding: var(--spacing-l) var(--spacing-xl) var(--spacing-xl)
var(--spacing-xl);
}
+ .title {
+ display: flex;
+ justify-content: space-between;
+ }
.expandIcon {
width: var(--line-height-h3);
height: var(--line-height-h3);
@@ -410,7 +418,17 @@
render() {
return html`
- <h2 class="heading-2">Runs</h2>
+ <h2 class="title">
+ <div class="heading-2">Runs</div>
+ <div class="font-normal">
+ <gr-button
+ ?hidden="${this.selectedRuns.length < 2}"
+ link
+ @click="${() => fireRunSelectionReset(this)}"
+ >Unselect All</gr-button
+ >
+ </div>
+ </h2>
<input
id="filterInput"
type="text"