From 0d80c7db9385e001ffa564b27960b3eb58c5f7d4 Mon Sep 17 00:00:00 2001 From: Dmitrii Filippov Date: Wed, 18 Mar 2020 15:43:56 +0100 Subject: [PATCH] Add reviewers column to dashboard Enable the reviewers column only when the attention set feature is enabled. We want to roll this out as part of the attention set. Screenshots: Before: https://imgur.com/a/EGAHRPy After: https://imgur.com/a/UtBc8H6 Change-Id: Iebaa8387df630b7ecac93b4586f1e8a49990baf5 --- plugins/download-commands | 2 +- .../gr-change-table-behavior.js | 2 + .../gr-change-table-behavior_test.html | 2 + .../gr-change-list-item_html.js | 14 ++- .../gr-change-list-item_test.html | 2 + .../gr-change-list/gr-change-list_test.html | 2 + .../gr-dashboard-view/gr-dashboard-view.js | 10 +- .../gr-dashboard-view_test.html | 10 +- .../gr-change-table-editor_test.html | 1 + .../gr-account-label/gr-account-label.js | 4 + .../gr-account-label/gr-account-label_html.js | 6 +- .../shared/gr-account-link/gr-account-link.js | 8 ++ .../gr-account-link/gr-account-link_html.js | 6 +- .../gr-rest-api-interface.js | 101 ++++++++++-------- .../gr-rest-api-interface_test.html | 5 +- .../app/styles/gr-change-list-styles.js | 6 +- 16 files changed, 114 insertions(+), 67 deletions(-) diff --git a/plugins/download-commands b/plugins/download-commands index 47b783ea75..e26ed31aaf 160000 --- a/plugins/download-commands +++ b/plugins/download-commands @@ -1 +1 @@ -Subproject commit 47b783ea75036664dd591d2d3f1bcd06b68cdd5e +Subproject commit e26ed31aaf070ff884e96b9a09d39c20437de6cb diff --git a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.js b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.js index d3fc1cce0a..67b8c4a7a0 100644 --- a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.js +++ b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior.js @@ -29,6 +29,7 @@ 'Status', 'Owner', 'Assignee', + 'Reviewers', 'Comments', 'Repo', 'Branch', @@ -74,6 +75,7 @@ isColumnEnabled(column, config, experiments) { if (!config || !config.change) return true; if (column === 'Comments') return experiments.includes('comments-column'); + if (column === 'Reviewers') return !!config.change.enable_attention_set; return true; }, diff --git a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html index 4a6df997ac..8036ff0686 100644 --- a/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html +++ b/polygerrit-ui/app/behaviors/gr-change-table-behavior/gr-change-table-behavior_test.html @@ -65,6 +65,7 @@ suite('gr-change-table-behavior tests', () => { 'Status', 'Owner', 'Assignee', + 'Reviewers', 'Comments', 'Repo', 'Branch', @@ -77,6 +78,7 @@ suite('gr-change-table-behavior tests', () => { 'Subject', 'Status', 'Assignee', + 'Reviewers', 'Comments', 'Repo', 'Branch', diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_html.js b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_html.js index 67c1f214a6..aed0077cd5 100644 --- a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_html.js +++ b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_html.js @@ -52,7 +52,8 @@ export const htmlTemplate = html` white-space: nowrap; width: 100%; } - .comments { + .comments, + .reviewers { white-space: nowrap; } .spacer { @@ -104,6 +105,9 @@ export const htmlTemplate = html` .cell.label { font-weight: var(--font-weight-normal); } + .lastChildHidden:last-of-type { + display: none; + } @media only screen and (max-width: 50em) { :host { display: flex; @@ -153,6 +157,14 @@ export const htmlTemplate = html` -- + +
+ +
+ [[_computeComments(change.unresolved_comment_count)]] diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_test.html b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_test.html index 040be28c51..b1479b6800 100644 --- a/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_test.html +++ b/polygerrit-ui/app/elements/change-list/gr-change-list-item/gr-change-list-item_test.html @@ -124,6 +124,7 @@ suite('gr-change-list-item tests', () => { 'Status', 'Owner', 'Assignee', + 'Reviewers', 'Comments', 'Repo', 'Branch', @@ -149,6 +150,7 @@ suite('gr-change-list-item tests', () => { 'Status', 'Owner', 'Assignee', + 'Reviewers', 'Comments', 'Branch', 'Updated', diff --git a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html index da37da762e..3bc703205a 100644 --- a/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html +++ b/polygerrit-ui/app/elements/change-list/gr-change-list/gr-change-list_test.html @@ -371,6 +371,7 @@ suite('gr-change-list basic tests', () => { 'Status', 'Owner', 'Assignee', + 'Reviewers', 'Comments', 'Repo', 'Branch', @@ -408,6 +409,7 @@ suite('gr-change-list basic tests', () => { 'Status', 'Owner', 'Assignee', + 'Reviewers', 'Comments', 'Branch', 'Updated', diff --git a/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view.js b/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view.js index 2c023752fa..fabcdaddac 100644 --- a/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view.js +++ b/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view.js @@ -105,14 +105,6 @@ class GrDashboardView extends mixinBehaviors( [ ]; } - get options() { - return this.listChangesOptionsToHex( - this.ListChangesOption.LABELS, - this.ListChangesOption.DETAILED_ACCOUNTS, - this.ListChangesOption.REVIEWED - ); - } - /** @override */ attached() { super.attached(); @@ -240,7 +232,7 @@ class GrDashboardView extends mixinBehaviors( [ queries.push('owner:self limit:1'); } - return this.$.restAPI.getChanges(null, queries, null, this.options) + return this.$.restAPI.getChanges(null, queries) .then(changes => { if (checkForNewUser) { // Last set of results is not meant for dashboard display. diff --git a/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view_test.html b/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view_test.html index 8a0cfa0170..f94c896cf4 100644 --- a/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view_test.html +++ b/polygerrit-ui/app/elements/change-list/gr-dashboard-view/gr-dashboard-view_test.html @@ -206,8 +206,7 @@ suite('gr-dashboard-view tests', () => { }; return paramsChangedPromise.then(() => { assert.isTrue( - getChangesStub.calledWith( - null, ['1', '2', 'owner:self limit:1'], null, element.options)); + getChangesStub.calledWith(null, ['1', '2', 'owner:self limit:1'])); }); }); @@ -221,9 +220,7 @@ suite('gr-dashboard-view tests', () => { user: 'user', }; return paramsChangedPromise.then(() => { - assert.isTrue( - getChangesStub.calledWith( - null, ['1'], null, element.options)); + assert.isTrue(getChangesStub.calledWith(null, ['1'])); }); }); }); @@ -239,8 +236,7 @@ suite('gr-dashboard-view tests', () => { return paramsChangedPromise.then(() => { assert.isTrue(getChangesStub.calledOnce); assert.deepEqual( - getChangesStub.firstCall.args, - [null, ['1', '2 suffix'], null, element.options]); + getChangesStub.firstCall.args, [null, ['1', '2 suffix']]); }); }); diff --git a/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor_test.html b/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor_test.html index 7457935abd..919be86438 100644 --- a/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor_test.html +++ b/polygerrit-ui/app/elements/settings/gr-change-table-editor/gr-change-table-editor_test.html @@ -47,6 +47,7 @@ suite('gr-change-table-editor tests', () => { 'Status', 'Owner', 'Assignee', + 'Reviewers', 'Comments', 'Repo', 'Branch', diff --git a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.js b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.js index 145a2cc2be..103c903eaa 100644 --- a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.js +++ b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label.js @@ -54,6 +54,10 @@ class GrAccountLabel extends mixinBehaviors( [ type: Boolean, value: false, }, + hideStatus: { + type: Boolean, + value: false, + }, _serverConfig: { type: Object, value: null, diff --git a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_html.js b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_html.js index a7d01ae9ac..af2783c256 100644 --- a/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_html.js +++ b/polygerrit-ui/app/elements/shared/gr-account-label/gr-account-label_html.js @@ -51,8 +51,10 @@ export const htmlTemplate = html` [[_computeName(account, _serverConfig)]] -