From 073deef8862f462de5f159a57877ef415ebe4c69 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 27 Jul 2022 11:05:32 +0200 Subject: Handle rejected follows in client Also add quick filters so it's easier to find pending follows --- .../followers-list/followers-list.component.html | 19 ++++++++----------- .../followers-list/followers-list.component.ts | 7 ++++++- .../following-list/following-list.component.html | 13 ++++++------- .../following-list/following-list.component.ts | 5 +++++ 4 files changed, 25 insertions(+), 19 deletions(-) (limited to 'client/src/app/+admin') diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.html b/client/src/app/+admin/follows/followers-list/followers-list.component.html index 3081098c4..4f11f261d 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.html +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.html @@ -13,7 +13,7 @@
- +
@@ -31,12 +31,10 @@ - - - - + + - + @@ -45,11 +43,10 @@ - - Accepted - - - Pending + + Accepted + Pending + Rejected {{ follow.score }} diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts index 329e3bcc7..d09e74fef 100644 --- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts +++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts @@ -1,6 +1,7 @@ import { SortMeta } from 'primeng/api' import { Component, OnInit } from '@angular/core' import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' +import { AdvancedInputFilter } from '@app/shared/shared-forms' import { InstanceFollowService } from '@app/shared/shared-instance' import { ActorFollow } from '@shared/models' @@ -15,12 +16,16 @@ export class FollowersListComponent extends RestTable implements OnInit { sort: SortMeta = { field: 'createdAt', order: -1 } pagination: RestPagination = { count: this.rowsPerPage, start: 0 } + searchFilters: AdvancedInputFilter[] + constructor ( private confirmService: ConfirmService, private notifier: Notifier, private followService: InstanceFollowService ) { super() + + this.searchFilters = this.followService.buildFollowsListFilters() } ngOnInit () { @@ -70,7 +75,7 @@ export class FollowersListComponent extends RestTable implements OnInit { } async deleteFollower (follow: ActorFollow) { - const message = $localize`Do you really want to delete this follower?` + const message = $localize`Do you really want to delete this follower? It will be able to send again another follow request.` const res = await this.confirmService.confirm(message, $localize`Delete`) if (res === false) return diff --git a/client/src/app/+admin/follows/following-list/following-list.component.html b/client/src/app/+admin/follows/following-list/following-list.component.html index 302dc9528..856c4a31f 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.html +++ b/client/src/app/+admin/follows/following-list/following-list.component.html @@ -20,7 +20,7 @@
- +
@@ -47,11 +47,10 @@ - - Accepted - - - Pending + + Accepted + Pending + Rejected {{ follow.createdAt | date: 'short' }} @@ -66,7 +65,7 @@ - +
No host found matching current filters. Your instance is not following anyone. diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index 2c0f6db0c..7a854be81 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts @@ -1,6 +1,7 @@ import { SortMeta } from 'primeng/api' import { Component, OnInit, ViewChild } from '@angular/core' import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' +import { AdvancedInputFilter } from '@app/shared/shared-forms' import { InstanceFollowService } from '@app/shared/shared-instance' import { ActorFollow } from '@shared/models' import { FollowModalComponent } from './follow-modal.component' @@ -17,12 +18,16 @@ export class FollowingListComponent extends RestTable implements OnInit { sort: SortMeta = { field: 'createdAt', order: -1 } pagination: RestPagination = { count: this.rowsPerPage, start: 0 } + searchFilters: AdvancedInputFilter[] + constructor ( private notifier: Notifier, private confirmService: ConfirmService, private followService: InstanceFollowService ) { super() + + this.searchFilters = this.followService.buildFollowsListFilters() } ngOnInit () { -- cgit v1.2.3