Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/components/tables/utilities/search-box.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import Component from '@ember/component';
import { debounce } from '@ember/runloop';
import { action } from '@ember/object';

export default class extends Component {

debouncePeriod = 1000 // 1 second

setSearchQueryLazily(value) {
this.set('searchQuery', value);
}

@action
setSearchQuery(value) {
debounce(this, this.setSearchQueryLazily, value, this.debouncePeriod);
}

}
5 changes: 0 additions & 5 deletions app/controllers/admin/events/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
cellComponent : 'ui-table/cell/cell-speakers-dashboard',
width : 90
},
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iamareebjamal I think we should comment it out, As ticket statistics have played a crucial role in our tables. We will need it once the DOS issues are resolved?

Copy link
Member Author

@iamareebjamal iamareebjamal Nov 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a git repository, not a college project in a pen drive that something which is needed in the future needs to be commented out instead of deleting. It has the entire history of changes in the repo, any deleted thing can be recovered.

We will need it once the DOS issues are resolved

Then it'll add the DOS issue again. When is it a good idea to fetch unbounded one to many relationships of a list of objects? Answer - Never
If it'll need to be added, it'll be completely reimplemented and definitely not work like it was right now

name : 'Tickets',
valuePath : 'tickets',
cellComponent : 'ui-table/cell/cell-tickets'
},
{
name : 'Public URL',
valuePath : 'url',
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/events/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
valuePath : 'eventStatisticsGeneral',
cellComponent : 'ui-table/cell/cell-speakers-dashboard'
},
{
name : 'Tickets',
valuePath : 'tickets',
cellComponent : 'ui-table/cell/cell-tickets'
},
{
name : 'Public URL',
valuePath : 'url',
Expand Down
3 changes: 1 addition & 2 deletions app/routes/admin/events/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ export default class extends Route.extend(EmberTableRouteMixin) {
}

filterOptions = this.applySearchFilters(filterOptions, params, searchField);

let queryString = {
get_trashed : true,
include : 'tickets,sessions,speakers,owner,organizers,coorganizers,track-organizers,registrars,moderators',
include : 'owner,organizers,coorganizers,track-organizers,registrars,moderators',
filter : filterOptions,
'page[size]' : params.per_page || 10,
'page[number]' : params.page || 1
Expand Down
2 changes: 1 addition & 1 deletion app/routes/events/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default class extends Route.extend(EmberTableRouteMixin) {
}
filterOptions = this.applySearchFilters(filterOptions, params, searchField);
let queryString = {
include : 'tickets,sessions,speakers,owner,organizers,coorganizers,track-organizers,registrars,moderators',
include : 'owner,organizers,coorganizers,track-organizers,registrars,moderators',
filter : filterOptions,
'page[size]' : params.per_page || 10,
'page[number]' : params.page || 4
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/tables/utilities/search-box.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="ui small icon input search-box">
{{input type="text" value=searchQuery placeholder="Search ..." }}
{{input type="text" value=(readonly searchQuery) keyUp=(action 'setSearchQuery' value="target.value") placeholder="Search ..." }}
<i class="search icon"></i>
</div>