Modernize URLs to be shorter and consistent
Instead of using http://site/#change,1234 we now use a slightly more common looking http://site/#/c/1234 URL to link to a change. It is also quite a bit shorter than the old format, using up less space in the address bar. Files within a patch set are now denoted below the change, as in http://site/#/c/1234/1/src/module/foo.c making it easier to jump directly to a specific file, or to just see the structure of the current view. Whenever possible the old URLs continue to work by redirecting to the equivalent new URL. We plan to keep the old URLs alive, as many issue tracking systems have direct links based on the old URL format and these links should not be invalidated. This change also fixes the dynamic redirects of http://site/1234 and http://site/r/deadbeef to jump directly to the corresponding change if there is exactly one possible URL. This avoids the ugly interim redirect to http://site/#/q/1234,n,z when the server can compute what the correct location should be on its own. Entities that have multiple views suffix the URL with ",view-name" to indicate which view the user wants to see. For files the default view is the side-by-side view and does not have a suffix, while the unified patch view has a suffix of ",unified", for example: http://site/#/c/1234/1/src/module/foo.c,unified. Project admin panels use a similar view suffix to denote which of the tabs on the left menu is currently open, with the main info tab being the default with no suffix. Change-Id: I2bac7ef1b2638fb08df2659b8373960eadec205a
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
package com.google.gerrit.client.changes;
|
||||
|
||||
import com.google.gerrit.client.Dispatcher;
|
||||
import com.google.gerrit.client.Gerrit;
|
||||
import com.google.gerrit.client.rpc.GerritCallback;
|
||||
import com.google.gerrit.client.rpc.ScreenLoadCallback;
|
||||
@@ -475,8 +476,7 @@ public class ChangeScreen extends Screen {
|
||||
@Override
|
||||
public void onKeyPress(final KeyPressEvent event) {
|
||||
PatchSet.Id currentPatchSetId = patchSetsBlock.getCurrentPatchSet().getId();
|
||||
Gerrit.display("change,publish," + currentPatchSetId.toString(),
|
||||
new PublishCommentScreen(currentPatchSetId));
|
||||
Gerrit.display(Dispatcher.toPublish(currentPatchSetId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user