Skip to content

Commit

Permalink
feat: change disabled to status and add support to show phone number
Browse files Browse the repository at this point in the history
  • Loading branch information
josephatJ committed Dec 15, 2023
1 parent ecf30e3 commit 3ad1dda
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/app/core/services/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class UsersDataService {
.get(
`users.json?pageSize=${pageSize}&page=${page}${
q ? '&query=' + q : ''
}&fields=id,firstName,organisationUnits[id,level,name,code,path],surname,name,email,userCredentials[username,lastlogin,disabled]&order=firstName~asc${
}&fields=id,firstName,organisationUnits[id,level,name,code,path,parent[id,name,parent[id,name]]],surname,name,email,phoneNumber,userCredentials[username,lastlogin,disabled]&order=firstName~asc${
pathSection
? '&filter=organisationUnits.path:ilike:' + pathSection
: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
<th>{{ 'Names' | translate }}</th>
<th>{{ 'Username' | translate }}</th>
<th>{{ 'Email' | translate }}</th>
<th>{{ 'Phone number' | translate }}</th>
<th>{{ 'Last login' | translate }}</th>
<th>{{ 'Disabled' | translate }}</th>
<th>{{ 'Status' | translate }}</th>
<th>{{ 'Action' | translate }}</th>
</tr>
</thead>
Expand All @@ -40,11 +41,17 @@
<td>
{{ user?.email }}
</td>
<td>
{{ user?.phoneNumber }}
</td>
<td>
{{ user?.userCredentials?.lastLogin }}
</td>
<td>
<mat-icon *ngIf="user?.userCredentials?.disabled">done</mat-icon>
<span *ngIf="user?.userCredentials?.disabled"
>Inactive(Disable)</span
>
<span *ngIf="!user?.userCredentials?.disabled">Active</span>
</td>
<td>
<button
Expand Down Expand Up @@ -150,20 +157,25 @@
</table>
<!-- {{ params?.usersResponse?.pager | json }} -->
<div
class="d-flex justify-content-end mt-2"
class="mt-2"
*ngIf="
!params?.usersResponse?.message && params?.usersResponse?.pager?.total
"
>
<mat-paginator
[length]="params?.usersResponse?.pager?.total"
aria-label="Select page"
[pageSize]="pageSize"
[pageIndex]="pageIndex"
[pageSizeOptions]="pageSizeOptions"
(page)="getUsers($event, params?.usersResponse?.pager)"
>
</mat-paginator>
<div class="row">
<div class="col-11 d-flex justify-content-end">
<mat-paginator
[length]="params?.usersResponse?.pager?.total"
aria-label="Select page"
[pageSize]="pageSize"
[pageIndex]="pageIndex"
[pageSizeOptions]="pageSizeOptions"
(page)="getUsers($event, params?.usersResponse?.pager)"
>
</mat-paginator>
</div>
<div class="col-1"></div>
</div>

<!-- <button
mat-stroked-button
Expand Down

0 comments on commit 3ad1dda

Please sign in to comment.