SubmittedTogether: don't show tab on outdated revisions

The submitted_together REST API change endpoint has been implemented
as a change endpoint by mistake; It would have been better as a
revision endpoint.

As outdated revisions are not able to be submitted, do not show
the submitted together tab in the UI.

Tested locally.

Change-Id: I172154c995341cb44bd3780f9f38bb099543a0fe
Signed-off-by: Stefan Beller <sbeller@google.com>
This commit is contained in:
Stefan Beller
2016-08-15 17:24:23 -07:00
parent b68b74dba2
commit 95f7a46b7c

View File

@@ -215,10 +215,11 @@ public class RelatedChanges extends TabPanel {
EnumSet.of(ListChangesOption.CURRENT_REVISION, ListChangesOption.CURRENT_COMMIT),
new TabChangeListCallback(Tab.CHERRY_PICKS, info.project(), revision));
// TODO(sbeller): show only on latest revision
ChangeApi.change(info.legacyId().get()).view("submitted_together")
.get(new TabChangeListCallback(Tab.SUBMITTED_TOGETHER,
info.project(), revision));
if (info.currentRevision().equals(revision)) {
ChangeApi.change(info.legacyId().get()).view("submitted_together")
.get(new TabChangeListCallback(Tab.SUBMITTED_TOGETHER,
info.project(), revision));
}
if (!Gerrit.info().change().isSubmitWholeTopicEnabled()
&& info.topic() != null && !"".equals(info.topic())) {