ChangeScreen2: Display currently viewed patch set in Revisions title
Change-Id: Ib9a203d86a1662769934f51458f59e2cccb3cd7f Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -159,6 +159,7 @@ public class ChangeScreen2 extends Screen {
|
||||
|
||||
@UiField Button includedIn;
|
||||
@UiField Button revisions;
|
||||
@UiField Element revisionsText;
|
||||
@UiField Button download;
|
||||
@UiField Button reply;
|
||||
@UiField Button expandAll;
|
||||
@@ -326,6 +327,18 @@ public class ChangeScreen2 extends Screen {
|
||||
}
|
||||
|
||||
private void initRevisionsAction(ChangeInfo info, String revision) {
|
||||
int currentPatchSet;
|
||||
if (info.current_revision() != null
|
||||
&& info.revisions().containsKey(info.current_revision())) {
|
||||
currentPatchSet = info.revision(info.current_revision())._number();
|
||||
} else {
|
||||
JsArray<RevisionInfo> revList = info.revisions().values();
|
||||
RevisionInfo.sortRevisionInfoByNumber(revList);
|
||||
currentPatchSet = revList.get(revList.length() - 1)._number();
|
||||
}
|
||||
int currentlyViewedPatchSet = info.revision(revision)._number();
|
||||
revisionsText.setInnerText(Resources.M.revisions(
|
||||
currentlyViewedPatchSet, currentPatchSet));
|
||||
revisionsAction = new RevisionsAction(
|
||||
info.legacy_id(), revision,
|
||||
style, headerLine, revisions);
|
||||
|
||||
@@ -359,7 +359,7 @@ limitations under the License.
|
||||
<div><ui:msg>Included in</ui:msg></div>
|
||||
</g:Button>
|
||||
<g:Button ui:field='revisions' styleName=''>
|
||||
<div><ui:msg>Revisions</ui:msg></div>
|
||||
<div ui:field='revisionsText'/>
|
||||
</g:Button>
|
||||
<g:Button ui:field='download' styleName=''>
|
||||
<div><ui:msg>Download</ui:msg></div>
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
package com.google.gerrit.client.change;
|
||||
|
||||
public interface Messages extends com.google.gwt.i18n.client.Messages {
|
||||
String revisions(int currentlyViewedPatchSet, int currentPatchSet);
|
||||
String changeWithNoRevisions(int changeId);
|
||||
String relatedChanges(int count);
|
||||
String relatedChanges(String count);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
revisions = Revisions ({0}/{1})
|
||||
changeWithNoRevisions = Cannot display change {0} because it has no revisions.
|
||||
relatedChanges = Related Changes ({0})
|
||||
conflictingChanges = Conflicts With ({0})
|
||||
|
||||
Reference in New Issue
Block a user