From a7417cf75d68689ea0bc275f0062fc90d7a5afd1 Mon Sep 17 00:00:00 2001 From: Arnaud Fabre Date: Sat, 29 Jun 2013 23:41:01 +0200 Subject: PrettyFormatter: Fix expand tab when syntax coloring is on. prettify lost support for expanding tabs in r143 [1]. As a consequence, tab width preference is no longer honored. Gerrit now handles expanding tabs by itself in all cases, even if syntax coloring is active. [1] http://code.google.com/p/google-code-prettify/source/detail?r=143 Bug: issue 1872 Change-Id: I283a3620b1d130d3f66e56d3f202a5122d7a73b8 --- .../java/com/google/gerrit/prettify/client/ClientSideFormatter.java | 5 ++--- .../main/java/com/google/gerrit/prettify/common/PrettyFormatter.java | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) 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 1436bba860..8d5ddb9000 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 @@ -62,13 +62,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/common/PrettyFormatter.java b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/common/PrettyFormatter.java index d07a34da79..5786e9587a 100644 --- a/gerrit-prettify/src/main/java/com/google/gerrit/prettify/common/PrettyFormatter.java +++ b/gerrit-prettify/src/main/java/com/google/gerrit/prettify/common/PrettyFormatter.java @@ -128,6 +128,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 ' as an entity for the @@ -148,8 +149,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; -- cgit v1.2.3 From 6eb69e631b70aca2ea72ad8a03fd90eb0bc2eea3 Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Fri, 12 Apr 2013 12:11:18 +0900 Subject: Add plugin repositories section in the pom Without this section in the pom, the Eclipse build of gerrit-gwtexpui fails: Project build error: Unresolveable build extension: Plugin com.googlesource.gerrit:gs-maven- wagon:3.3 or one of its dependencies could not be resolved: Failure to find com.googlesource.gerrit:gs-maven-wagon:jar:3.3 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced Change-Id: I0fa4b97ae653fbe757ebcfbbab153f22d87b07bb (cherry picked from commit 475fc60b87a9cb741ebcf8cb8e16ec41a5fc05e1) --- pom.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pom.xml b/pom.xml index fec2fc8286..df0096ded9 100644 --- a/pom.xml +++ b/pom.xml @@ -893,6 +893,13 @@ limitations under the License. + + + gerrit-maven + https://gerrit-maven.commondatastorage.googleapis.com + + + gerrit-maven -- cgit v1.2.3 From 1860572b470a52836a2c86ff28485d69d807fb73 Mon Sep 17 00:00:00 2001 From: Dariusz Luksza Date: Tue, 2 Jul 2013 11:43:49 +0200 Subject: Properly handle double click on external group in GroupTable Previously double click action on row with external group result in "Undefined group exception" because Gerrit trys to load internal group screen for this group. Now we will discover external groups and use external group URL (if provided) to forward user to external system same as we do on single click. Change-Id: I3636d6af306d5eebf48dc76ca66662271d378f10 Signed-off-by: Dariusz Luksza --- .../java/com/google/gerrit/client/admin/GroupTable.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 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 { @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 { 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 { setRowItem(row, k); } + + private boolean isInteralGroup(final GroupInfo groupInfo) { + return groupInfo != null + && groupInfo.url().startsWith("#" + PageLinks.ADMIN_GROUPS); + } } -- cgit v1.2.3 From 953936649929c7ebe52a19abf0e84fd812b4c1e0 Mon Sep 17 00:00:00 2001 From: Bruce Zu Date: Mon, 1 Jul 2013 14:59:44 +0800 Subject: Fix: NullPointerException of dashboard title Fixed according to the Document about dashboard.title: "If not specified the path of the dashboard config file is used as title." Change-Id: Ia55ed5e491c676d3c4bfea4a069b998817997e24 (cherry picked from commit d4268bd03f1014edc747c10fe025787c4e42905f) --- .../java/com/google/gerrit/server/project/DashboardsCollection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"); -- cgit v1.2.3