From 97ecddae104f4013d261f0e9645e8b319ff0f1a6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 Nov 2019 10:55:17 +0100 Subject: Filter on follows actor types in about page --- .../src/app/+about/about-follows/about-follows.component.html | 8 ++++---- client/src/app/shared/instance/follow.service.ts | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'client/src/app') 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 @@
-
Followers
+
Followers instances
-
This instance does not have followers.
+
This instance does not have instances followers.
{{ follower }} @@ -10,9 +10,9 @@
-
Followings
+
Followings instances
-
This instance does not have followings.
+
This instance does not have instances followings.
{{ 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' import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { Observable } from 'rxjs' -import { ActorFollow, FollowState, ResultList } from '@shared/index' +import { ActivityPubActorType, ActorFollow, FollowState, ResultList } from '@shared/index' import { environment } from '../../../environments/environment' import { RestExtractor, RestPagination, RestService } from '../rest' import { SortMeta } from 'primeng/api' @@ -22,15 +22,17 @@ export class FollowService { pagination: RestPagination, sort: SortMeta, search?: string, + actorType?: ActivityPubActorType, state?: FollowState }): Observable> { - const { pagination, sort, search, state } = options + const { pagination, sort, search, state, actorType } = options let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination, sort) if (search) params = params.append('search', search) if (state) params = params.append('state', state) + if (actorType) params = params.append('actorType', actorType) return this.authHttp.get>(FollowService.BASE_APPLICATION_URL + '/following', { params }) .pipe( @@ -43,15 +45,17 @@ export class FollowService { pagination: RestPagination, sort: SortMeta, search?: string, + actorType?: ActivityPubActorType, state?: FollowState }): Observable> { - const { pagination, sort, search, state } = options + const { pagination, sort, search, state, actorType } = options let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination, sort) if (search) params = params.append('search', search) if (state) params = params.append('state', state) + if (actorType) params = params.append('actorType', actorType) return this.authHttp.get>(FollowService.BASE_APPLICATION_URL + '/followers', { params }) .pipe( -- cgit v1.2.3