feat: request users ordered by creation date (#5160)

* feat: request users ordered by creation date

* fix: missing case for creationDate in user-table

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Miguel Cabrerizo 2023-02-17 14:15:21 +01:00 committed by GitHub
parent 99bb8ab771
commit 7fc3ecf665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 1 deletions

View File

@ -174,7 +174,7 @@
</ng-container>
<ng-container matColumnDef="creationDate">
<th mat-header-cell *matHeaderCellDef>{{ 'USER.TABLE.CREATIONDATE' | translate }}</th>
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'USER.TABLE.CREATIONDATE' | translate }}</th>
<td mat-cell *matCellDef="let user" [routerLink]="user.id ? ['/users', user.id] : null">
<span class="no-break">{{ user.details.creationDate | timestampToDate | localizedDate : 'fromNow' }}</span>
</td>

View File

@ -200,6 +200,9 @@ export class UserTableComponent implements OnInit {
case 'state':
sortingField = UserFieldName.USER_FIELD_NAME_STATE;
break;
case 'creationDate':
sortingField = UserFieldName.USER_FIELD_NAME_CREATION_DATE;
break;
}
this.userService
.listUsers(

View File

@ -709,6 +709,7 @@ UserTypeQuery is always equals
| USER_FIELD_NAME_EMAIL | 6 | - |
| USER_FIELD_NAME_STATE | 7 | - |
| USER_FIELD_NAME_TYPE | 8 | - |
| USER_FIELD_NAME_CREATION_DATE | 9 | - |

View File

@ -57,6 +57,8 @@ func UserFieldNameToSortingColumn(field user.UserFieldName) query.Column {
return query.UserTypeCol
case user.UserFieldName_USER_FIELD_NAME_NICK_NAME:
return query.HumanNickNameCol
case user.UserFieldName_USER_FIELD_NAME_CREATION_DATE:
return query.UserCreationDateCol
default:
return query.UserIDCol
}

View File

@ -330,6 +330,7 @@ enum UserFieldName {
USER_FIELD_NAME_EMAIL = 6;
USER_FIELD_NAME_STATE = 7;
USER_FIELD_NAME_TYPE = 8;
USER_FIELD_NAME_CREATION_DATE = 9;
}
message AuthFactor {