Skip to content

Commit 6faee34

Browse files
feat: Make search event name specific and add location type filter (#5894)
1 parent aceb1be commit 6faee34

File tree

5 files changed

+96
-17
lines changed

5 files changed

+96
-17
lines changed

app/components/explore/side-bar.js

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ export default class SideBar extends Component {
1616
customEndDate = null;
1717
@tracked showFilters = false;
1818
isMapVisible = true;
19+
eventLocationType = null;
1920

20-
@computed('category', 'sub_category', 'event_type', 'startDate', 'endDate', 'location', 'ticket_type', 'cfs')
21+
@computed('category', 'sub_category', 'event_type', 'startDate', 'endDate', 'location', 'ticket_type', 'cfs', 'event_name', 'is_online')
2122
get hideClearFilters() {
22-
return !(this.category || this.sub_category || this.event_type || this.startDate || this.endDate || this.location || this.ticket_type || this.cfs);
23+
return !(this.category || this.sub_category || this.event_type || this.startDate || this.endDate || this.location || this.ticket_type || this.cfs || this.event_name || this.is_online);
2324
}
2425

2526
@computed('category', 'sub_category')
@@ -47,6 +48,13 @@ export default class SideBar extends Component {
4748
});
4849
}
4950

51+
@action
52+
setLocationType(locationType, val) {
53+
this.set('is_online', this.eventLocationType === locationType ? null : val);
54+
this.set('eventLocationType', this.eventLocationType === locationType ? null : locationType);
55+
this.set('location', null);
56+
}
57+
5058
@action
5159
selectCategory(category, subCategory) {
5260
this.set('category', (category === this.category && !subCategory) ? null : category);
@@ -153,15 +161,18 @@ export default class SideBar extends Component {
153161
@action
154162
clearFilters() {
155163
this.setProperties({
156-
startDate : null,
157-
endDate : null,
158-
dateType : null,
159-
category : null,
160-
sub_category : null,
161-
event_type : null,
162-
location : null,
163-
ticket_type : null,
164-
cfs : null
164+
startDate : null,
165+
endDate : null,
166+
dateType : null,
167+
category : null,
168+
sub_category : null,
169+
event_type : null,
170+
location : null,
171+
ticket_type : null,
172+
cfs : null,
173+
event_name : null,
174+
is_online : null,
175+
eventLocationType : null
165176
});
166177
}
167178

app/controllers/explore.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import Controller from '@ember/controller';
44

55
@classic
66
export default class ExploreController extends Controller {
7-
queryParams = ['category', 'sub_category', 'event_type', 'start_date', 'end_date', 'location', 'ticket_type', 'cfs'];
7+
queryParams = ['category', 'sub_category', 'event_type', 'start_date', 'end_date', 'location', 'ticket_type', 'cfs', 'event_name', 'is_online'];
8+
event_name = null;
9+
is_online = null;
810
category = null;
911
sub_category = null;
1012
event_type = null;
@@ -22,6 +24,12 @@ export default class ExploreController extends Controller {
2224

2325
@action
2426
clearFilter(filterType) {
27+
if (filterType === 'event_name') {
28+
this.set('event_name', null);
29+
}
30+
if (filterType === 'is_online') {
31+
this.set('is_online', null);
32+
}
2533
if (filterType === 'start_date') {
2634
this.set('startDate', null);
2735
}

app/routes/explore.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,28 @@ export default class ExploreRoute extends Route {
7272
}
7373
});
7474
}
75-
75+
if (params.is_online) {
76+
filterOptions.push({
77+
name : 'online',
78+
op : 'eq',
79+
val : params.is_online
80+
});
81+
}
7682
if (params.location) {
7783
filterOptions.push({
7884
name : 'location_name',
7985
op : 'ilike',
8086
val : `%${params.location}%`
8187
});
8288
}
89+
if (params.event_name) {
90+
filterOptions.push({
91+
name : 'name',
92+
op : 'ilike',
93+
val : `%${params.event_name}%`
94+
});
95+
}
96+
8397
if (params.cfs) {
8498
filterOptions.push({
8599
name : 'is_sessions_speakers_enabled',

app/templates/components/explore/side-bar.hbs

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,59 @@
11
<div class="item">
22
<div class="ui input">
33
<Input
4-
@name="location"
5-
@value={{this.location}}
4+
@name="name"
5+
@value={{this.event_name}}
66
@type="text"
7-
@placeholder={{t "Enter Location"}} />
7+
@placeholder={{t "Enter Event Name"}} />
88
</div>
99
</div>
1010
{{#if this.showFiltersOnMobile}}
11+
<div class="item">
12+
<UiAccordion>
13+
<span class="title">
14+
<i class="dropdown icon"></i>
15+
{{t 'Event Location Type' }}
16+
</span>
17+
<div class="content menu">
18+
<div class="ui form">
19+
<div class="grouped fields">
20+
<div class="field">
21+
<UiCheckbox
22+
@label={{t "Online"}}
23+
@class="ui checkbox"
24+
@checked={{if (eq this.eventLocationType "online") "active"}}
25+
@onChange={{action "setLocationType" "online" "true"}} />
26+
</div>
27+
<div class="field">
28+
<UiCheckbox
29+
@label={{t "Location"}}
30+
@class="ui checkbox"
31+
@checked={{if (eq this.eventLocationType "venue") "active"}}
32+
@onChange={{action "setLocationType" "venue" "false"}} />
33+
</div>
34+
<div class="field">
35+
<UiCheckbox
36+
@label={{t "Mixed"}}
37+
@class="ui checkbox"
38+
@checked={{if (eq this.eventLocationType "mixed") "active"}}
39+
@onChange={{action "setLocationType" "mixed" "true"}} />
40+
</div>
41+
{{#if (or (eq this.eventLocationType "venue") (eq this.eventLocationType "mixed"))}}
42+
<div class="explore sub menu">
43+
<div class="ui input">
44+
<Input
45+
@name="location"
46+
@value={{this.location}}
47+
@type="text"
48+
@placeholder={{t "Enter Location"}} />
49+
</div>
50+
</div>
51+
{{/if}}
52+
</div>
53+
</div>
54+
</div>
55+
</UiAccordion>
56+
</div>
1157
<div class="item">
1258
<UiAccordion>
1359
<span class="title">

app/templates/explore.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="ui stackable grid">
22
<div class="three wide column">
3-
<Explore::SideBar @model={{this.model}} @category={{this.category}} @sub_category={{this.sub_category}} @event_type={{this.event_type}} @startDate={{this.start_date}} @endDate={{this.end_date}} @location={{this.location}} @ticket_type={{this.ticket_type}} @cfs={{this.cfs}} />
3+
<Explore::SideBar @model={{this.model}} @category={{this.category}} @sub_category={{this.sub_category}} @event_type={{this.event_type}} @startDate={{this.start_date}} @endDate={{this.end_date}} @event_name={{this.event_name}} @is_online={{this.is_online}} @location={{this.location}} @ticket_type={{this.ticket_type}} @cfs={{this.cfs}} />
44
</div>
55
<div class="thirteen wide column">
66
<h1 class="ui header">{{t 'Events'}}</h1>

0 commit comments

Comments
 (0)