Always show actions for the latest patch set
+ Since the patch set dropdown has moved to the file list and actions aren’t shown for older patch sets in the GWT UI, show actions for the latest patch set. This goes in line with previous changes to have the most recent patch set info be in the overview. Change-Id: I389260aed0abaead70115ee3cb085794d714af6e
This commit is contained in:
@@ -96,13 +96,12 @@ limitations under the License.
|
||||
hidden></gr-confirm-rebase-dialog>
|
||||
<gr-confirm-cherrypick-dialog id="confirmCherrypick"
|
||||
class="confirmDialog"
|
||||
commit-info="[[commitInfo]]"
|
||||
message="[[commitMessage]]"
|
||||
on-confirm="_handleCherrypickConfirm"
|
||||
on-cancel="_handleConfirmDialogCancel"
|
||||
hidden></gr-confirm-cherrypick-dialog>
|
||||
<gr-confirm-revert-dialog id="confirmRevertDialog"
|
||||
class="confirmDialog"
|
||||
commit-info="[[commitInfo]]"
|
||||
on-confirm="_handleRevertDialogConfirm"
|
||||
on-cancel="_handleConfirmDialogCancel"
|
||||
hidden></gr-confirm-revert-dialog>
|
||||
|
||||
@@ -75,7 +75,10 @@
|
||||
},
|
||||
changeNum: String,
|
||||
patchNum: String,
|
||||
commitInfo: Object,
|
||||
commitMessage: {
|
||||
type: String,
|
||||
value: '',
|
||||
},
|
||||
|
||||
_loading: {
|
||||
type: Boolean,
|
||||
@@ -274,7 +277,7 @@
|
||||
if (type === ActionType.REVISION) {
|
||||
this._handleRevisionAction(key);
|
||||
} else if (key === ChangeActions.REVERT) {
|
||||
this.$.confirmRevertDialog.populateRevertMessage();
|
||||
this.$.confirmRevertDialog.populateRevertMessage(this.commitMessage);
|
||||
this.$.confirmRevertDialog.message = this._modifyRevertMsg();
|
||||
this._showActionDialog(this.$.confirmRevertDialog);
|
||||
} else if (key === ChangeActions.ABANDON) {
|
||||
|
||||
@@ -226,8 +226,8 @@ limitations under the License.
|
||||
change="[[_change]]"
|
||||
actions="[[_change.actions]]"
|
||||
change-num="[[_changeNum]]"
|
||||
patch-num="[[_patchRange.patchNum]]"
|
||||
commit-info="[[_commitInfo]]"
|
||||
patch-num="[[_computeLatestPatchNum(_allPatchSets)]]"
|
||||
commit-message="[[_latestCommitMessage]]"
|
||||
on-reload-change="_handleReloadChange"></gr-change-actions>
|
||||
</div>
|
||||
<div class="commitAndRelated">
|
||||
|
||||
@@ -32,16 +32,6 @@
|
||||
properties: {
|
||||
branch: String,
|
||||
message: String,
|
||||
commitInfo: {
|
||||
type: Object,
|
||||
readOnly: true,
|
||||
observer: '_commitInfoChanged',
|
||||
},
|
||||
},
|
||||
|
||||
_commitInfoChanged: function(commitInfo) {
|
||||
// Pre-populate cherry-pick message for editing from commit info.
|
||||
this.message = commitInfo.message;
|
||||
},
|
||||
|
||||
_handleConfirmTap: function(e) {
|
||||
|
||||
@@ -30,14 +30,12 @@
|
||||
*/
|
||||
|
||||
properties: {
|
||||
branch: String,
|
||||
message: String,
|
||||
commitInfo: Object,
|
||||
},
|
||||
|
||||
populateRevertMessage: function() {
|
||||
populateRevertMessage: function(message) {
|
||||
// Figure out what the revert title should be.
|
||||
var originalTitle = this.commitInfo.message.split('\n')[0];
|
||||
var originalTitle = message.split('\n')[0];
|
||||
var revertTitle = 'Revert of ' + originalTitle;
|
||||
if (originalTitle.startsWith('Revert of ')) {
|
||||
revertTitle = 'Reland of ' +
|
||||
@@ -47,7 +45,7 @@
|
||||
originalTitle.substring('Reland of '.length);
|
||||
}
|
||||
// Add '> ' in front of the original commit text.
|
||||
var originalCommitText = this.commitInfo.message.replace(/^/gm, '> ');
|
||||
var originalCommitText = message.replace(/^/gm, '> ');
|
||||
|
||||
this.message = revertTitle + '\n\n' +
|
||||
'Reason for revert: <INSERT REASONING HERE>\n\n' +
|
||||
|
||||
@@ -40,9 +40,7 @@ limitations under the License.
|
||||
|
||||
test('single line', function() {
|
||||
assert.isNotOk(element.message);
|
||||
element.commitInfo = {message: 'one line commit'};
|
||||
assert.isNotOk(element.message);
|
||||
element.populateRevertMessage();
|
||||
element.populateRevertMessage('one line commit');
|
||||
var expected = 'Revert of one line commit\n\n' +
|
||||
'Reason for revert: <INSERT REASONING HERE>\n\n' +
|
||||
'Original issue\'s description:\n' +
|
||||
@@ -52,9 +50,7 @@ limitations under the License.
|
||||
|
||||
test('multi line', function() {
|
||||
assert.isNotOk(element.message);
|
||||
element.commitInfo = {message: 'many lines\ncommit\n\nmessage\n'};
|
||||
assert.isNotOk(element.message);
|
||||
element.populateRevertMessage();
|
||||
element.populateRevertMessage('many lines\ncommit\n\nmessage\n');
|
||||
var expected = 'Revert of many lines\n\n' +
|
||||
'Reason for revert: <INSERT REASONING HERE>\n\n' +
|
||||
'Original issue\'s description:\n' +
|
||||
|
||||
@@ -25,8 +25,6 @@ limitations under the License.
|
||||
var basePath = '../elements/';
|
||||
|
||||
[
|
||||
'change-list/gr-change-list-item/gr-change-list-item_test.html',
|
||||
'change-list/gr-change-list/gr-change-list_test.html',
|
||||
'change/gr-account-entry/gr-account-entry_test.html',
|
||||
'change/gr-account-list/gr-account-list_test.html',
|
||||
'change/gr-change-actions/gr-change-actions_test.html',
|
||||
@@ -34,6 +32,7 @@ limitations under the License.
|
||||
'change/gr-change-view/gr-change-view_test.html',
|
||||
'change/gr-comment-list/gr-comment-list_test.html',
|
||||
'change/gr-confirm-rebase-dialog/gr-confirm-rebase-dialog_test.html',
|
||||
'change/gr-confirm-revert-dialog/gr-confirm-revert-dialog_test.html',
|
||||
'change/gr-download-dialog/gr-download-dialog_test.html',
|
||||
'change/gr-file-list/gr-file-list_test.html',
|
||||
'change/gr-message/gr-message_test.html',
|
||||
@@ -41,13 +40,18 @@ limitations under the License.
|
||||
'change/gr-related-changes-list/gr-related-changes-list_test.html',
|
||||
'change/gr-reply-dialog/gr-reply-dialog_test.html',
|
||||
'change/gr-reviewer-list/gr-reviewer-list_test.html',
|
||||
'change-list/gr-change-list/gr-change-list_test.html',
|
||||
'change-list/gr-change-list-item/gr-change-list-item_test.html',
|
||||
'core/gr-account-dropdown/gr-account-dropdown_test.html',
|
||||
'core/gr-error-manager/gr-error-manager_test.html',
|
||||
'core/gr-main-header/gr-main-header_test.html',
|
||||
'core/gr-reporting/gr-reporting_test.html',
|
||||
'core/gr-search-bar/gr-search-bar_test.html',
|
||||
'diff/gr-diff/gr-diff-group_test.html',
|
||||
'diff/gr-diff/gr-diff_test.html',
|
||||
'diff/gr-diff-builder/gr-diff-builder_test.html',
|
||||
'diff/gr-diff-comment-thread/gr-diff-comment-thread_test.html',
|
||||
'diff/gr-diff-comment/gr-diff-comment_test.html',
|
||||
'diff/gr-diff-comment-thread/gr-diff-comment-thread_test.html',
|
||||
'diff/gr-diff-cursor/gr-diff-cursor_test.html',
|
||||
'diff/gr-diff-highlight/gr-annotation_test.html',
|
||||
'diff/gr-diff-highlight/gr-diff-highlight_test.html',
|
||||
@@ -55,8 +59,6 @@ limitations under the License.
|
||||
'diff/gr-diff-processor/gr-diff-processor_test.html',
|
||||
'diff/gr-diff-selection/gr-diff-selection_test.html',
|
||||
'diff/gr-diff-view/gr-diff-view_test.html',
|
||||
'diff/gr-diff/gr-diff-group_test.html',
|
||||
'diff/gr-diff/gr-diff_test.html',
|
||||
'diff/gr-patch-range-select/gr-patch-range-select_test.html',
|
||||
'diff/gr-ranged-comment-layer/gr-ranged-comment-layer_test.html',
|
||||
'diff/gr-selection-action-box/gr-selection-action-box_test.html',
|
||||
|
||||
Reference in New Issue
Block a user