diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-01-19 13:43:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 13:43:33 +0100 |
commit | 370240824e2fb28b314255f6c23f5ea7d6b08625 (patch) | |
tree | 6d4350fd93ea0b960bd278a948cecbdfbd2b67d7 /client/src/app/+accounts/accounts.component.ts | |
parent | 2264c1ceedcf27998108b8f8b706e51ed910d4fb (diff) | |
download | PeerTube-370240824e2fb28b314255f6c23f5ea7d6b08625.tar.gz PeerTube-370240824e2fb28b314255f6c23f5ea7d6b08625.tar.zst PeerTube-370240824e2fb28b314255f6c23f5ea7d6b08625.zip |
Allow users/visitors to search through an account's videos (#3589)
* WIP: account search
* add search to account view
* add tests for account search
Diffstat (limited to 'client/src/app/+accounts/accounts.component.ts')
-rw-r--r-- | client/src/app/+accounts/accounts.component.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index 4820eaf32..1458ea59c 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.component.ts | |||
@@ -7,6 +7,7 @@ import { Account, AccountService, DropdownAction, ListOverflowItem, VideoChannel | |||
7 | import { AccountReportComponent } from '@app/shared/shared-moderation' | 7 | import { AccountReportComponent } from '@app/shared/shared-moderation' |
8 | import { User, UserRight } from '@shared/models' | 8 | import { User, UserRight } from '@shared/models' |
9 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | 9 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' |
10 | import { AccountSearchComponent } from './account-search/account-search.component' | ||
10 | 11 | ||
11 | @Component({ | 12 | @Component({ |
12 | templateUrl: './accounts.component.html', | 13 | templateUrl: './accounts.component.html', |
@@ -14,6 +15,7 @@ import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | |||
14 | }) | 15 | }) |
15 | export class AccountsComponent implements OnInit, OnDestroy { | 16 | export class AccountsComponent implements OnInit, OnDestroy { |
16 | @ViewChild('accountReportModal') accountReportModal: AccountReportComponent | 17 | @ViewChild('accountReportModal') accountReportModal: AccountReportComponent |
18 | accountSearch: AccountSearchComponent | ||
17 | 19 | ||
18 | account: Account | 20 | account: Account |
19 | accountUser: User | 21 | accountUser: User |
@@ -99,6 +101,18 @@ export class AccountsComponent implements OnInit, OnDestroy { | |||
99 | return $localize`${count} subscribers` | 101 | return $localize`${count} subscribers` |
100 | } | 102 | } |
101 | 103 | ||
104 | onOutletLoaded (component: Component) { | ||
105 | if (component instanceof AccountSearchComponent) { | ||
106 | this.accountSearch = component | ||
107 | } else { | ||
108 | this.accountSearch = undefined | ||
109 | } | ||
110 | } | ||
111 | |||
112 | searchChanged (search: string) { | ||
113 | if (this.accountSearch) this.accountSearch.updateSearch(search) | ||
114 | } | ||
115 | |||
102 | private onAccount (account: Account) { | 116 | private onAccount (account: Account) { |
103 | this.prependModerationActions = undefined | 117 | this.prependModerationActions = undefined |
104 | 118 | ||