added the possibility to append new hashtag to the columns
This commit is contained in:
parent
143d445fcb
commit
a87c2c19bb
@ -21,7 +21,7 @@
|
||||
|
||||
<div *ngIf="hashtags.length > 0" class="search-results">
|
||||
<h3 class="search-results__title">Hashtags</h3>
|
||||
<a (click)="selectHashtag(hashtag)" href *ngFor="let hashtag of hashtags" class="search-results__hashtag" title="add hashtag column">
|
||||
<a (click)="selectHashtag(hashtag)" href *ngFor="let hashtag of hashtags" class="search-results__hashtag" title="browse hashtag">
|
||||
#{{ hashtag }}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -48,14 +48,14 @@ export class SearchComponent implements OnInit {
|
||||
return false;
|
||||
}
|
||||
|
||||
addHashtag(hashtag: string): boolean {
|
||||
if (hashtag) {
|
||||
const newStream = new StreamElement(StreamTypeEnum.tag, `#${hashtag}`, this.lastAccountUsed.id, hashtag, null);
|
||||
this.store.dispatch([new AddStream(newStream)]);
|
||||
}
|
||||
// addHashtag(hashtag: string): boolean {
|
||||
// if (hashtag) {
|
||||
// const newStream = new StreamElement(StreamTypeEnum.tag, `#${hashtag}`, this.lastAccountUsed.id, hashtag, null);
|
||||
// this.store.dispatch([new AddStream(newStream)]);
|
||||
// }
|
||||
|
||||
return false;
|
||||
}
|
||||
// return false;
|
||||
// }
|
||||
|
||||
selectAccount(accountName: string): boolean {
|
||||
console.warn(accountName);
|
||||
|
@ -3,7 +3,7 @@
|
||||
<a href (click)="goToTop()" class="hashtag-header__gototop" title="go to top">
|
||||
<h3 class="hashtag-header__title">#{{hashtagElement.tag}}</h3>
|
||||
|
||||
<button class="btn-custom-secondary hashtag-header__add-column" (click)=" addColumn($event)" title="add column to board">add column</button>
|
||||
<button class="btn-custom-secondary hashtag-header__add-column" (click)="addColumn($event)" title="add column to board">add column</button>
|
||||
</a>
|
||||
</div>
|
||||
<app-stream-statuses class="hashtag-stream" *ngIf="hashtagElement" [streamElement]="hashtagElement" [goToTop]="goToTopSubject.asObservable()"
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { StreamElement } from '../../../states/streams.state';
|
||||
import { Store } from '@ngxs/store';
|
||||
|
||||
import { StreamElement, StreamTypeEnum, AddStream } from '../../../states/streams.state';
|
||||
|
||||
@Component({
|
||||
selector: 'app-hashtag',
|
||||
@ -16,21 +17,25 @@ export class HashtagComponent implements OnInit {
|
||||
|
||||
goToTopSubject: Subject<void> = new Subject<void>();
|
||||
|
||||
constructor() { }
|
||||
constructor(
|
||||
private readonly store: Store) { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
goToTop(): boolean{
|
||||
goToTop(): boolean {
|
||||
this.goToTopSubject.next();
|
||||
return false;
|
||||
}
|
||||
|
||||
addColumn(event): boolean {
|
||||
event.stopPropagation();
|
||||
console.log(`add column ${this.hashtagElement.tag}`)
|
||||
|
||||
return false;
|
||||
const hashtag = this.hashtagElement.tag;
|
||||
const newStream = new StreamElement(StreamTypeEnum.tag, `#${hashtag}`, this.hashtagElement.accountId, hashtag, null);
|
||||
this.store.dispatch([new AddStream(newStream)]);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
selectAccount(account: string) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user