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:
@@ -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));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user