File tree Expand file tree Collapse file tree 5 files changed +34
-2
lines changed Expand file tree Collapse file tree 5 files changed +34
-2
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { restartableTask } from 'ember-concurrency';
77import { bool , reads } from 'macro-decorators' ;
88
99import { pagination } from '../utils/pagination' ;
10- import { processSearchQuery } from '../utils/search' ;
10+ import { CATEGORY_PREFIX , processSearchQuery } from '../utils/search' ;
1111
1212export default class SearchController extends Controller {
1313 @service store ;
@@ -49,6 +49,11 @@ export default class SearchController extends Controller {
4949
5050 @bool ( 'totalItems' ) hasItems ;
5151
52+ get hasMultiCategoryFilter ( ) {
53+ let tokens = this . q . trim ( ) . split ( / \s + / ) ;
54+ return tokens . filter ( token => token . startsWith ( CATEGORY_PREFIX ) ) . length > 1 ;
55+ }
56+
5257 @action fetchData ( ) {
5358 this . dataTask . perform ( ) . catch ( ( ) => {
5459 // we ignore errors here because they are handled in the template already
Original file line number Diff line number Diff line change 66 --grey200 : hsl (200 , 17% , 96% );
77 --green800 : hsl (115 , 31% , 31% );
88 --green900 : hsl (115 , 31% , 21% );
9+
10+ --orange-50 : # fff7ed ;
11+ --orange-100 : # ffedd5 ;
12+ --orange-200 : # fed7aa ;
13+ --orange-300 : # fdba74 ;
14+ --orange-400 : # fb923c ;
15+ --orange-500 : # f97316 ;
16+ --orange-600 : # ea580c ;
17+ --orange-700 : # c2410c ;
18+ --orange-800 : # 9a3412 ;
19+ --orange-900 : # 7c2d12 ;
20+
921 --yellow500 : hsl (44 , 100% , 60% );
1022 --yellow700 : hsl (44 , 67% , 50% );
1123
Original file line number Diff line number Diff line change 55 margin-bottom : 25px ;
66}
77
8+ .warning {
9+ margin : 0 0 16px ;
10+ padding : 8px ;
11+ color : var (--orange-700 );
12+ background : var (--orange-100 );
13+ border-left : solid var (--orange-400 ) 4px ;
14+ border-radius : 2px ;
15+ }
16+
817.sort-by-label {
918 composes : small from './shared/typography.module.css' ;
1019}
Original file line number Diff line number Diff line change 88 data-test-header
99/>
1010
11+ {{ #if this.hasMultiCategoryFilter }}
12+ <div local-class =" warning" >
13+ Support for using multiple <code >category:</code > filters is not yet implemented.
14+ </div >
15+ {{ /if }}
16+
1117{{ #if this.firstResultPending }}
1218 <h2 >Loading search results...</h2 >
1319{{ else if this.dataTask.lastComplete.error}}
Original file line number Diff line number Diff line change 1- const CATEGORY_PREFIX = 'category:' ;
1+ export const CATEGORY_PREFIX = 'category:' ;
22const KEYWORD_PREFIX = 'keyword:' ;
33
44/**
You can’t perform that action at this time.
0 commit comments