Add cherry-pick action
When cherry pick was successful, open new created change. To implement
the URL computation, existing method _computeChangePath() was moved
from change view to REST client behaviour to reuse from change action
element.
TODOs:
- implement branch name suggestion oracle
- improve error handling when branch or message is missing (alert)
- improve error handling when conflict occurs (409)
- improve error handling when branch doesn't exist (400)
Test Plan:
1. Open a change
2. Click Cherry Pick button
3. Type destination branch and click confirm button
4. Confirm, that the change cherry-picked and new change is opened
Bug: Issue 3906
Change-Id: I587f541dbc3338dc138f306c400f5f8857fd16a3
diff --git a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
index a42a379..b76b3c4 100644
--- a/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
+++ b/polygerrit-ui/app/elements/change/gr-change-view/gr-change-view.js
@@ -116,10 +116,10 @@
var currentPatchNum =
this._change.revisions[this._change.current_revision]._number;
if (patchNum == currentPatchNum) {
- page.show(this._computeChangePath(this._changeNum));
+ page.show(this.changePath(this._changeNum));
return;
}
- page.show(this._computeChangePath(this._changeNum) + '/' + patchNum);
+ page.show(this.changePath(this._changeNum) + '/' + patchNum);
},
_handleReplyTap: function(e) {
@@ -206,10 +206,6 @@
this.fire('title-change', {title: title});
},
- _computeChangePath: function(changeNum) {
- return '/c/' + changeNum;
- },
-
_computeChangePermalink: function(changeNum) {
return '/' + changeNum;
},
@@ -321,7 +317,7 @@
},
_handleReloadChange: function() {
- page.show(this._computeChangePath(this._changeNum));
+ page.show(this.changePath(this._changeNum));
},
_reload: function() {