diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-29 10:55:17 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-29 10:55:17 +0100 |
commit | 97ecddae104f4013d261f0e9645e8b319ff0f1a6 (patch) | |
tree | 74e00ace03bcdfd91684c889b866f30ec2c6d244 /client/src/app | |
parent | f5b72c3937c721258c569ee783503adb379c42ab (diff) | |
download | PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.tar.gz PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.tar.zst PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.zip |
Filter on follows actor types in about page
Diffstat (limited to 'client/src/app')
-rw-r--r-- | client/src/app/+about/about-follows/about-follows.component.html | 8 | ||||
-rw-r--r-- | client/src/app/shared/instance/follow.service.ts | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/client/src/app/+about/about-follows/about-follows.component.html b/client/src/app/+about/about-follows/about-follows.component.html index 5d7a50c74..ebe03bd94 100644 --- a/client/src/app/+about/about-follows/about-follows.component.html +++ b/client/src/app/+about/about-follows/about-follows.component.html | |||
@@ -1,8 +1,8 @@ | |||
1 | <div class="row" myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()"> | 1 | <div class="row" myInfiniteScroller [autoInit]="true" (nearOfBottom)="onNearOfBottom()" [dataObservable]="onDataSubject.asObservable()"> |
2 | <div class="col-xl-6 col-md-12"> | 2 | <div class="col-xl-6 col-md-12"> |
3 | <div i18n class="subtitle">Followers</div> | 3 | <div i18n class="subtitle">Followers instances</div> |
4 | 4 | ||
5 | <div i18n class="no-results" *ngIf="followersPagination.totalItems === 0">This instance does not have followers.</div> | 5 | <div i18n class="no-results" *ngIf="followersPagination.totalItems === 0">This instance does not have instances followers.</div> |
6 | 6 | ||
7 | <a *ngFor="let follower of followers" [href]="buildLink(follower)" target="_blank" rel="noopener noreferrer"> | 7 | <a *ngFor="let follower of followers" [href]="buildLink(follower)" target="_blank" rel="noopener noreferrer"> |
8 | {{ follower }} | 8 | {{ follower }} |
@@ -10,9 +10,9 @@ | |||
10 | </div> | 10 | </div> |
11 | 11 | ||
12 | <div class="col-xl-6 col-md-12"> | 12 | <div class="col-xl-6 col-md-12"> |
13 | <div i18n class="subtitle">Followings</div> | 13 | <div i18n class="subtitle">Followings instances</div> |
14 | 14 | ||
15 | <div i18n class="no-results" *ngIf="followingsPagination.totalItems === 0">This instance does not have followings.</div> | 15 | <div i18n class="no-results" *ngIf="followingsPagination.totalItems === 0">This instance does not have instances followings.</div> |
16 | 16 | ||
17 | <a *ngFor="let following of followings" [href]="buildLink(following)" target="_blank" rel="noopener noreferrer"> | 17 | <a *ngFor="let following of followings" [href]="buildLink(following)" target="_blank" rel="noopener noreferrer"> |
18 | {{ following }} | 18 | {{ following }} |
diff --git a/client/src/app/shared/instance/follow.service.ts b/client/src/app/shared/instance/follow.service.ts index 1477a26ae..ef4c09583 100644 --- a/client/src/app/shared/instance/follow.service.ts +++ b/client/src/app/shared/instance/follow.service.ts | |||
@@ -2,7 +2,7 @@ import { catchError, map } from 'rxjs/operators' | |||
2 | import { HttpClient, HttpParams } from '@angular/common/http' | 2 | import { HttpClient, HttpParams } from '@angular/common/http' |
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { Observable } from 'rxjs' | 4 | import { Observable } from 'rxjs' |
5 | import { ActorFollow, FollowState, ResultList } from '@shared/index' | 5 | import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index' |
6 | import { environment } from '../../../environments/environment' | 6 | import { environment } from '../../../environments/environment' |
7 | import { RestExtractor, RestPagination, RestService } from '../rest' | 7 | import { RestExtractor, RestPagination, RestService } from '../rest' |
8 | import { SortMeta } from 'primeng/api' | 8 | import { SortMeta } from 'primeng/api' |
@@ -22,15 +22,17 @@ export class FollowService { | |||
22 | pagination: RestPagination, | 22 | pagination: RestPagination, |
23 | sort: SortMeta, | 23 | sort: SortMeta, |
24 | search?: string, | 24 | search?: string, |
25 | actorType?: ActivityPubActorType, | ||
25 | state?: FollowState | 26 | state?: FollowState |
26 | }): Observable<ResultList<ActorFollow>> { | 27 | }): Observable<ResultList<ActorFollow>> { |
27 | const { pagination, sort, search, state } = options | 28 | const { pagination, sort, search, state, actorType } = options |
28 | 29 | ||
29 | let params = new HttpParams() | 30 | let params = new HttpParams() |
30 | params = this.restService.addRestGetParams(params, pagination, sort) | 31 | params = this.restService.addRestGetParams(params, pagination, sort) |
31 | 32 | ||
32 | if (search) params = params.append('search', search) | 33 | if (search) params = params.append('search', search) |
33 | if (state) params = params.append('state', state) | 34 | if (state) params = params.append('state', state) |
35 | if (actorType) params = params.append('actorType', actorType) | ||
34 | 36 | ||
35 | return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/following', { params }) | 37 | return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/following', { params }) |
36 | .pipe( | 38 | .pipe( |
@@ -43,15 +45,17 @@ export class FollowService { | |||
43 | pagination: RestPagination, | 45 | pagination: RestPagination, |
44 | sort: SortMeta, | 46 | sort: SortMeta, |
45 | search?: string, | 47 | search?: string, |
48 | actorType?: ActivityPubActorType, | ||
46 | state?: FollowState | 49 | state?: FollowState |
47 | }): Observable<ResultList<ActorFollow>> { | 50 | }): Observable<ResultList<ActorFollow>> { |
48 | const { pagination, sort, search, state } = options | 51 | const { pagination, sort, search, state, actorType } = options |
49 | 52 | ||
50 | let params = new HttpParams() | 53 | let params = new HttpParams() |
51 | params = this.restService.addRestGetParams(params, pagination, sort) | 54 | params = this.restService.addRestGetParams(params, pagination, sort) |
52 | 55 | ||
53 | if (search) params = params.append('search', search) | 56 | if (search) params = params.append('search', search) |
54 | if (state) params = params.append('state', state) | 57 | if (state) params = params.append('state', state) |
58 | if (actorType) params = params.append('actorType', actorType) | ||
55 | 59 | ||
56 | return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/followers', { params }) | 60 | return this.authHttp.get<ResultList<ActorFollow>>(FollowService.BASE_APPLICATION_URL + '/followers', { params }) |
57 | .pipe( | 61 | .pipe( |