Expose GitWeb config via /config/server/info REST endpoint
In the Gerrit Client retrieve the GitWeb configuration via REST and remove the GitWeb configuration from the config that is embedded in the host page data. In order to provide the GitWeb configuration from the REST endpoint the GitWeb configuration must be bound in the sysinjector (the binding of the GitWebModule stays in the webinjector). Change-Id: I640e645f6c9a72d5539f33e28721f0cff93e732d Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
committed by
David Pursehouse
parent
e55a72f504
commit
7023f47c4b
@@ -16,13 +16,13 @@ package com.google.gerrit.client.diff;
|
||||
|
||||
import com.google.gerrit.client.Dispatcher;
|
||||
import com.google.gerrit.client.Gerrit;
|
||||
import com.google.gerrit.client.GitwebLink;
|
||||
import com.google.gerrit.client.WebLinkInfo;
|
||||
import com.google.gerrit.client.changes.ChangeApi;
|
||||
import com.google.gerrit.client.changes.ChangeInfo;
|
||||
import com.google.gerrit.client.changes.ChangeInfo.RevisionInfo;
|
||||
import com.google.gerrit.client.changes.ReviewInfo;
|
||||
import com.google.gerrit.client.changes.Util;
|
||||
import com.google.gerrit.client.config.GitWebInfo;
|
||||
import com.google.gerrit.client.diff.DiffInfo.Region;
|
||||
import com.google.gerrit.client.patches.PatchUtil;
|
||||
import com.google.gerrit.client.rpc.CallbackGroup;
|
||||
@@ -115,7 +115,8 @@ public class Header extends Composite {
|
||||
return b.append(Util.C.commitMessage());
|
||||
}
|
||||
|
||||
GitwebLink gw = (project != null && commit != null) ? Gerrit.getGitwebLink() : null;
|
||||
GitWebInfo gw = (project != null && commit != null)
|
||||
? Gerrit.info().gitWeb() : null;
|
||||
int s = path.lastIndexOf('/') + 1;
|
||||
if (gw != null && s > 0) {
|
||||
String base = path.substring(0, s - 1);
|
||||
@@ -192,7 +193,7 @@ public class Header extends Composite {
|
||||
}
|
||||
|
||||
void setChangeInfo(ChangeInfo info) {
|
||||
GitwebLink gw = Gerrit.getGitwebLink();
|
||||
GitWebInfo gw = Gerrit.info().gitWeb();
|
||||
if (gw != null) {
|
||||
for (RevisionInfo rev : Natives.asList(info.revisions().values())) {
|
||||
if (patchSetId.getId().equals(rev.id())) {
|
||||
|
||||
Reference in New Issue
Block a user