diff options
author | Chocobozzz <me@florianbigard.com> | 2022-09-16 10:33:26 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-09-16 10:33:55 +0200 |
commit | 3afe0ec3b32d2bd9183541ecbf40278710f8707d (patch) | |
tree | b2abcc754dfa9a3b22d8a56c89902da801265b86 /client/src/app | |
parent | 56162c6a06732b6beb2021d0d95450363e21cadf (diff) | |
download | PeerTube-3afe0ec3b32d2bd9183541ecbf40278710f8707d.tar.gz PeerTube-3afe0ec3b32d2bd9183541ecbf40278710f8707d.tar.zst PeerTube-3afe0ec3b32d2bd9183541ecbf40278710f8707d.zip |
Fix broken dates with localized pages
Diffstat (limited to 'client/src/app')
6 files changed, 9 insertions, 31 deletions
diff --git a/client/src/app/shared/shared-instance/instance-follow.service.ts b/client/src/app/shared/shared-instance/instance-follow.service.ts index 5366fd068..7568fbbf4 100644 --- a/client/src/app/shared/shared-instance/instance-follow.service.ts +++ b/client/src/app/shared/shared-instance/instance-follow.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { from, Observable } from 'rxjs' | 2 | import { from, Observable } from 'rxjs' |
3 | import { catchError, concatMap, map, toArray } from 'rxjs/operators' | 3 | import { catchError, concatMap, toArray } from 'rxjs/operators' |
4 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { RestExtractor, RestPagination, RestService } from '@app/core' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
@@ -40,10 +40,7 @@ export class InstanceFollowService { | |||
40 | if (actorType) params = params.append('actorType', actorType) | 40 | if (actorType) params = params.append('actorType', actorType) |
41 | 41 | ||
42 | return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/following', { params }) | 42 | return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/following', { params }) |
43 | .pipe( | 43 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
44 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
45 | catchError(res => this.restExtractor.handleError(res)) | ||
46 | ) | ||
47 | } | 44 | } |
48 | 45 | ||
49 | getFollowers (options: { | 46 | getFollowers (options: { |
@@ -66,10 +63,7 @@ export class InstanceFollowService { | |||
66 | if (actorType) params = params.append('actorType', actorType) | 63 | if (actorType) params = params.append('actorType', actorType) |
67 | 64 | ||
68 | return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/followers', { params }) | 65 | return this.authHttp.get<ResultList<ActorFollow>>(InstanceFollowService.BASE_APPLICATION_URL + '/followers', { params }) |
69 | .pipe( | 66 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
70 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
71 | catchError(res => this.restExtractor.handleError(res)) | ||
72 | ) | ||
73 | } | 67 | } |
74 | 68 | ||
75 | follow (hostsOrHandles: string[]) { | 69 | follow (hostsOrHandles: string[]) { |
diff --git a/client/src/app/shared/shared-main/users/user-notification.service.ts b/client/src/app/shared/shared-main/users/user-notification.service.ts index df886ed65..0b3dd9a53 100644 --- a/client/src/app/shared/shared-main/users/user-notification.service.ts +++ b/client/src/app/shared/shared-main/users/user-notification.service.ts | |||
@@ -40,7 +40,6 @@ export class UserNotificationService { | |||
40 | 40 | ||
41 | return this.authHttp.get<ResultList<UserNotification>>(UserNotificationService.BASE_NOTIFICATIONS_URL, { params, context }) | 41 | return this.authHttp.get<ResultList<UserNotification>>(UserNotificationService.BASE_NOTIFICATIONS_URL, { params, context }) |
42 | .pipe( | 42 | .pipe( |
43 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
44 | map(res => this.restExtractor.applyToResultListData(res, this.formatNotification.bind(this))), | 43 | map(res => this.restExtractor.applyToResultListData(res, this.formatNotification.bind(this))), |
45 | catchError(err => this.restExtractor.handleError(err)) | 44 | catchError(err => this.restExtractor.handleError(err)) |
46 | ) | 45 | ) |
diff --git a/client/src/app/shared/shared-main/video/video-import.service.ts b/client/src/app/shared/shared-main/video/video-import.service.ts index f9720033a..607c08d71 100644 --- a/client/src/app/shared/shared-main/video/video-import.service.ts +++ b/client/src/app/shared/shared-main/video/video-import.service.ts | |||
@@ -64,7 +64,6 @@ export class VideoImportService { | |||
64 | .get<ResultList<VideoImport>>(UserService.BASE_USERS_URL + '/me/videos/imports', { params }) | 64 | .get<ResultList<VideoImport>>(UserService.BASE_USERS_URL + '/me/videos/imports', { params }) |
65 | .pipe( | 65 | .pipe( |
66 | switchMap(res => this.extractVideoImports(res)), | 66 | switchMap(res => this.extractVideoImports(res)), |
67 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
68 | catchError(err => this.restExtractor.handleError(err)) | 67 | catchError(err => this.restExtractor.handleError(err)) |
69 | ) | 68 | ) |
70 | } | 69 | } |
diff --git a/client/src/app/shared/shared-main/video/video-ownership.service.ts b/client/src/app/shared/shared-main/video/video-ownership.service.ts index bc0e1b1d1..1e8f7f68c 100644 --- a/client/src/app/shared/shared-main/video/video-ownership.service.ts +++ b/client/src/app/shared/shared-main/video/video-ownership.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { Observable } from 'rxjs' | 2 | import { Observable } from 'rxjs' |
3 | import { catchError, map } from 'rxjs/operators' | 3 | import { catchError } from 'rxjs/operators' |
4 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { RestExtractor, RestPagination, RestService } from '@app/core' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
@@ -35,10 +35,7 @@ export class VideoOwnershipService { | |||
35 | params = this.restService.addRestGetParams(params, pagination, sort) | 35 | params = this.restService.addRestGetParams(params, pagination, sort) |
36 | 36 | ||
37 | return this.authHttp.get<ResultList<VideoChangeOwnership>>(url, { params }) | 37 | return this.authHttp.get<ResultList<VideoChangeOwnership>>(url, { params }) |
38 | .pipe( | 38 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
39 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
40 | catchError(res => this.restExtractor.handleError(res)) | ||
41 | ) | ||
42 | } | 39 | } |
43 | 40 | ||
44 | acceptOwnership (id: number, input: VideoChangeOwnershipAccept) { | 41 | acceptOwnership (id: number, input: VideoChangeOwnershipAccept) { |
diff --git a/client/src/app/shared/shared-moderation/blocklist.service.ts b/client/src/app/shared/shared-moderation/blocklist.service.ts index 1169bf757..0fb7536e5 100644 --- a/client/src/app/shared/shared-moderation/blocklist.service.ts +++ b/client/src/app/shared/shared-moderation/blocklist.service.ts | |||
@@ -53,7 +53,6 @@ export class BlocklistService { | |||
53 | 53 | ||
54 | return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/accounts', { params }) | 54 | return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/accounts', { params }) |
55 | .pipe( | 55 | .pipe( |
56 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
57 | map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))), | 56 | map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))), |
58 | catchError(err => this.restExtractor.handleError(err)) | 57 | catchError(err => this.restExtractor.handleError(err)) |
59 | ) | 58 | ) |
@@ -84,10 +83,7 @@ export class BlocklistService { | |||
84 | if (search) params = params.append('search', search) | 83 | if (search) params = params.append('search', search) |
85 | 84 | ||
86 | return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/servers', { params }) | 85 | return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_USER_BLOCKLIST_URL + '/servers', { params }) |
87 | .pipe( | 86 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
88 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
89 | catchError(err => this.restExtractor.handleError(err)) | ||
90 | ) | ||
91 | } | 87 | } |
92 | 88 | ||
93 | blockServerByUser (host: string) { | 89 | blockServerByUser (host: string) { |
@@ -116,7 +112,6 @@ export class BlocklistService { | |||
116 | 112 | ||
117 | return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/accounts', { params }) | 113 | return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/accounts', { params }) |
118 | .pipe( | 114 | .pipe( |
119 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
120 | map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))), | 115 | map(res => this.restExtractor.applyToResultListData(res, this.formatAccountBlock.bind(this))), |
121 | catchError(err => this.restExtractor.handleError(err)) | 116 | catchError(err => this.restExtractor.handleError(err)) |
122 | ) | 117 | ) |
@@ -151,10 +146,7 @@ export class BlocklistService { | |||
151 | if (search) params = params.append('search', search) | 146 | if (search) params = params.append('search', search) |
152 | 147 | ||
153 | return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/servers', { params }) | 148 | return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/servers', { params }) |
154 | .pipe( | 149 | .pipe(catchError(err => this.restExtractor.handleError(err))) |
155 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
156 | catchError(err => this.restExtractor.handleError(err)) | ||
157 | ) | ||
158 | } | 150 | } |
159 | 151 | ||
160 | blockServerByInstance (host: string) { | 152 | blockServerByInstance (host: string) { |
diff --git a/client/src/app/shared/shared-moderation/video-block.service.ts b/client/src/app/shared/shared-moderation/video-block.service.ts index 6272b672f..ab352a2d6 100644 --- a/client/src/app/shared/shared-moderation/video-block.service.ts +++ b/client/src/app/shared/shared-moderation/video-block.service.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import { SortMeta } from 'primeng/api' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { from as observableFrom, Observable } from 'rxjs' | 2 | import { from as observableFrom, Observable } from 'rxjs' |
3 | import { catchError, concatMap, map, toArray } from 'rxjs/operators' | 3 | import { catchError, concatMap, toArray } from 'rxjs/operators' |
4 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
5 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
6 | import { RestExtractor, RestPagination, RestService } from '@app/core' | 6 | import { RestExtractor, RestPagination, RestService } from '@app/core' |
@@ -47,10 +47,7 @@ export class VideoBlockService { | |||
47 | if (type) params = params.append('type', type.toString()) | 47 | if (type) params = params.append('type', type.toString()) |
48 | 48 | ||
49 | return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlockService.BASE_VIDEOS_URL + 'blacklist', { params }) | 49 | return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlockService.BASE_VIDEOS_URL + 'blacklist', { params }) |
50 | .pipe( | 50 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
51 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | ||
52 | catchError(res => this.restExtractor.handleError(res)) | ||
53 | ) | ||
54 | } | 51 | } |
55 | 52 | ||
56 | unblockVideo (videoIdArgs: number | number[]) { | 53 | unblockVideo (videoIdArgs: number | number[]) { |