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>
This commit is contained in:
Edwin Kempin
2013-04-15 09:42:22 +02:00
parent 6eed43f008
commit b310f68d4a
2 changed files with 8 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ import static com.google.gerrit.common.PageLinks.ADMIN_GROUPS;
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 @@ public class GroupListScreen extends AccountScreen implements FilteredUserInterf
@Override
protected void onLoad() {
super.onLoad();
display();
refresh();
}
@@ -62,9 +63,9 @@ public class GroupListScreen extends AccountScreen implements FilteredUserInterf
: 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();
}

View File

@@ -21,7 +21,7 @@ import com.google.gerrit.client.Gerrit;
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 @@ public class ProjectListScreen extends Screen implements FilteredUserInterface {
@Override
protected void onLoad() {
super.onLoad();
display();
refresh();
}
@@ -71,9 +72,9 @@ public class ProjectListScreen extends Screen implements FilteredUserInterface {
: 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);
}
}));