ChangeScreen2: Add missing action titles

Some of the action buttons on the ChangeScreen2 did not
have titles.  Add them.

Also make the titles consistent in usage of capitalisation.

Change-Id: Ibcf90fc45202a5081bfe4b348a05443eb1a6584b
This commit is contained in:
David Pursehouse
2013-09-30 18:52:04 +09:00
committed by Shawn Pearce
parent bb669d9ae3
commit e0d77c1925
7 changed files with 7 additions and 4 deletions

View File

@@ -134,6 +134,7 @@ public class Abandon implements RestModifyView<ChangeResource, Input>,
public UiAction.Description getDescription(ChangeResource resource) { public UiAction.Description getDescription(ChangeResource resource) {
return new UiAction.Description() return new UiAction.Description()
.setLabel("Abandon") .setLabel("Abandon")
.setTitle("Abandon the change")
.setVisible(resource.getChange().getStatus().isOpen() .setVisible(resource.getChange().getStatus().isOpen()
&& resource.getControl().canAbandon()); && resource.getControl().canAbandon());
} }

View File

@@ -83,7 +83,7 @@ public class DeleteDraftChange implements
public UiAction.Description getDescription(ChangeResource rsrc) { public UiAction.Description getDescription(ChangeResource rsrc) {
try { try {
return new UiAction.Description() return new UiAction.Description()
.setTitle(String.format("Delete Draft Change %d", .setTitle(String.format("Delete draft change %d",
rsrc.getChange().getChangeId())) rsrc.getChange().getChangeId()))
.setVisible(rsrc.getChange().getStatus() == Status.DRAFT .setVisible(rsrc.getChange().getStatus() == Status.DRAFT
&& rsrc.getControl().canDeleteDraft(dbProvider.get())); && rsrc.getControl().canDeleteDraft(dbProvider.get()));

View File

@@ -91,7 +91,7 @@ public class DeleteDraftPatchSet implements RestModifyView<RevisionResource, Inp
int psCount = dbProvider.get().patchSets() int psCount = dbProvider.get().patchSets()
.byChange(rsrc.getChange().getId()).toList().size(); .byChange(rsrc.getChange().getId()).toList().size();
return new UiAction.Description() return new UiAction.Description()
.setTitle(String.format("Delete Draft Revision %d", .setTitle(String.format("Delete draft revision %d",
rsrc.getPatchSet().getPatchSetId())) rsrc.getPatchSet().getPatchSetId()))
.setVisible(rsrc.getPatchSet().isDraft() .setVisible(rsrc.getPatchSet().isDraft()
&& rsrc.getControl().canDeleteDraft(dbProvider.get()) && rsrc.getControl().canDeleteDraft(dbProvider.get())

View File

@@ -122,7 +122,7 @@ public class Publish implements RestModifyView<RevisionResource, Input>,
PatchSet.Id current = rsrc.getChange().currentPatchSetId(); PatchSet.Id current = rsrc.getChange().currentPatchSetId();
try { try {
return new UiAction.Description() return new UiAction.Description()
.setTitle(String.format("Publish Revision %d", .setTitle(String.format("Publish revision %d",
rsrc.getPatchSet().getPatchSetId())) rsrc.getPatchSet().getPatchSetId()))
.setVisible(rsrc.getPatchSet().isDraft() .setVisible(rsrc.getPatchSet().isDraft()
&& rsrc.getPatchSet().getId().equals(current) && rsrc.getPatchSet().getId().equals(current)

View File

@@ -133,6 +133,7 @@ public class Restore implements RestModifyView<ChangeResource, Input>,
public UiAction.Description getDescription(ChangeResource resource) { public UiAction.Description getDescription(ChangeResource resource) {
return new UiAction.Description() return new UiAction.Description()
.setLabel("Restore") .setLabel("Restore")
.setTitle("Restore the change")
.setVisible(resource.getChange().getStatus() == Status.ABANDONED .setVisible(resource.getChange().getStatus() == Status.ABANDONED
&& resource.getControl().canRestore()); && resource.getControl().canRestore());
} }

View File

@@ -113,6 +113,7 @@ public class Revert implements RestModifyView<ChangeResource, Input>,
public UiAction.Description getDescription(ChangeResource resource) { public UiAction.Description getDescription(ChangeResource resource) {
return new UiAction.Description() return new UiAction.Description()
.setLabel("Revert") .setLabel("Revert")
.setTitle("Revert the change")
.setVisible(resource.getChange().getStatus() == Status.MERGED .setVisible(resource.getChange().getStatus() == Status.MERGED
&& resource.getControl().getRefControl().canUpload()); && resource.getControl().getRefControl().canUpload());
} }

View File

@@ -147,7 +147,7 @@ public class Submit implements RestModifyView<RevisionResource, Input>,
PatchSet.Id current = resource.getChange().currentPatchSetId(); PatchSet.Id current = resource.getChange().currentPatchSetId();
return new UiAction.Description() return new UiAction.Description()
.setTitle(String.format( .setTitle(String.format(
"Submit Revision %d", "Submit revision %d",
resource.getPatchSet().getPatchSetId())) resource.getPatchSet().getPatchSetId()))
.setVisible(resource.getChange().getStatus().isOpen() .setVisible(resource.getChange().getStatus().isOpen()
&& resource.getPatchSet().getId().equals(current) && resource.getPatchSet().getId().equals(current)