ok, tests fixed now?
This commit is contained in:
@@ -53,7 +53,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
/// <param name="userGroups">Optional parameter to filter by specified user groups</param>
|
||||
/// <param name="userState">Optional parameter to filter by specfied user state</param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords, Expression<Func<IUser, object>> orderBy, Direction orderDirection, string[] userGroups = null, UserState? userState = null, IQuery<IUser> filter = null);
|
||||
IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords, Expression<Func<IUser, object>> orderBy, Direction orderDirection, string[] userGroups = null, UserState[] userState = null, IQuery<IUser> filter = null);
|
||||
|
||||
IProfile GetProfile(string username);
|
||||
IProfile GetProfile(int id);
|
||||
|
||||
@@ -486,7 +486,7 @@ SELECT 'CountOfInvited' AS name, COUNT(id) AS num FROM umbracoUser WHERE lastLog
|
||||
/// <remarks>
|
||||
/// The query supplied will ONLY work with data specifically on the umbracoUser table because we are using PetaPoco paging (SQL paging)
|
||||
/// </remarks>
|
||||
public IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords, Expression<Func<IUser, object>> orderBy, Direction orderDirection, string[] userGroups = null, UserState? userState = null, IQuery<IUser> filter = null)
|
||||
public IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords, Expression<Func<IUser, object>> orderBy, Direction orderDirection, string[] userGroups = null, UserState[] userState = null, IQuery<IUser> filter = null)
|
||||
{
|
||||
if (orderBy == null) throw new ArgumentNullException("orderBy");
|
||||
|
||||
@@ -503,8 +503,13 @@ SELECT 'CountOfInvited' AS name, COUNT(id) AS num FROM umbracoUser WHERE lastLog
|
||||
|
||||
|
||||
|
||||
private IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, string[] userGroups = null, UserState? userState = null, IQuery<IUser> filter = null)
|
||||
{
|
||||
private IEnumerable<IUser> GetPagedResultsByQuery(IQuery<IUser> query, long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection,
|
||||
string[] userGroups = null,
|
||||
UserState[] userState = null,
|
||||
IQuery<IUser> filter = null)
|
||||
{
|
||||
//TODO: Implement userState filtering!
|
||||
|
||||
if (string.IsNullOrWhiteSpace(orderBy)) throw new ArgumentException("Value cannot be null or whitespace.", "orderBy");
|
||||
|
||||
|
||||
|
||||
@@ -28,8 +28,10 @@ namespace Umbraco.Core.Services
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
IEnumerable<IUser> GetAll(long pageIndex, int pageSize, out long totalRecords,
|
||||
string orderBy, Direction orderDirection,
|
||||
UserState? userState = null, string[] userGroups = null, string filter = "");
|
||||
string orderBy, Direction orderDirection,
|
||||
UserState[] userState = null,
|
||||
string[] userGroups = null,
|
||||
string filter = "");
|
||||
|
||||
/// <summary>
|
||||
/// This is simply a helper method which essentially just wraps the MembershipProvider's ChangePassword method
|
||||
|
||||
@@ -498,7 +498,7 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<IUser> GetAll(long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, UserState? userState = null, string[] userGroups = null, string filter = "")
|
||||
public IEnumerable<IUser> GetAll(long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, UserState[] userState = null, string[] userGroups = null, string filter = "")
|
||||
{
|
||||
using (var uow = UowProvider.GetUnitOfWork(readOnly: true))
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Umbraco.Web.Editors
|
||||
else
|
||||
{
|
||||
var paged = objectContent.Value as UsersController.PagedUserResult;
|
||||
if (paged != null)
|
||||
if (paged != null && paged.Items != null)
|
||||
{
|
||||
foreach (var userDisplay in paged.Items)
|
||||
{
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace Umbraco.Web.Editors
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns all user groups
|
||||
/// Return a user group
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public UserGroupDisplay GetUserGroup(int id)
|
||||
@@ -195,7 +195,7 @@ namespace Umbraco.Web.Editors
|
||||
|
||||
return Mapper.Map<UserGroupDisplay>(found);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns a paged users collection
|
||||
/// </summary>
|
||||
@@ -204,6 +204,7 @@ namespace Umbraco.Web.Editors
|
||||
/// <param name="orderBy"></param>
|
||||
/// <param name="orderDirection"></param>
|
||||
/// <param name="userGroups"></param>
|
||||
/// <param name="userStates"></param>
|
||||
/// <param name="filter"></param>
|
||||
/// <returns></returns>
|
||||
public PagedUserResult GetPagedUsers(
|
||||
@@ -212,7 +213,7 @@ namespace Umbraco.Web.Editors
|
||||
string orderBy = "username",
|
||||
Direction orderDirection = Direction.Ascending,
|
||||
[FromUri]string[] userGroups = null,
|
||||
//TODO: Add User state filtering
|
||||
[FromUri]UserState[] userStates = null,
|
||||
string filter = "")
|
||||
{
|
||||
long pageIndex = pageNumber - 1;
|
||||
|
||||
@@ -131,6 +131,9 @@ namespace Umbraco.Web.Models.Mapping
|
||||
.AfterMap((group, display) =>
|
||||
{
|
||||
MapUserGroupBasic(applicationContext.Services, group, display);
|
||||
|
||||
//Important! Currently we are never mapping to multiple UserGroupDisplay objects but if we start doing that
|
||||
// this will cause an N+1 and we'll need to change how this works.
|
||||
var users = applicationContext.Services.UserService.GetAllInGroup(group.Id);
|
||||
display.Users = Mapper.Map<IEnumerable<UserBasic>>(users);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user