[Sprint/HipsterHedgehog] (feat): enable autocomplete for @ tagging
closes #339
mentioned in merge request !380 (closed)
added 9 commits
- a967d932...9adda44a - 8 commits from branch
master
- 212bb61b - Merge remote-tracking branch 'upstream/master' into feat/user-autocomplete
- a967d932...9adda44a - 8 commits from branch
- Owner
added MR::Requires Changes label
added 72 commits
- 212bb61b...102ce847 - 67 commits from branch
master
- 3bcbbb69 - Merge remote-tracking branch 'upstream/master' into feat/user-autocomplete
- 2a873b86 - (feat): reformat text input autocomplete
- cf89c65d - (fix): use site paddings for suggestion elements
- 9d8e4ea2 - (feat): enable custom item templates for suggestions
- 81414daa - (feat): use new custom template for user and hashtags suggestions
Toggle commit list- 212bb61b...102ce847 - 67 commits from branch
- Developer
@markeharding done. I added the ability to provide a custom template (check out the diffs from the latest commits)
- Last updated by Marcelo Rivera
1 1 <div class="mdl-card m-border post m-poster" *ngIf="session.isLoggedIn()"> 2 2 <div class="mdl-card__supporting-text"> 3 3 <form (submit)="post()"> 4 <mwl-text-input-autocomplete-container> 4 <ng-template #itemTemplate let-choice="choice" let-selectChoice="selectChoice"> - Owner
Should these templates not be in another component? What about when we are using comments etc?
- Developer
I moved to another component for reusability.
About also adding this for the comments poster, there's an issue: this directive only works with inputs and textareas, not content editable divs. Are you ok with me changing the current minds-textarea to a normal textarea?
- Last updated by Marcelo Rivera
1 import { Component, ElementRef, HostListener, OnInit, ViewChild } from '@angular/core'; 2 import { Subject } from 'rxjs'; 3 4 @Component({ 5 selector: 'm-text-input--autocomplete-menu', 6 template: ` - Owner
please move to an html file
changed this line in version 4 of the diff
- Last updated by Marcelo Rivera
260 260 } 261 261 262 262 @autobind() 263 async findTrendingHashtags(searchText: string) { 264 const response: any = await this.client.get('api/v2/search/suggest/tags', { q: searchText }); 265 return response.tags 266 .filter(item => item.toLowerCase().includes(searchText.toLowerCase())) 267 .slice(0, 5); 263 async findSuggestions(searchText: string, triggerCharacter: string) { - Owner
This is the job of the autocomplete directive/component. not the poster.
changed this line in version 4 of the diff
added 7 commits
- 81414daa...5d757256 - 5 commits from branch
master
- c4aff03d - Merge remote-tracking branch 'upstream/master' into feat/user-autocomplete
- 1696aa6c - (feat): add support for minds-textarea
- 81414daa...5d757256 - 5 commits from branch
- Owner
We have a bunch of failing tests here