Merge "Fix bug in user preferences in change table col selection" into stable-3.13
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.ts b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.ts
index 29fdb92..9b06622 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.ts
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item.ts
@@ -360,7 +360,7 @@
<label class="selectionLabel">
<md-checkbox
?checked=${this.checked}
- @click=${this.toggleCheckbox}
+ @change=${this.toggleCheckbox}
></md-checkbox>
</label>
</td>
diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-section/gr-change-list-section.ts b/polygerrit-ui/app/elements/change-list/gr-change-list-section/gr-change-list-section.ts
index bd53670..d8c1a5d 100644
--- a/polygerrit-ui/app/elements/change-list/gr-change-list-section/gr-change-list-section.ts
+++ b/polygerrit-ui/app/elements/change-list/gr-change-list-section/gr-change-list-section.ts
@@ -296,7 +296,7 @@
class="selection-checkbox"
?checked=${checked}
.indeterminate=${indeterminate}
- @click=${this.handleSelectAllCheckboxClicked}
+ @change=${this.handleSelectAllCheckboxClicked}
></md-checkbox>
</td>
`;
diff --git a/polygerrit-ui/app/elements/change/gr-validation-options/gr-validation-options.ts b/polygerrit-ui/app/elements/change/gr-validation-options/gr-validation-options.ts
index de37852..6fdb74e 100644
--- a/polygerrit-ui/app/elements/change/gr-validation-options/gr-validation-options.ts
+++ b/polygerrit-ui/app/elements/change/gr-validation-options/gr-validation-options.ts
@@ -67,7 +67,7 @@
class="selectionLabel"
id=${option.name}
?checked=${!!this.isOptionSelected.get(option.name)}
- @click=${() => this.toggleCheckbox(option)}
+ @change=${() => this.toggleCheckbox(option)}
></md-checkbox>
<label for=${option.name}
>${capitalizeFirstLetter(option.description)}</label
diff --git a/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor.ts b/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor.ts
index 9e970e6..8fb6e88 100644
--- a/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor.ts
+++ b/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor.ts
@@ -82,7 +82,7 @@
id="numberCheckbox"
name="number"
?checked=${!!this.showNumber}
- @click=${this.handleNumberCheckboxClick}
+ @change=${this.handleNumberCheckboxClick}
></md-checkbox>
</td>
</tr>
@@ -100,7 +100,7 @@
id=${column}
name=${column}
?checked=${!this.computeIsColumnHidden(column)}
- @click=${this.handleTargetClick}
+ @change=${this.handleTargetClick}
></md-checkbox>
</td>
</tr>`;
diff --git a/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor_test.ts b/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor_test.ts
index b322d46..a0a747d 100644
--- a/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor_test.ts
+++ b/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor_test.ts
@@ -160,7 +160,7 @@
assert.equal(element.displayedColumns.length, displayedLength - 1);
});
- test('show item', async () => {
+ test('show and hide item', async () => {
element.displayedColumns = [
ColumnNames.STATUS,
ColumnNames.OWNER,
@@ -171,20 +171,35 @@
// trigger computation of enabled displayed columns
element.serverConfig = createServerInfo();
await element.updateComplete;
- const checkbox = queryAndAssert<MdCheckbox>(
+
+ const checkboxSubject = queryAndAssert<MdCheckbox>(
element,
'table tr:nth-child(2) md-checkbox'
);
- const isChecked = checkbox.checked;
- const displayedLength = element.displayedColumns.length;
- assert.isFalse(isChecked);
- const table = queryAndAssert<HTMLTableElement>(element, 'table');
- assert.equal(table.style.display, '');
+ assert.equal(checkboxSubject.name, 'Subject');
+ const checkboxOwner = queryAndAssert<MdCheckbox>(
+ element,
+ 'table tr:nth-child(3) md-checkbox'
+ );
+ assert.equal(checkboxOwner.name, 'Owner');
- checkbox.click();
+ assert.equal(element.displayedColumns.length, 5);
+ assert.isFalse(checkboxSubject.checked);
+ assert.isTrue(checkboxOwner.checked);
+
+ checkboxSubject.click();
await element.updateComplete;
- assert.equal(element.displayedColumns.length, displayedLength + 1);
+ assert.equal(element.displayedColumns.length, 6);
+ assert.isTrue(checkboxSubject.checked);
+ assert.isTrue(checkboxOwner.checked);
+
+ checkboxOwner.click();
+ await element.updateComplete;
+
+ assert.equal(element.displayedColumns.length, 5);
+ assert.isTrue(checkboxSubject.checked);
+ assert.isFalse(checkboxOwner.checked);
});
test('getDisplayedColumns', () => {
diff --git a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
index 56f5f55..df26cb8 100644
--- a/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
+++ b/polygerrit-ui/app/elements/shared/gr-comment/gr-comment.ts
@@ -880,7 +880,7 @@
<md-checkbox
class="show-hide"
?checked=${!!this.collapsed}
- @click=${() => (this.collapsed = !this.collapsed)}
+ @change=${() => (this.collapsed = !this.collapsed)}
></md-checkbox>
<gr-icon icon=${icon} id="icon"></gr-icon>
</label>
@@ -1031,7 +1031,7 @@
<md-checkbox
id="resolvedCheckbox"
?checked=${!this.unresolved}
- @click=${this.handleToggleResolved}
+ @change=${this.handleToggleResolved}
></md-checkbox>
Resolved
</label>
@@ -1182,7 +1182,7 @@
<md-checkbox
id="generateSuggestCheckbox"
?checked=${this.generateSuggestion}
- @click=${() => {
+ @change=${() => {
this.generateSuggestion = !this.generateSuggestion;
// Reset so suggestion can be re-generated.
this.wasSuggestionEdited = false;
diff --git a/polygerrit-ui/app/elements/shared/gr-fix-suggestions/gr-fix-suggestions.ts b/polygerrit-ui/app/elements/shared/gr-fix-suggestions/gr-fix-suggestions.ts
index 1e02b29..7c8bcf4 100644
--- a/polygerrit-ui/app/elements/shared/gr-fix-suggestions/gr-fix-suggestions.ts
+++ b/polygerrit-ui/app/elements/shared/gr-fix-suggestions/gr-fix-suggestions.ts
@@ -366,7 +366,7 @@
<md-checkbox
class="show-hide"
?checked=${this.collapsed}
- @click=${() => {
+ @change=${() => {
this.collapsed = !this.collapsed;
if (this.collapsed) {
this.reporting.reportInteraction(