Merge "Disable the change reply button until the server config has loaded"

This commit is contained in:
Wyatt Allen
2017-01-11 21:33:41 +00:00
committed by Gerrit Code Review
4 changed files with 18 additions and 4 deletions

View File

@@ -268,6 +268,7 @@ limitations under the License.
<gr-button
class="reply"
secondary
disabled="[[_replyDisabled]]"
on-tap="_handleReplyTap">[[_replyButtonLabel]]</gr-button>
<gr-change-actions id="actions"
change="[[_change]]"

View File

@@ -111,6 +111,11 @@
type: Boolean,
computed: '_computeDescriptionReadOnly(_loggedIn, _change, _account)',
},
_replyDisabled: {
type: Boolean,
value: true,
computed: '_computeReplyDisabled(serverConfig)',
},
},
behaviors: [
@@ -919,5 +924,7 @@
_computeDescriptionReadOnly: function(loggedIn, change, account) {
return !(loggedIn && (account._account_id === change.owner._account_id));
},
_computeReplyDisabled: function() { return false; }
});
})();

View File

@@ -781,5 +781,11 @@ limitations under the License.
assert.equal(element.$.replyDialog.quote, '> 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);
});
});
</script>