Add config gerrit.primaryWeblinkName

Add gerrit.primaryWeblinkName to ServerInfo.
Lets the UI know which is the preferred weblink in instances were
only one weblink can be used, for example in inline links.

Change-Id: I01deaca3418d5c0486e3f5ebabf10827d47c3631
This commit is contained in:
Sven Selberg
2019-01-22 18:19:19 +01:00
committed by Sven Selberg
parent 6aecc2294e
commit e63e92d89e
3 changed files with 18 additions and 0 deletions

View File

@@ -2174,6 +2174,22 @@ Example:
installModule = com.example.abc.OurSpecialSauceModule
----
[[gerrit.primaryWeblinkName]]gerrit.primaryWeblinkName::
+
Name of the link:dev-plugins.html#links-to-external-tools[Weblink] that should
be chosen in cases where only one Weblink can be used in the UI, for example in
inline links.
+
By default unset, meaning that the UI is responsible for trying to identify
a weblink to be used in these cases, most likely weblinks that links to code
browsers with known integrations with Gerrit (like Gitiles and Gitweb).
+
Example:
----
[gerrit]
primaryWeblinkName = gitiles
----
[[gerrit.reportBugUrl]]gerrit.reportBugUrl::
+
URL to direct users to when they need to report a bug.

View File

@@ -26,4 +26,5 @@ public class GerritInfo {
public String reportBugUrl;
public String reportBugText;
public Set<UiType> webUis;
public String primaryWeblinkName;
}

View File

@@ -313,6 +313,7 @@ public class GetServerInfo implements RestReadView<ConfigResource> {
if (gerritOptions.enableGwtUi()) {
info.webUis.add(UiType.GWT);
}
info.primaryWeblinkName = config.getString("gerrit", null, "primaryWeblinkName");
return info;
}