From 1acfed3372a15782a3afea9b68cb77c88d403d82 Mon Sep 17 00:00:00 2001 From: Wyatt Allen Date: Wed, 11 Jan 2017 11:12:12 -0800 Subject: [PATCH] Disable the change reply button until the server config has loaded Because the reply dialog depends on the server config to know whether to display the CC list, await the config load before enabling the button. Bug: Issue 5244 Change-Id: Id2ebb86f54f398c7ab3a40f78774531770b31099 --- .../elements/change/gr-change-view/gr-change-view.html | 1 + .../app/elements/change/gr-change-view/gr-change-view.js | 7 +++++++ .../change/gr-change-view/gr-change-view_test.html | 6 ++++++ .../app/elements/shared/gr-button/gr-button.html | 8 ++++---- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html index ef64f980de..8917a46ff7 100644 --- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html +++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.html @@ -268,6 +268,7 @@ limitations under the License. [[_replyButtonLabel]] quote text\n\n'); }); }); + + test('reply button is disabled until server config is loaded', function() { + assert.isTrue(element._replyDisabled); + element.serverConfig = {}; + assert.isFalse(element._replyDisabled); + }); }); diff --git a/polygerrit-ui/app/elements/shared/gr-button/gr-button.html b/polygerrit-ui/app/elements/shared/gr-button/gr-button.html index 3bcb50e870..5c123810f8 100644 --- a/polygerrit-ui/app/elements/shared/gr-button/gr-button.html +++ b/polygerrit-ui/app/elements/shared/gr-button/gr-button.html @@ -80,8 +80,8 @@ limitations under the License. :host([loading][disabled]) { cursor: wait; } - :host(:focus:not([primary]):not([secondary])), - :host(:hover:not([primary]):not([secondary])) { + :host(:focus:not([primary]):not([secondary]):not([disabled])), + :host(:hover:not([primary]):not([secondary]):not([disabled])) { background-color: #f8f8f8; border-color: #aaa; } @@ -98,7 +98,7 @@ limitations under the License. :host([primary]:focus) { box-shadow: 0 0 1px #00f; } - :host([primary]:hover) { + :host([primary]:not([disabled]):hover) { background-color: #4d90fe; border-color: #00F; } @@ -112,7 +112,7 @@ limitations under the License. :host([secondary]:focus) { box-shadow: 0 0 1px #f00; } - :host([secondary]:hover) { + :host([secondary]:not([disabled]):hover) { background-color: #c53727; border: 1px solid #b0281a; }