diff options
Diffstat (limited to 'client/src/app/shared/shared-main')
12 files changed, 23 insertions, 15 deletions
diff --git a/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts index e0cb475fc..00cfbc692 100644 --- a/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts +++ b/client/src/app/shared/shared-main/angular/number-formatter.pipe.ts | |||
@@ -17,7 +17,7 @@ export class NumberFormatterPipe implements PipeTransform { | |||
17 | return +f | 17 | return +f |
18 | } | 18 | } |
19 | 19 | ||
20 | private dictionary: Array<{ max: number, type: string }> = [ | 20 | private dictionary: { max: number, type: string }[] = [ |
21 | { max: 1000, type: '' }, | 21 | { max: 1000, type: '' }, |
22 | { max: 1000000, type: 'K' }, | 22 | { max: 1000000, type: 'K' }, |
23 | { max: 1000000000, type: 'M' } | 23 | { max: 1000000000, type: 'M' } |
diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html index bbfab7b37..d4aa9f380 100644 --- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.html +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.html | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | <h6 | 41 | <h6 |
42 | *ngIf="!action.linkBuilder && action.isHeader && areActionsDisplayed(actions, entry)" [ngClass]="{ 'with-icon': !!action.iconName }" | 42 | *ngIf="!action.linkBuilder && action.isHeader && areActionsDisplayed(actions, entry)" [ngClass]="{ 'with-icon': !!action.iconName }" |
43 | class="dropdown-header" [title]="action.title || ''" (click)="action.handler(entry)" (keyup.enter)="action.handler(entry)" | 43 | class="dropdown-header" [title]="action.title || ''" |
44 | > | 44 | > |
45 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> | 45 | <ng-container *ngTemplateOutlet="templateActionLabel; context:{ $implicit: action }"></ng-container> |
46 | </h6> | 46 | </h6> |
diff --git a/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts index e39fbd66d..7d24ff4ae 100644 --- a/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts +++ b/client/src/app/shared/shared-main/buttons/action-dropdown.component.ts | |||
@@ -55,7 +55,7 @@ export class ActionDropdownComponent<T> { | |||
55 | return {} | 55 | return {} |
56 | } | 56 | } |
57 | 57 | ||
58 | areActionsDisplayed (actions: Array<DropdownAction<T> | DropdownAction<T>[]>, entry: T): boolean { | 58 | areActionsDisplayed (actions: (DropdownAction<T> | DropdownAction<T>[])[], entry: T): boolean { |
59 | return actions.some(a => { | 59 | return actions.some(a => { |
60 | if (Array.isArray(a)) return this.areActionsDisplayed(a, entry) | 60 | if (Array.isArray(a)) return this.areActionsDisplayed(a, entry) |
61 | 61 | ||
diff --git a/client/src/app/shared/shared-main/buttons/button.component.ts b/client/src/app/shared/shared-main/buttons/button.component.ts index 63a59cbe1..e3a830891 100644 --- a/client/src/app/shared/shared-main/buttons/button.component.ts +++ b/client/src/app/shared/shared-main/buttons/button.component.ts | |||
@@ -31,7 +31,7 @@ export class ButtonComponent implements OnInit, OnChanges { | |||
31 | private buildClasses () { | 31 | private buildClasses () { |
32 | this.classes = { | 32 | this.classes = { |
33 | [this.className]: true, | 33 | [this.className]: true, |
34 | disabled: this.disabled, | 34 | 'disabled': this.disabled, |
35 | 'icon-only': !this.label, | 35 | 'icon-only': !this.label, |
36 | 'has-icon': !!this.icon, | 36 | 'has-icon': !!this.icon, |
37 | 'responsive-label': this.responsiveLabel | 37 | 'responsive-label': this.responsiveLabel |
diff --git a/client/src/app/shared/shared-main/date/date-toggle.component.html b/client/src/app/shared/shared-main/date/date-toggle.component.html index 14b6e7d7a..5277ae0e8 100644 --- a/client/src/app/shared/shared-main/date/date-toggle.component.html +++ b/client/src/app/shared/shared-main/date/date-toggle.component.html | |||
@@ -1,7 +1,10 @@ | |||
1 | <span | 1 | <span |
2 | class="date-toggle" | 2 | class="date-toggle" |
3 | [title]="getTitle()" | 3 | [title]="getTitle()" |
4 | role="button" | ||
5 | tabindex="0" | ||
4 | (click)="toggle()" | 6 | (click)="toggle()" |
7 | (keyup.enter)="toggle()" | ||
5 | > | 8 | > |
6 | {{ getContent() }} | 9 | {{ getContent() }} |
7 | </span> | 10 | </span> |
diff --git a/client/src/app/shared/shared-main/loaders/loader.component.ts b/client/src/app/shared/shared-main/loaders/loader.component.ts index bd038f8b5..be9e130e7 100644 --- a/client/src/app/shared/shared-main/loaders/loader.component.ts +++ b/client/src/app/shared/shared-main/loaders/loader.component.ts | |||
@@ -10,8 +10,8 @@ export class LoaderComponent { | |||
10 | 10 | ||
11 | private readonly sizes = { | 11 | private readonly sizes = { |
12 | sm: { | 12 | sm: { |
13 | width: '1rem', | 13 | 'width': '1rem', |
14 | height: '1rem', | 14 | 'height': '1rem', |
15 | 'border-width': '0.15rem' | 15 | 'border-width': '0.15rem' |
16 | }, | 16 | }, |
17 | xl: { | 17 | xl: { |
diff --git a/client/src/app/shared/shared-main/misc/help.component.ts b/client/src/app/shared/shared-main/misc/help.component.ts index 37e2abd97..80fe0e160 100644 --- a/client/src/app/shared/shared-main/misc/help.component.ts +++ b/client/src/app/shared/shared-main/misc/help.component.ts | |||
@@ -77,7 +77,7 @@ export class HelpComponent implements OnInit, OnChanges, AfterContentInit { | |||
77 | } | 77 | } |
78 | 78 | ||
79 | private createMarkdownList (rules: string[]) { | 79 | private createMarkdownList (rules: string[]) { |
80 | const rulesToText = { | 80 | const rulesToText: { [id: string]: string } = { |
81 | emphasis: $localize`Emphasis`, | 81 | emphasis: $localize`Emphasis`, |
82 | link: $localize`Links`, | 82 | link: $localize`Links`, |
83 | newline: $localize`New lines`, | 83 | newline: $localize`New lines`, |
diff --git a/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts b/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts index ce185829c..53a48f8a1 100644 --- a/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts +++ b/client/src/app/shared/shared-main/router/actor-redirect-guard.service.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { forkJoin, of } from 'rxjs' | 1 | import { forkJoin, of } from 'rxjs' |
2 | import { catchError, map } from 'rxjs/operators' | 2 | import { catchError, map } from 'rxjs/operators' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router' | 4 | import { ActivatedRouteSnapshot, Router } from '@angular/router' |
5 | import { AccountService } from '../account' | 5 | import { AccountService } from '../account' |
6 | import { VideoChannelService } from '../video-channel' | 6 | import { VideoChannelService } from '../video-channel' |
7 | 7 | ||
8 | @Injectable() | 8 | @Injectable() |
9 | export class ActorRedirectGuard implements CanActivate { | 9 | export class ActorRedirectGuard { |
10 | 10 | ||
11 | constructor ( | 11 | constructor ( |
12 | private router: Router, | 12 | private router: Router, |
diff --git a/client/src/app/shared/shared-main/users/user-notifications.component.html b/client/src/app/shared/shared-main/users/user-notifications.component.html index a51e08292..351e4dc3f 100644 --- a/client/src/app/shared/shared-main/users/user-notifications.component.html +++ b/client/src/app/shared/shared-main/users/user-notifications.component.html | |||
@@ -1,6 +1,7 @@ | |||
1 | <div *ngIf="componentPagination.totalItems === 0" class="no-notification" i18n>You don't have notifications.</div> | 1 | <div *ngIf="componentPagination.totalItems === 0" class="no-notification" i18n>You don't have notifications.</div> |
2 | 2 | ||
3 | <div class="notifications" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()"> | 3 | <div class="notifications" myInfiniteScroller (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()"> |
4 | <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus --> | ||
4 | <div *ngFor="let notification of notifications" class="notification" [ngClass]="{ unread: !notification.read }" (click)="markAsRead(notification)"> | 5 | <div *ngFor="let notification of notifications" class="notification" [ngClass]="{ unread: !notification.read }" (click)="markAsRead(notification)"> |
5 | 6 | ||
6 | <ng-container [ngSwitch]="notification.type"> | 7 | <ng-container [ngSwitch]="notification.type"> |
diff --git a/client/src/app/shared/shared-main/users/user-quota.component.html b/client/src/app/shared/shared-main/users/user-quota.component.html index 0e0d38c2a..ac9085bb3 100644 --- a/client/src/app/shared/shared-main/users/user-quota.component.html +++ b/client/src/app/shared/shared-main/users/user-quota.component.html | |||
@@ -1,6 +1,7 @@ | |||
1 | <div class="user-quota mb-3"> | 1 | <div class="user-quota mb-3"> |
2 | <div> | 2 | <div> |
3 | <label class="user-quota-title" tabindex="0" i18n>Total video quota</label> | 3 | <div class="mb-2 fw-bold" i18n>Total video quota</div> |
4 | |||
4 | <div class="progress" tabindex="0" [ngbTooltip]="titleVideoQuota()"> | 5 | <div class="progress" tabindex="0" [ngbTooltip]="titleVideoQuota()"> |
5 | <div class="progress-bar" tabindex="0" role="progressbar" [style]="{ width: userVideoQuotaPercentage + '%' }" | 6 | <div class="progress-bar" tabindex="0" role="progressbar" [style]="{ width: userVideoQuotaPercentage + '%' }" |
6 | [attr.aria-valuenow]="userVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="user.videoQuota"></div> | 7 | [attr.aria-valuenow]="userVideoQuotaUsed" aria-valuemin="0" [attr.aria-valuemax]="user.videoQuota"></div> |
@@ -10,7 +11,8 @@ | |||
10 | </div> | 11 | </div> |
11 | 12 | ||
12 | <div *ngIf="hasDailyQuota()" class="mt-3"> | 13 | <div *ngIf="hasDailyQuota()" class="mt-3"> |
13 | <label class="user-quota-title" tabindex="0" i18n>Daily video quota</label> | 14 | <div class="mb-2 fw-bold" i18n>Daily video quota</div> |
15 | |||
14 | <div class="progress" tabindex="0" [ngbTooltip]="titleVideoQuotaDaily()"> | 16 | <div class="progress" tabindex="0" [ngbTooltip]="titleVideoQuotaDaily()"> |
15 | <div class="progress-bar" role="progressbar" [style]="{ width: userVideoQuotaDailyPercentage + '%' }" | 17 | <div class="progress-bar" role="progressbar" [style]="{ width: userVideoQuotaDailyPercentage + '%' }" |
16 | [attr.aria-valuenow]="userVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="user.videoQuotaDaily"></div> | 18 | [attr.aria-valuenow]="userVideoQuotaUsedDaily" aria-valuemin="0" [attr.aria-valuemax]="user.videoQuotaDaily"></div> |
diff --git a/client/src/app/shared/shared-main/video/video-edit.model.ts b/client/src/app/shared/shared-main/video/video-edit.model.ts index 91d57cb6b..47eee80d8 100644 --- a/client/src/app/shared/shared-main/video/video-edit.model.ts +++ b/client/src/app/shared/shared-main/video/video-edit.model.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import { getAbsoluteAPIUrl } from '@app/helpers' | 1 | import { getAbsoluteAPIUrl } from '@app/helpers' |
2 | import { VideoPrivacy, VideoScheduleUpdate, VideoUpdate } from '@shared/models' | 2 | import { VideoPrivacy, VideoScheduleUpdate, VideoUpdate } from '@shared/models' |
3 | import { VideoDetails } from './video-details.model' | 3 | import { VideoDetails } from './video-details.model' |
4 | import { objectKeysTyped } from '@shared/core-utils' | ||
4 | 5 | ||
5 | export class VideoEdit implements VideoUpdate { | 6 | export class VideoEdit implements VideoUpdate { |
6 | static readonly SPECIAL_SCHEDULED_PRIVACY = -1 | 7 | static readonly SPECIAL_SCHEDULED_PRIVACY = -1 |
@@ -65,8 +66,9 @@ export class VideoEdit implements VideoUpdate { | |||
65 | } | 66 | } |
66 | 67 | ||
67 | patch (values: { [ id: string ]: any }) { | 68 | patch (values: { [ id: string ]: any }) { |
68 | Object.keys(values).forEach((key) => { | 69 | objectKeysTyped(values).forEach(key => { |
69 | this[key] = values[key] | 70 | // FIXME: typings |
71 | (this as any)[key] = values[key] | ||
70 | }) | 72 | }) |
71 | 73 | ||
72 | // If schedule publication, the video is private and will be changed to public privacy | 74 | // If schedule publication, the video is private and will be changed to public privacy |
diff --git a/client/src/app/shared/shared-main/video/video.resolver.ts b/client/src/app/shared/shared-main/video/video.resolver.ts index 65b7230ce..dc07bb5da 100644 --- a/client/src/app/shared/shared-main/video/video.resolver.ts +++ b/client/src/app/shared/shared-main/video/video.resolver.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { ActivatedRouteSnapshot, Resolve } from '@angular/router' | 2 | import { ActivatedRouteSnapshot } from '@angular/router' |
3 | import { VideoService } from './video.service' | 3 | import { VideoService } from './video.service' |
4 | 4 | ||
5 | @Injectable() | 5 | @Injectable() |
6 | export class VideoResolver implements Resolve<any> { | 6 | export class VideoResolver { |
7 | constructor ( | 7 | constructor ( |
8 | private videoService: VideoService | 8 | private videoService: VideoService |
9 | ) { | 9 | ) { |