Show filter field on project/group list screen before populating the list
If there are many projects/groups the initial loading of the
project/group list screen may take a long time. Display the filter
field immediately so that the user can already type a filter while
waiting for the list to be populated. Typing a filter and thus limiting
the result may be even be faster then waiting for the list to be
populated with all projects/groups.
Change-Id: I6f0c367d53e949a9b541fd00750f94b88ab645db
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java
index 07f25f4..dac0b6a 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/GroupListScreen.java
@@ -18,7 +18,7 @@
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.groups.GroupMap;
-import com.google.gerrit.client.rpc.ScreenLoadCallback;
+import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.AccountScreen;
import com.google.gerrit.client.ui.FilteredUserInterface;
import com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper;
@@ -54,6 +54,7 @@
@Override
protected void onLoad() {
super.onLoad();
+ display();
refresh();
}
@@ -62,9 +63,9 @@
: ADMIN_GROUPS + "?filter=" + URL.encodeQueryString(subname));
GroupMap.match(subname,
new IgnoreOutdatedFilterResultsCallbackWrapper<GroupMap>(this,
- new ScreenLoadCallback<GroupMap>(this) {
+ new GerritCallback<GroupMap>() {
@Override
- protected void preDisplay(final GroupMap result) {
+ public void onSuccess(GroupMap result) {
groups.display(result, subname);
groups.finishDisplay();
}
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/ProjectListScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/ProjectListScreen.java
index 6af437c..ee58420 100644
--- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/ProjectListScreen.java
+++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/admin/ProjectListScreen.java
@@ -21,7 +21,7 @@
import com.google.gerrit.client.GitwebLink;
import com.google.gerrit.client.projects.ProjectInfo;
import com.google.gerrit.client.projects.ProjectMap;
-import com.google.gerrit.client.rpc.ScreenLoadCallback;
+import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.FilteredUserInterface;
import com.google.gerrit.client.ui.HighlightingInlineHyperlink;
import com.google.gerrit.client.ui.IgnoreOutdatedFilterResultsCallbackWrapper;
@@ -63,6 +63,7 @@
@Override
protected void onLoad() {
super.onLoad();
+ display();
refresh();
}
@@ -71,9 +72,9 @@
: ADMIN_PROJECTS + "?filter=" + URL.encodeQueryString(subname));
ProjectMap.match(subname,
new IgnoreOutdatedFilterResultsCallbackWrapper<ProjectMap>(this,
- new ScreenLoadCallback<ProjectMap>(this) {
+ new GerritCallback<ProjectMap>() {
@Override
- protected void preDisplay(final ProjectMap result) {
+ public void onSuccess(ProjectMap result) {
projects.display(result);
}
}));