Merge "Add PG UI support for new changes with base commit"

This commit is contained in:
David Pursehouse
2018-05-07 05:20:50 +00:00
committed by Gerrit Code Review
3 changed files with 17 additions and 2 deletions

View File

@@ -72,6 +72,17 @@ limitations under the License.
</gr-autocomplete>
</span>
</section>
<section class$="[[_computeBranchClass(baseChange)]]">
<span class="title">Provide base commit sha1 for change</span>
<span class="value">
<input
is="iron-input"
id="baseCommitInput"
maxlength="40"
placeholder="(optional)"
bind-value="{{baseCommit}}">
</span>
</section>
<section>
<span class="title">Enter topic for new change</span>
<span class="value">

View File

@@ -37,6 +37,7 @@
},
},
baseChange: String,
baseCommit: String,
privateByDefault: String,
canCreate: {
type: Boolean,
@@ -73,7 +74,8 @@
const isPrivate = this.$.privateChangeCheckBox.checked;
const isWip = true;
return this.$.restAPI.createChange(this.repoName, this.branch,
this.subject, this.topic, isPrivate, isWip, this.baseChange)
this.subject, this.topic, isPrivate, isWip, this.baseChange,
this.baseCommit)
.then(changeCreated => {
if (!changeCreated) { return; }
Gerrit.Nav.navigateToChange(changeCreated);

View File

@@ -1410,9 +1410,10 @@
* @param {boolean=} opt_isPrivate
* @param {boolean=} opt_workInProgress
* @param {string=} opt_baseChange
* @param {string=} opt_baseCommit
*/
createChange(project, branch, subject, opt_topic, opt_isPrivate,
opt_workInProgress, opt_baseChange) {
opt_workInProgress, opt_baseChange, opt_baseCommit) {
return this.send('POST', '/changes/', {
project,
branch,
@@ -1421,6 +1422,7 @@
is_private: opt_isPrivate,
work_in_progress: opt_workInProgress,
base_change: opt_baseChange,
base_commit: opt_baseCommit,
}).then(response => this.getResponseObject(response));
},