Allows members to be ordered by additional system fields (#6575)

This commit is contained in:
Andy Butland
2019-10-15 13:18:45 +02:00
committed by Sebastiaan Janssen
parent 14d0bd056c
commit 28ec4da0fa
2 changed files with 23 additions and 6 deletions

View File

@@ -193,9 +193,14 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
_.each($scope.options.includeProperties, function (e, i) {
e.allowSorting = true;
// Special case for members, only fields on the base table (cmsMember) can be used for sorting
if (e.isSystem && $scope.entityType == "member") {
e.allowSorting = e.alias == 'username' || e.alias == 'email';
// Special case for members, only the configured system fields should be enabled sorting
// (see MemberRepository.ApplySystemOrdering)
if (e.isSystem && $scope.entityType === "member") {
e.allowSorting = e.alias === "username" ||
e.alias === "email" ||
e.alias === "updateDate" ||
e.alias === "createDate" ||
e.alias === "contentTypeAlias";
}
if (e.isSystem) {
@@ -779,8 +784,11 @@ function listViewController($scope, $routeParams, $injector, $timeout, currentUs
case "published":
return "content_isPublished";
case "contentTypeAlias":
// TODO: Check for members
return $scope.entityType === "content" ? "content_documentType" : "content_mediatype";
return $scope.entityType === "content"
? "content_documentType"
: $scope.entityType === "media"
? "content_mediatype"
: "content_membertype";
case "email":
return "general_email";
case "username":