Skip to content

Commit

Permalink
fix: event sort by name to actually sort by name (#3552)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoJesus94 authored and iamareebjamal committed Dec 5, 2019
1 parent 45018cf commit e7929ff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/events/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
return [
{
name : 'Name',
valuePath : 'id',
valuePath : 'name',
extraValuePaths : ['logoUrl', 'identifier', 'deletedAt', 'name'],
isSortable : true,
headerComponent : 'tables/headers/sort',
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/events/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
return [
{
name : 'Name',
valuePath : 'identifier',
valuePath : 'name',
width : 150,
isSortable : true,
extraValuePaths : ['name', 'logoUrl'],
extraValuePaths : ['identifier', 'logoUrl'],
headerComponent : 'tables/headers/sort',
cellComponent : 'ui-table/cell/cell-event-general',
options : {
Expand Down
8 changes: 4 additions & 4 deletions app/templates/components/ui-table/cell/cell-event-general.hbs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<div class="ui header weight-400">
<img src="{{if extraRecords.logoUrl extraRecords.logoUrl '/images/placeholders/Other.jpg'}}" alt="Event Logo" class="ui image"> <br> {{extraRecords.name}}
<img src="{{if extraRecords.logoUrl extraRecords.logoUrl '/images/placeholders/Other.jpg'}}" alt="Event Logo" class="ui image"> <br> {{record}}
</div>
<div class="ui horizontal large basic buttons">
{{#ui-popup tagName='a' click=(action props.actions.moveToDetails record) content=(t 'Event Dashboard') class='ui icon button' position='top center'}}
{{#ui-popup tagName='a' click=(action props.actions.moveToDetails extraRecords.identifier) content=(t 'Event Dashboard') class='ui icon button' position='top center'}}
<i class="tasks icon"></i>
{{/ui-popup}}
{{#ui-popup tagName='a' click=(action props.actions.moveToPublic record) content=(t 'View') class='ui icon button' position='top center'}}
{{#ui-popup tagName='a' click=(action props.actions.moveToPublic extraRecords.identifier) content=(t 'View') class='ui icon button' position='top center'}}
<i class="unhide icon"></i>
{{/ui-popup}}
{{#ui-popup content=(t 'Edit') click=(action props.actions.editEvent record) class='ui icon button' position='top center'}}
{{#ui-popup content=(t 'Edit') click=(action props.actions.editEvent extraRecords.identifier) class='ui icon button' position='top center'}}
<i class="edit icon"></i>
{{/ui-popup}}
</div>
6 changes: 3 additions & 3 deletions app/templates/components/ui-table/cell/cell-event.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="ui header weight-400">
<img src="{{if extraRecords.logoUrl extraRecords.logoUrl '/images/placeholders/Other.jpg'}}" alt="Event Logo" class="ui image"> <br> {{extraRecords.name}}
<img src="{{if extraRecords.logoUrl extraRecords.logoUrl '/images/placeholders/Other.jpg'}}" alt="Event Logo" class="ui image"> <br> {{record}}
</div>

<div class="ui horizontal compact basic buttons">
Expand All @@ -10,11 +10,11 @@
<i class="edit icon"></i>
{{/ui-popup}}
{{#if (and props.options.hasRestorePrivileges extraRecords.deletedAt)}}
{{#ui-popup content=(t 'Restore') click=(action props.actions.restoreEvent record) class='ui icon button' position='left center'}}
{{#ui-popup content=(t 'Restore') click=(action props.actions.restoreEvent extraRecords.identifier) class='ui icon button' position='left center'}}
<i class="undo icon"></i>
{{/ui-popup}}
{{else}}
{{#ui-popup content=(t 'Delete') click=(action props.actions.openDeleteEventModal extraRecords.identifier extraRecords.name) class='ui icon button' position='left center'}}
{{#ui-popup content=(t 'Delete') click=(action props.actions.openDeleteEventModal extraRecords.identifier record) class='ui icon button' position='left center'}}
<i class="trash outline icon"></i>
{{/ui-popup}}
{{/if}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { render } from '@ember/test-helpers';
module('Integration | Component | ui table/cell/cell event general', function(hooks) {
setupIntegrationTest(hooks);

const extraRecords = { name: 'Event', logoUrl: 'url' };
const record = 'abc215f';
const extraRecords = { identifier: 'abc215f', logoUrl: 'url' };
const record = 'Event';

const props = {
actions: {
Expand Down

0 comments on commit e7929ff

Please sign in to comment.