From 8db930570159632cd1271d905e45e204792fb9fa Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Sun, 27 Jan 2019 23:20:49 -0500 Subject: [PATCH] added events handling for profile/hashtag to report status selection --- .../components/stream/hashtag/hashtag.component.html | 3 ++- .../components/stream/hashtag/hashtag.component.ts | 5 +++++ .../stream-overlay/stream-overlay.component.html | 11 ++++++++--- src/app/components/stream/thread/thread.component.ts | 12 ++++++++++++ .../stream/user-profile/user-profile.component.html | 3 ++- .../stream/user-profile/user-profile.component.ts | 5 +++++ 6 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/app/components/stream/hashtag/hashtag.component.html b/src/app/components/stream/hashtag/hashtag.component.html index 6f09f0bc..7f13a754 100644 --- a/src/app/components/stream/hashtag/hashtag.component.html +++ b/src/app/components/stream/hashtag/hashtag.component.html @@ -10,5 +10,6 @@ [streamElement]="hashtagElement" [goToTop]="goToTopSubject.asObservable()" (browseAccountEvent)="browseAccount($event)" - (browseHashtagEvent)="browseHashtag($event)"> + (browseHashtagEvent)="browseHashtag($event)" + (browseThreadEvent)="browseThread($event)"> \ No newline at end of file diff --git a/src/app/components/stream/hashtag/hashtag.component.ts b/src/app/components/stream/hashtag/hashtag.component.ts index de2e0a1d..d6273593 100644 --- a/src/app/components/stream/hashtag/hashtag.component.ts +++ b/src/app/components/stream/hashtag/hashtag.component.ts @@ -12,6 +12,7 @@ import { StreamElement, StreamTypeEnum, AddStream } from '../../../states/stream export class HashtagComponent implements OnInit { @Output() browseAccountEvent = new EventEmitter(); @Output() browseHashtagEvent = new EventEmitter(); + @Output() browseThreadEvent = new EventEmitter(); @Input() hashtagElement: StreamElement; @@ -45,4 +46,8 @@ export class HashtagComponent implements OnInit { browseHashtag(hashtag: string) { this.browseHashtagEvent.next(hashtag); } + + browseThread(statusUri: string): void { + this.browseThreadEvent.next(statusUri); + } } diff --git a/src/app/components/stream/stream-overlay/stream-overlay.component.html b/src/app/components/stream/stream-overlay/stream-overlay.component.html index 2ad00bf5..9d06ac34 100644 --- a/src/app/components/stream/stream-overlay/stream-overlay.component.html +++ b/src/app/components/stream/stream-overlay/stream-overlay.component.html @@ -8,9 +8,14 @@ + (browseHashtagEvent)="browseHashtag($event)" + (browseThreadEvent)="browseThread($event)"> - + (browseHashtagEvent)="browseHashtag($event)" + (browseThreadEvent)="browseThread($event)"> + \ No newline at end of file diff --git a/src/app/components/stream/thread/thread.component.ts b/src/app/components/stream/thread/thread.component.ts index e271af62..d81d6c94 100644 --- a/src/app/components/stream/thread/thread.component.ts +++ b/src/app/components/stream/thread/thread.component.ts @@ -56,4 +56,16 @@ export class ThreadComponent implements OnInit { onScroll(){ //Do nothing } + + browseAccount(accountName: string): void { + this.browseAccountEvent.next(accountName); + } + + browseHashtag(hashtag: string): void { + this.browseHashtagEvent.next(hashtag); + } + + browseThread(statusUri: string): void { + this.browseThreadEvent.next(statusUri); + } } diff --git a/src/app/components/stream/user-profile/user-profile.component.html b/src/app/components/stream/user-profile/user-profile.component.html index d3670697..a819393d 100644 --- a/src/app/components/stream/user-profile/user-profile.component.html +++ b/src/app/components/stream/user-profile/user-profile.component.html @@ -27,7 +27,8 @@
+ (browseAccountEvent)="browseAccount($event)" + (browseThreadEvent)="browseThread($event)">
diff --git a/src/app/components/stream/user-profile/user-profile.component.ts b/src/app/components/stream/user-profile/user-profile.component.ts index 16452660..ec82cee9 100644 --- a/src/app/components/stream/user-profile/user-profile.component.ts +++ b/src/app/components/stream/user-profile/user-profile.component.ts @@ -23,6 +23,7 @@ export class UserProfileComponent implements OnInit { @Output() browseAccountEvent = new EventEmitter(); @Output() browseHashtagEvent = new EventEmitter(); + @Output() browseThreadEvent = new EventEmitter(); @Input('currentAccount') //set currentAccount(account: Account) { @@ -59,6 +60,10 @@ export class UserProfileComponent implements OnInit { this.browseHashtagEvent.next(hashtag); } + browseThread(statusUri: string): void { + this.browseThreadEvent.next(statusUri); + } + private loadAccount(accountName: string): Promise { this.account = null; this.accountName = accountName;