Rebase button should be always enabled.

Bug: Issue 3973
Change-Id: Ie70744d262925f2cc2face9d866b230a56a98537
This commit is contained in:
Viktar Donich
2016-04-25 14:51:42 -07:00
parent 3b2f25a18b
commit f9584e28cb
2 changed files with 23 additions and 1 deletions

View File

@@ -301,7 +301,14 @@
getChangeRevisionActions: function(changeNum, patchNum) {
return this.fetchJSON(
this.getChangeActionURL(changeNum, patchNum, '/actions'));
this.getChangeActionURL(changeNum, patchNum, '/actions')).then(
function(revisionActions) {
// The rebase button on change screen is always enabled.
if (revisionActions.rebase) {
revisionActions.rebase.enabled = true;
}
return revisionActions;
});
},
getReviewedFiles: function(changeNum, patchNum) {

View File

@@ -222,5 +222,20 @@ limitations under the License.
element._specialFilePathCompare),
['foo/bar.h', 'foo/bar.hpp', 'foo/bar.hxx']);
});
test('rebase always enabled', function(done) {
var resolveFetchJSON;
var fetchJSONStub = sinon.stub(element, 'fetchJSON').returns(
new Promise(function(resolve) {
resolveFetchJSON = resolve;
}));
element.getChangeRevisionActions('42', '1337').then(
function(response) {
assert.isTrue(response.rebase.enabled);
fetchJSONStub.restore();
done();
});
resolveFetchJSON({rebase:{}});
});
});
</script>