Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Add active users count in Users Admin #96

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ public static interface View extends AbstractAdminPresenter.View {
// --

void setGridEditHandler(GridEditHandler handler);

void updateUsersPanelTitle();

}

Expand Down Expand Up @@ -430,6 +432,8 @@ public void onCommandSuccess(final ListResult<UserDTO> result) {
view.getUsersStore().commitChanges();
}
}, view.getUsersLoadable());

view.updateUsersPanelTitle();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
import com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Singleton;

/**
Expand Down Expand Up @@ -187,6 +186,19 @@ public void initialize() {

add(mainContainer);
}

/**
* Update users panel title with latest active users count
*/
public void updateUsersPanelTitle() {
int activeUsersCount = 0;
for(int i=0; i<usersGrid.getStore().getCount(); i++ ) {
if (usersGrid.getStore().getAt(i).getActive())
activeUsersCount++;
}
this.usersListPanel.setHeadingText(I18N.CONSTANTS.adminUsersPanel()
+ " (" + activeUsersCount + " " + I18N.CONSTANTS.adminUsersActiveUsers() + ")");
}

/**
* {@inheritDoc}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ adminUsersActive=Status
adminUsersDatePasswordChange=Last password change
adminUsersEmail=Email
adminUsersFirstName=First name
#To display the number of "active users"
adminUsersActiveUsers=active users
adminUsersIsActive=Active
adminUsersLocale=Invitation language
adminUsersName=Surname
Expand Down