diff options
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r-- | client/src/app/+admin/users/shared/user.service.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/app/+admin/users/shared/user.service.ts b/client/src/app/+admin/users/shared/user.service.ts index a0e2f666d..470beef08 100644 --- a/client/src/app/+admin/users/shared/user.service.ts +++ b/client/src/app/+admin/users/shared/user.service.ts | |||
@@ -4,7 +4,7 @@ import { Injectable } from '@angular/core' | |||
4 | import { BytesPipe } from 'ngx-pipes' | 4 | import { BytesPipe } from 'ngx-pipes' |
5 | import { SortMeta } from 'primeng/components/common/sortmeta' | 5 | import { SortMeta } from 'primeng/components/common/sortmeta' |
6 | import { Observable } from 'rxjs' | 6 | import { Observable } from 'rxjs' |
7 | import { ResultList, UserCreate, UserUpdate, User } from '../../../../../../shared' | 7 | import { ResultList, UserCreate, UserUpdate, User, UserRole } from '../../../../../../shared' |
8 | import { environment } from '../../../../environments/environment' | 8 | import { environment } from '../../../../environments/environment' |
9 | import { RestExtractor, RestPagination, RestService } from '../../../shared' | 9 | import { RestExtractor, RestPagination, RestService } from '../../../shared' |
10 | import { I18n } from '@ngx-translate/i18n-polyfill' | 10 | import { I18n } from '@ngx-translate/i18n-polyfill' |
@@ -81,7 +81,14 @@ export class UserService { | |||
81 | 81 | ||
82 | const videoQuotaUsed = this.bytesPipe.transform(user.videoQuotaUsed, 0) | 82 | const videoQuotaUsed = this.bytesPipe.transform(user.videoQuotaUsed, 0) |
83 | 83 | ||
84 | const roleLabels: { [ id in UserRole ]: string } = { | ||
85 | [UserRole.USER]: this.i18n('User'), | ||
86 | [UserRole.ADMINISTRATOR]: this.i18n('Administrator'), | ||
87 | [UserRole.MODERATOR]: this.i18n('Moderator') | ||
88 | } | ||
89 | |||
84 | return Object.assign(user, { | 90 | return Object.assign(user, { |
91 | roleLabel: roleLabels[user.role], | ||
85 | videoQuota, | 92 | videoQuota, |
86 | videoQuotaUsed | 93 | videoQuotaUsed |
87 | }) | 94 | }) |