From fed953301523c0b409404935667b3d036779c70c Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Mon, 28 Jan 2019 00:46:37 -0500 Subject: [PATCH] display column names in footer --- .../manage-account.component.ts | 37 ++++++++++--------- .../stream/hashtag/hashtag.component.ts | 2 +- .../stream-overlay.component.ts | 2 +- .../streams-selection-footer.component.html | 2 +- src/app/states/streams.state.ts | 3 +- 5 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/app/components/floating-column/manage-account/manage-account.component.ts b/src/app/components/floating-column/manage-account/manage-account.component.ts index 8de226e9..22ff8ace 100644 --- a/src/app/components/floating-column/manage-account/manage-account.component.ts +++ b/src/app/components/floating-column/manage-account/manage-account.component.ts @@ -5,28 +5,29 @@ import { AccountsStateModel, AccountInfo } from '../../../states/accounts.state' import { AccountWrapper } from '../../../models/account.models'; @Component({ - selector: 'app-manage-account', - templateUrl: './manage-account.component.html', - styleUrls: ['./manage-account.component.scss'] + selector: 'app-manage-account', + templateUrl: './manage-account.component.html', + styleUrls: ['./manage-account.component.scss'] }) export class ManageAccountComponent implements OnInit { - @Input() account: AccountWrapper; + @Input() account: AccountWrapper; - availableStreams: StreamElement[] = []; + availableStreams: StreamElement[] = []; - constructor(private readonly store: Store) { } + constructor(private readonly store: Store) { } - ngOnInit() { - this.availableStreams.length = 0; - this.availableStreams.push(new StreamElement(StreamTypeEnum.global, 'Global Timeline', this.account.info.id, null, null)); - this.availableStreams.push(new StreamElement(StreamTypeEnum.local, 'Local Timeline', this.account.info.id, null, null)); - this.availableStreams.push(new StreamElement(StreamTypeEnum.personnal, 'Personnal Timeline', this.account.info.id, null, null)); - } - - addStream(stream: StreamElement): boolean { - if (stream) { - this.store.dispatch([new AddStream(stream)]); + ngOnInit() { + const instance = this.account.info.instance; + this.availableStreams.length = 0; + this.availableStreams.push(new StreamElement(StreamTypeEnum.global, 'Federated Timeline', this.account.info.id, null, null, `federate@${instance}`)); + this.availableStreams.push(new StreamElement(StreamTypeEnum.local, 'Local Timeline', this.account.info.id, null, null, `local@${instance}`)); + this.availableStreams.push(new StreamElement(StreamTypeEnum.personnal, 'Home', this.account.info.id, null, null, `home@${instance}`)); + } + + addStream(stream: StreamElement): boolean { + if (stream) { + this.store.dispatch([new AddStream(stream)]); + } + return false; } - return false; - } } diff --git a/src/app/components/stream/hashtag/hashtag.component.ts b/src/app/components/stream/hashtag/hashtag.component.ts index d6273593..b2d05308 100644 --- a/src/app/components/stream/hashtag/hashtag.component.ts +++ b/src/app/components/stream/hashtag/hashtag.component.ts @@ -33,7 +33,7 @@ export class HashtagComponent implements OnInit { event.stopPropagation(); const hashtag = this.hashtagElement.tag; - const newStream = new StreamElement(StreamTypeEnum.tag, `#${hashtag}`, this.hashtagElement.accountId, hashtag, null); + const newStream = new StreamElement(StreamTypeEnum.tag, `#${hashtag}`, this.hashtagElement.accountId, hashtag, null, this.hashtagElement.displayableFullName); this.store.dispatch([new AddStream(newStream)]); return false; diff --git a/src/app/components/stream/stream-overlay/stream-overlay.component.ts b/src/app/components/stream/stream-overlay/stream-overlay.component.ts index f7eeafcc..6dcdcd9d 100644 --- a/src/app/components/stream/stream-overlay/stream-overlay.component.ts +++ b/src/app/components/stream/stream-overlay/stream-overlay.component.ts @@ -116,7 +116,7 @@ export class StreamOverlayComponent implements OnInit { } const selectedAccount = this.toolsService.getSelectedAccounts()[0]; - const hashTagElement = new StreamElement(StreamTypeEnum.tag, hashtag, selectedAccount.id, hashtag, null); + const hashTagElement = new StreamElement(StreamTypeEnum.tag, hashtag, selectedAccount.id, hashtag, null, `#${hashtag}@${selectedAccount.instance}`); const newElement = new OverlayBrowsing(hashTagElement, null, null); this.loadElement(newElement); this.canGoForward = false; diff --git a/src/app/components/streams-selection-footer/streams-selection-footer.component.html b/src/app/components/streams-selection-footer/streams-selection-footer.component.html index 087f14bb..7f87690d 100644 --- a/src/app/components/streams-selection-footer/streams-selection-footer.component.html +++ b/src/app/components/streams-selection-footer/streams-selection-footer.component.html @@ -1,5 +1,5 @@ \ No newline at end of file diff --git a/src/app/states/streams.state.ts b/src/app/states/streams.state.ts index 005542a7..8b2ee20b 100644 --- a/src/app/states/streams.state.ts +++ b/src/app/states/streams.state.ts @@ -31,7 +31,8 @@ export class StreamElement { public name: string, public accountId: string, public tag: string, - public list: string) { + public list: string, + public displayableFullName: string) { } }