summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn Pearce <sop@google.com>2013-07-05 18:55:24 -0700
committerShawn Pearce <sop@google.com>2013-07-05 18:55:24 -0700
commitb85c70efc7c1db93a7a64cb8bbbce7b23a01649b (patch)
tree82f377b0be687306a2cc149b9343332ee37b526c
parente4a159d37110eb4e57c95ddc51c171ac2bad3477 (diff)
parent6ad00aa21bcf16caddd3398dfc5cdfb13f8ea781 (diff)
Merge branch 'stable-2.6' into stable-2.7
* stable-2.6: Fix: NullPointerException of dashboard title Properly handle double click on external group in GroupTable Add plugin repositories section in the pom PrettyFormatter: Fix expand tab when syntax coloring is on.
-rw-r--r--gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java15
-rw-r--r--gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java5
-rw-r--r--gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java3
-rw-r--r--gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java3
4 files changed, 18 insertions, 8 deletions
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java
index 76a0cfb23a..de840813b6 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupTable.java
@@ -29,6 +29,7 @@ import com.google.gerrit.common.PageLinks;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter;
import com.google.gwt.user.client.ui.HTMLTable.Cell;
@@ -77,7 +78,12 @@ public class GroupTable extends NavigationTable<GroupInfo> {
@Override
protected void onOpenRow(final int row) {
- History.newItem(Dispatcher.toGroup(getRowItem(row).getGroupId()));
+ GroupInfo groupInfo = getRowItem(row);
+ if (isInteralGroup(groupInfo)) {
+ History.newItem(Dispatcher.toGroup(groupInfo.getGroupId()));
+ } else if (groupInfo.url() != null) {
+ Window.open(groupInfo.url(), "_self", null);
+ }
}
public void display(GroupMap groups, String toHighlight) {
@@ -108,7 +114,7 @@ public class GroupTable extends NavigationTable<GroupInfo> {
void populate(final int row, final GroupInfo k, final String toHighlight) {
if (k.url() != null) {
- if (k.url().startsWith("#" + PageLinks.ADMIN_GROUPS)) {
+ if (isInteralGroup(k)) {
table.setWidget(row, 1, new HighlightingInlineHyperlink(k.name(),
Dispatcher.toGroup(k.getGroupId()), toHighlight));
} else {
@@ -133,4 +139,9 @@ public class GroupTable extends NavigationTable<GroupInfo> {
setRowItem(row, k);
}
+
+ private boolean isInteralGroup(final GroupInfo groupInfo) {
+ return groupInfo != null
+ && groupInfo.url().startsWith("#" + PageLinks.ADMIN_GROUPS);
+ }
}
diff --git a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java
index 9f76a4730e..8e7c699159 100644
--- a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java
+++ b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/ClientSideFormatter.java
@@ -60,13 +60,12 @@ public class ClientSideFormatter extends PrettyFormatter {
@Override
protected String prettify(String html, String type) {
- return go(prettify.getContext(), html, type, diffPrefs.getTabSize());
+ return go(prettify.getContext(), html, type);
}
private static native String go(JavaScriptObject ctx, String srcText,
- String srcType, int tabSize)
+ String srcType)
/*-{
- ctx.PR_TAB_WIDTH = tabSize;
return ctx.prettyPrintOne(srcText, srcType);
}-*/;
}
diff --git a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java
index d9d43a83f3..a84af5ee02 100644
--- a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java
+++ b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/client/PrettyFormatter.java
@@ -129,6 +129,7 @@ public abstract class PrettyFormatter implements SparseHtmlFile {
String html = toHTML(src);
+ html = expandTabs(html);
if (diffPrefs.isSyntaxHighlighting() && getFileType() != null
&& src.isWholeFile()) {
// The prettify parsers don't like &#39; as an entity for the
@@ -149,8 +150,6 @@ public abstract class PrettyFormatter implements SparseHtmlFile {
html = html.replaceAll("(\r)?\n", " $1\n");
html = prettify(html, getFileType());
html = html.replaceAll(" (\r)?\n", "$1\n");
- } else {
- html = expandTabs(html);
}
int pos = 0;
diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java b/gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java
index a50e71c0fd..6e5ef65464 100644
--- a/gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java
+++ b/gerrit-server/src/main/java/com/google/gerrit/server/project/DashboardsCollection.java
@@ -160,7 +160,8 @@ class DashboardsCollection implements
DashboardInfo info = new DashboardInfo(refName, path);
info.project = project;
info.definingProject = definingProject.getName();
- info.title = replace(project, config.getString("dashboard", null, "title"));
+ String query = config.getString("dashboard", null, "title");
+ info.title = replace(project, query == null ? info.path : query);
info.description = replace(project, config.getString("dashboard", null, "description"));
info.foreach = config.getString("dashboard", null, "foreach");