File tree Expand file tree Collapse file tree 1 file changed +31
-3
lines changed
assets/javascripts/discourse/components Expand file tree Collapse file tree 1 file changed +31
-3
lines changed Original file line number Diff line number Diff line change 1+ import { makeArray } from "discourse/lib/helpers" ;
12import TagChooser from "select-kit/components/tag-chooser" ;
23
34export default TagChooser . extend ( {
4- searchTags ( url , data , callback ) {
5+ search ( query ) {
6+ const selectedTags = makeArray ( this . tags ) . filter ( Boolean ) ;
7+
8+ const data = {
9+ q : query ,
10+ limit : this . siteSettings . max_tag_search_results ,
11+ categoryId : this . categoryId ,
12+ } ;
13+
14+ if ( selectedTags . length || this . blockedTags . length ) {
15+ data . selected_tags = selectedTags
16+ . concat ( this . blockedTags )
17+ . uniq ( )
18+ . slice ( 0 , 100 ) ;
19+ }
20+
21+ if ( ! this . everyTag ) {
22+ data . filterForInput = true ;
23+ }
24+ if ( this . excludeSynonyms ) {
25+ data . excludeSynonyms = true ;
26+ }
27+ if ( this . excludeHasSynonyms ) {
28+ data . excludeHasSynonyms = true ;
29+ }
530 if ( this . tagGroups ) {
631 let tagGroupsString = this . tagGroups . join ( "," ) ;
732 data . filterForInput = {
833 name : "custom-wizard-tag-chooser" ,
934 groups : tagGroupsString ,
1035 } ;
1136 }
12-
13- return this . _super ( url , data , callback ) ;
37+ return this . tagUtils . searchTags (
38+ "/tags/filter/search" ,
39+ data ,
40+ this . _transformJson
41+ ) ;
1442 } ,
1543} ) ;
You can’t perform that action at this time.
0 commit comments