Simplify call to navigate to change screen with patch set

Use

  Gerrit.display(PageLinks.toChange(psId));

instead of

  Gerrit.display(PageLinks.toChange(
      psId.getParentKey(),
      String.valueOf(psId.getId())));

Change-Id: I159532ef4844d7c18f7f3fd37a0b275590d41b1b
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2016-01-26 09:46:18 +01:00
parent cdcbb691fe
commit 6c8e2cbeca
4 changed files with 4 additions and 14 deletions

View File

@@ -77,9 +77,7 @@ public class Hashtags extends Composite {
@Override
public void onSuccess(JavaScriptObject result) {
if (screen.isCurrentView()) {
Gerrit.display(PageLinks.toChange(
psId.getParentKey(),
String.valueOf(psId.get())));
Gerrit.display(PageLinks.toChange(psId));
}
}
});

View File

@@ -21,7 +21,6 @@ import com.google.gerrit.client.info.ChangeInfo.CommitInfo;
import com.google.gerrit.client.info.GitwebInfo;
import com.google.gerrit.common.PageLinks;
import com.google.gerrit.reviewdb.client.Change;
import com.google.gerrit.reviewdb.client.PatchSet;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JsArray;
import com.google.gwt.core.client.Scheduler;
@@ -339,10 +338,7 @@ class RelatedChangesTab implements IsWidget {
private String url() {
if (info.hasChangeNumber() && info.hasRevisionNumber()) {
PatchSet.Id id = info.patchSetId();
return "#" + PageLinks.toChange(
id.getParentKey(),
id.getId());
return "#" + PageLinks.toChange(info.patchSetId());
}
GitwebInfo gw = Gerrit.info().gitweb();

View File

@@ -204,9 +204,7 @@ public class ReplyBox extends Composite {
.post(in, new GerritCallback<ReviewInput>() {
@Override
public void onSuccess(ReviewInput result) {
Gerrit.display(PageLinks.toChange(
psId.getParentKey(),
String.valueOf(psId.get())));
Gerrit.display(PageLinks.toChange(psId));
}
@Override
public void onFailure(final Throwable caught) {

View File

@@ -130,9 +130,7 @@ class Topic extends Composite {
new GerritCallback<String>() {
@Override
public void onSuccess(String result) {
Gerrit.display(PageLinks.toChange(
psId.getParentKey(),
String.valueOf(psId.get())));
Gerrit.display(PageLinks.toChange(psId));
}
});
onCancel(null);