diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-26 14:46:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-26 14:50:39 +0200 |
commit | 3827c3b3488845f4235714e92eea439423df2909 (patch) | |
tree | 2254b6ab4745099730c384110665fb11c5e82f52 /client/src/app/+admin/users/user-edit/user-edit.ts | |
parent | 4a216666e7f353e638c6927a9ff0c8fce4e94014 (diff) | |
download | PeerTube-3827c3b3488845f4235714e92eea439423df2909.tar.gz PeerTube-3827c3b3488845f4235714e92eea439423df2909.tar.zst PeerTube-3827c3b3488845f4235714e92eea439423df2909.zip |
Fix quota translations
Diffstat (limited to 'client/src/app/+admin/users/user-edit/user-edit.ts')
-rw-r--r-- | client/src/app/+admin/users/user-edit/user-edit.ts | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts index 4e7ca8a1b..07b087b5b 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/users/user-edit/user-edit.ts | |||
@@ -2,18 +2,16 @@ import { ServerService } from '../../../core' | |||
2 | import { FormReactive } from '../../../shared' | 2 | import { FormReactive } from '../../../shared' |
3 | import { USER_ROLE_LABELS, VideoResolution } from '../../../../../../shared' | 3 | import { USER_ROLE_LABELS, VideoResolution } from '../../../../../../shared' |
4 | import { EditCustomConfigComponent } from '../../../+admin/config/edit-custom-config/' | 4 | import { EditCustomConfigComponent } from '../../../+admin/config/edit-custom-config/' |
5 | import { ConfigService } from '@app/+admin/config/shared/config.service' | ||
5 | 6 | ||
6 | export abstract class UserEdit extends FormReactive { | 7 | export abstract class UserEdit extends FormReactive { |
7 | 8 | ||
8 | // These are used by a HTML select, so convert key into strings | 9 | videoQuotaOptions: { value: string, label: string }[] = [] |
9 | videoQuotaOptions = EditCustomConfigComponent.videoQuotaOptions | 10 | videoQuotaDailyOptions: { value: string, label: string }[] = [] |
10 | .map(q => ({ value: q.value.toString(), label: q.label })) | ||
11 | videoQuotaDailyOptions = EditCustomConfigComponent.videoQuotaDailyOptions | ||
12 | .map(q => ({ value: q.value.toString(), label: q.label })) | ||
13 | |||
14 | roles = Object.keys(USER_ROLE_LABELS).map(key => ({ value: key.toString(), label: USER_ROLE_LABELS[key] })) | 11 | roles = Object.keys(USER_ROLE_LABELS).map(key => ({ value: key.toString(), label: USER_ROLE_LABELS[key] })) |
15 | 12 | ||
16 | protected abstract serverService: ServerService | 13 | protected abstract serverService: ServerService |
14 | protected abstract configService: ConfigService | ||
17 | abstract isCreation (): boolean | 15 | abstract isCreation (): boolean |
18 | abstract getFormButtonTitle (): string | 16 | abstract getFormButtonTitle (): string |
19 | 17 | ||
@@ -35,4 +33,13 @@ export abstract class UserEdit extends FormReactive { | |||
35 | 33 | ||
36 | return multiplier * parseInt(this.form.value['videoQuota'], 10) | 34 | return multiplier * parseInt(this.form.value['videoQuota'], 10) |
37 | } | 35 | } |
36 | |||
37 | protected buildQuotaOptions () { | ||
38 | // These are used by a HTML select, so convert key into strings | ||
39 | this.videoQuotaOptions = this.configService | ||
40 | .videoQuotaOptions.map(q => ({ value: q.value.toString(), label: q.label })) | ||
41 | |||
42 | this.videoQuotaDailyOptions = this.configService | ||
43 | .videoQuotaDailyOptions.map(q => ({ value: q.value.toString(), label: q.label })) | ||
44 | } | ||
38 | } | 45 | } |