Skip to content

Commit

Permalink
feat: [admin/dashboard] ajoute les cards qui décompte les jobs et les…
Browse files Browse the repository at this point in the history
… utilisateurs
  • Loading branch information
matthieuaudemard committed May 6, 2023
1 parent 97ec64e commit e334d42
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public ResponseEntity<Page<UserDto>> getAll(
}

@GetMapping(GET_TOTAL_USERS)
public ResponseEntity<Long> getTotalUsers() {
return ResponseEntity.ok(userService.getTotalUsers());
public ResponseEntity<Long> getEnabledUsersCount() {
return ResponseEntity.ok(userService.getEnabledUsersCount());
}

@GetMapping(GET_PENDING_USER_URI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public UserDto updateUserRoles(final String username, final Set<RoleEnum> roles)
return userMapper.toDto(userRepository.save(user));
}

public Long getTotalUsers() {
public Long getEnabledUsersCount() {
return userRepository.countByEnabledTrue();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class UserCounterWidgetComponent implements OnInit {
}

ngOnInit(): void {
this.userCount$ = this.userService.getTotalUsers();
this.userCount$ = this.userService.getEnabledUsersCount();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class UserService {
return this.http.post(this.apiEndpointsService.updateUserRolesEndpoint(username), roles);
}

getTotalUsers(): Observable<number> {
return this.http.get<number>(this.apiEndpointsService.getTotalUsers());
getEnabledUsersCount(): Observable<number> {
return this.http.get<number>(this.apiEndpointsService.getEnabledUsersCount());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ export class ApiEndpointsService {
return ApiEndpointsService.createUrlWithPageable(Uris.USERS.BASE_URI, pageable);
}

getTotalUsers() {
return ApiEndpointsService.createUrl(Uris.USERS.TOTAL);
getEnabledUsersCount() {
return ApiEndpointsService.createUrl(Uris.USERS.ENABLED_USERS_COUNT);
}


Expand Down
2 changes: 1 addition & 1 deletion frontend-implicaction/src/app/shared/models/uris.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class Uris {
static readonly GROUP_LIST = 'users';
static readonly ACTIVATE_USER = 'users/{username}/enable';
static readonly UPDATE_USER_ROLES = 'users/{username}/roles';
static readonly TOTAL = 'users/total';
static readonly ENABLED_USERS_COUNT = 'users/total';
};

static readonly PROFILES = class {
Expand Down

0 comments on commit e334d42

Please sign in to comment.