Skip to content

Commit 46d42a0

Browse files
authored
Merge branch 'development' into 7
2 parents cc83484 + 9795fb7 commit 46d42a0

File tree

18 files changed

+110
-106
lines changed

18 files changed

+110
-106
lines changed

app/adapters/discount-code.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import ApplicationAdapter from './application';
2+
import ENV from 'open-event-frontend/config/environment';
3+
4+
export default ApplicationAdapter.extend({
5+
6+
urlForQueryRecord(query) {
7+
if (query && query.code && query.eventIdentifier) {
8+
return `${ENV.APP.apiHost}/v1/events/${query.eventIdentifier}/discount-codes/${query.code}`;
9+
} else {
10+
return this._super(...arguments);
11+
}
12+
}
13+
});
Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
import Component from '@ember/component';
2+
import { action } from '@ember/object';
23

3-
export default Component.extend({
4-
});
4+
export default class extends Component {
5+
@action
6+
async exportEventDownload(eventDownloadUrl) {
7+
this.set('isLoading', true);
8+
try {
9+
const res = await this.loader.downloadFile(`${eventDownloadUrl}`);
10+
const anchor = document.createElement('a');
11+
anchor.style.display = 'none';
12+
anchor.href = URL.createObjectURL(new Blob([res], { type: 'octet/stream' }));
13+
anchor.download = 'EventExport.zip';
14+
anchor.click();
15+
this.notify.success(this.l10n.t('Exported Event Downloaded successfully.'));
16+
} catch (e) {
17+
console.error(e);
18+
this.notify.error(this.l10n.t(e));
19+
}
20+
this.set('isLoading', false);
21+
}
22+
23+
}

app/components/forms/admin/settings/billing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default class extends Component.extend(FormMixin) {
4747
rules : [
4848
{
4949
type : 'empty',
50-
prompt : this.l10n.t('Please enter the country')
50+
prompt : this.l10n.t('Please select the country')
5151
}
5252
]
5353
},
Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
import Component from '@ember/component';
22
import { computed } from '@ember/object';
33
import { groupBy } from 'lodash-es';
4+
import { or } from '@ember/object/computed';
45

5-
export default Component.extend({
6-
buyer: computed('data.user', function() {
7-
return this.get('data.user');
8-
}),
9-
holders: computed('data.attendees', function() {
10-
return this.get('data.attendees');
11-
}),
12-
isPaidOrder: computed('data', function() {
13-
if (!this.get('data.amount')) {
14-
return false;
15-
}
16-
return true;
17-
}),
18-
allFields: computed('fields', function() {
19-
return groupBy(this.fields.toArray(), field => field.get('form'));
20-
})
21-
});
6+
export default class extends Component {
7+
@computed('data.user')
8+
get buyer() {
9+
return this.data.user;
10+
}
11+
12+
@computed('data.attendees')
13+
get holders() {
14+
return this.data.attendees;
15+
}
16+
17+
@or('data.amount', 'data.isBillingEnabled')
18+
showBillingInfo;
19+
20+
@computed('[email protected]')
21+
get allFields() {
22+
return groupBy(this.fields.toArray(), field => field.form);
23+
}
24+
}

app/components/public/ticket-list.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export default Component.extend(FormMixin, {
6262
total: computed('[email protected]', '[email protected]', '[email protected]', function() {
6363
if (this.taxInfo !== null) {
6464
return sumBy(this.tickets.toArray(),
65-
ticket => (ticket.ticketPriceWithTax || 0) * (ticket.orderQuantity || 0)
65+
ticket => ((ticket.ticketPriceWithTax || 0) - (ticket.discount || 0)) * (ticket.orderQuantity || 0)
6666
);
6767
}
6868
return sumBy(this.tickets.toArray(),
@@ -123,9 +123,7 @@ export default Component.extend(FormMixin, {
123123
this.set('invalidPromotionalCode', true);
124124
}
125125
try {
126-
let discountCode = await this.store.findRecord('discount-code', this.promotionalCode, {
127-
include: 'tickets'
128-
});
126+
let discountCode = await this.store.queryRecord('discount-code', { eventIdentifier: this.event.id, code: this.promotionalCode });
129127
let discountCodeEvent = await discountCode.get('event');
130128
if (this.currentEventIdentifier === discountCodeEvent.identifier) {
131129
let discountType = discountCode.get('type');
@@ -151,6 +149,7 @@ export default Component.extend(FormMixin, {
151149
this.set('invalidPromotionalCode', true);
152150
}
153151
} catch (e) {
152+
console.warn(e);
154153
if (this.invalidPromotionalCode) {
155154
this.set('invalidPromotionalCode', true);
156155
}

app/controllers/admin/events/list.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
1818
isSortable : true,
1919
headerComponent : 'tables/headers/sort',
2020
cellComponent : 'ui-table/cell/cell-event',
21+
width : 180,
2122
options : {
2223
hasRestorePrivileges: this.hasRestorePrivileges
2324
},
@@ -35,7 +36,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
3536
isSortable : true,
3637
headerComponent : 'tables/headers/sort',
3738
cellComponent : 'ui-table/cell/cell-simple-date',
38-
width : 40,
39+
width : 65,
3940
options : {
4041
dateFormat: 'MMMM DD, YYYY - hh:mm A'
4142
}
@@ -46,7 +47,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
4647
isSortable : true,
4748
headerComponent : 'tables/headers/sort',
4849
cellComponent : 'ui-table/cell/cell-simple-date',
49-
width : 40,
50+
width : 65,
5051
options : {
5152
dateFormat: 'MMMM DD, YYYY - hh:mm A'
5253
}
@@ -56,26 +57,27 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
5657
valuePath : 'state',
5758
isSortable : true,
5859
headerComponent : 'tables/headers/sort',
59-
width : 50
60+
width : 80
6061
},
6162
{
6263
name : 'Roles',
6364
valuePath : 'owner',
6465
extraValuePaths : ['organizers', 'coorganizers', 'trackOrganizers', 'registrars', 'moderators'],
65-
cellComponent : 'ui-table/cell/cell-roles'
66+
cellComponent : 'ui-table/cell/cell-roles',
67+
width : 185
6668
},
6769
{
6870
name : 'Sessions',
6971
valuePath : 'eventStatisticsGeneral',
7072
cellComponent : 'ui-table/cell/cell-sessions',
71-
width : 60
73+
width : 90
7274

7375
},
7476
{
7577
name : 'Speakers',
7678
valuePath : 'eventStatisticsGeneral',
7779
cellComponent : 'ui-table/cell/cell-speakers-dashboard',
78-
width : 60
80+
width : 90
7981
},
8082
{
8183
name : 'Tickets',
@@ -85,14 +87,15 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
8587
{
8688
name : 'Public URL',
8789
valuePath : 'url',
88-
cellComponent : 'ui-table/cell/cell-link'
90+
cellComponent : 'ui-table/cell/cell-link',
91+
width : 220
8992
},
9093
{
9194
name : 'Featured Event',
9295
valuePath : 'id',
9396
extraValuePaths : ['isFeatured'],
9497
cellComponent : 'ui-table/cell/admin/event-is-featured',
95-
width : 40,
98+
width : 80,
9699
actions : {
97100
toggleFeatured: this.toggleFeatured.bind(this)
98101
}

app/controllers/admin/users/list.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
1515
valuePath : 'id',
1616
extraValuePaths : ['firstName', 'deletedAt'],
1717
cellComponent : 'ui-table/cell/admin/users/cell-first-name',
18+
width : 155,
1819
options : {
1920
hasRestorePrivileges: this.hasRestorePrivileges
2021
},
@@ -24,47 +25,38 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
2425
openEditModal : this.openEditModal.bind(this),
2526
restoreUser : this.restoreUser.bind(this)
2627
}
27-
2828
},
2929
{
3030
name : 'Email',
31-
valuePath : 'email'
32-
33-
31+
valuePath : 'email',
32+
width : 160
3433
},
3534
{
3635
name : 'Status',
3736
valuePath : 'status',
3837
cellComponent : 'ui-table/cell/admin/users/cell-status'
39-
40-
4138
},
4239
{
4340
name : 'System Roles',
4441
valuePath : 'isSuperAdmin',
4542
extraValuePaths : ['isAdmin', 'isVerified'],
4643
cellComponent : 'ui-table/cell/admin/users/cell-system-roles'
47-
48-
4944
},
5045
{
5146
name : 'Event Roles',
5247
valuePath : 'isSuperAdmin',
48+
width : 260,
5349
extraValuePaths : ['isAdmin', 'isUserOwner', 'ownerEvents',
5450
'isUserOrganizer', 'organizerEvents', 'isUserCoorganizer', 'coorganizerEvents',
5551
'isUserTrackOrganizer', 'trackOrganizerEvents', 'isUserRegistrar', 'registrarEvents',
5652
'isUserModerator', 'moderatorEvents', 'isMarketer', 'marketerEvents', 'isSalesAdmin',
5753
'salesAdminEvents'],
5854
cellComponent: 'ui-table/cell/admin/users/cell-event-roles'
59-
60-
6155
},
6256
{
6357
name : 'User Links',
6458
valuePath : 'id',
6559
cellComponent : 'ui-table/cell/admin/users/cell-user-links'
66-
67-
6860
},
6961
{
7062
name : 'Member Since',

app/controllers/admin/users/view/events/list.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
1717
isSortable : true,
1818
headerComponent : 'tables/headers/sort',
1919
cellComponent : 'ui-table/cell/cell-event',
20+
width : 160,
2021
options : {
2122
hasRestorePrivileges: this.hasRestorePrivileges
2223
},
@@ -40,7 +41,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
4041
{
4142
name : 'Sessions',
4243
valuePath : 'eventStatisticsGeneral',
43-
width : 80,
44+
width : 90,
4445
isSortable : false,
4546
cellComponent : 'ui-table/cell/cell-sessions-dashboard'
4647
},
@@ -62,6 +63,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
6263
name : 'Public URL',
6364
valuePath : 'url',
6465
cellComponent : 'ui-table/cell/cell-link',
66+
width : 240,
6567
isSortable : false
6668
}
6769
];

app/controllers/events/list.js

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
99
return [
1010
{
1111
name : 'Name',
12-
valuePath : 'name',
12+
valuePath : 'identifier',
1313
width : 150,
1414
isSortable : true,
15-
extraValuePaths : ['startsAt', 'endAt'],
15+
extraValuePaths : ['name', 'logoUrl'],
1616
headerComponent : 'tables/headers/sort',
1717
cellComponent : 'ui-table/cell/cell-event-general',
1818
options : {
@@ -27,65 +27,43 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
2727
{
2828
name : 'Date',
2929
valuePath : 'startsAt',
30+
extraValuePaths : ['endsAt'],
3031
isSortable : true,
3132
headerComponent : 'tables/headers/sort',
3233
cellComponent : 'ui-table/cell/cell-event-date'
3334

3435
},
3536
{
36-
name : 'Roles',
37-
valuePath : 'roles',
38-
width : 180,
39-
cellComponent : 'ui-table/cell/cell-roles',
40-
isSortable : false
37+
name : 'Roles',
38+
valuePath : 'owner',
39+
extraValuePaths : ['organizers', 'coorganizers', 'trackOrganizers', 'registrars', 'moderators'],
40+
width : 180,
41+
cellComponent : 'ui-table/cell/cell-roles'
4142
},
4243
{
4344
name : 'Sessions',
44-
valuePath : 'sessions',
45-
isSortable : false,
45+
valuePath : 'eventStatisticsGeneral',
4646
cellComponent : 'ui-table/cell/cell-sessions-dashboard'
4747
},
4848
{
4949
name : 'Speakers',
50-
valuePath : 'speakers',
51-
cellComponent : 'ui-table/cell/cell-speakers-dashboard',
52-
isSortable : false
53-
50+
valuePath : 'eventStatisticsGeneral',
51+
cellComponent : 'ui-table/cell/cell-speakers-dashboard'
5452
},
5553
{
5654
name : 'Tickets',
5755
valuePath : 'tickets',
58-
cellComponent : 'ui-table/cell/cell-tickets',
59-
isSortable : false
60-
56+
cellComponent : 'ui-table/cell/cell-tickets'
6157
},
6258
{
6359
name : 'Public URL',
6460
valuePath : 'url',
6561
width : 250,
66-
cellComponent : 'ui-table/cell/cell-link',
67-
isSortable : false
62+
cellComponent : 'ui-table/cell/cell-link'
6863
}
6964
];
7065
}
7166

72-
@computed('model.data')
73-
get rows() {
74-
const rows = [];
75-
this.model.data.forEach(row => {
76-
rows.pushObject({
77-
name : row,
78-
startsAt : row,
79-
roles : row,
80-
sessions : row,
81-
speakers : row,
82-
tickets : row,
83-
url : row
84-
});
85-
});
86-
return rows;
87-
}
88-
8967
@action
9068
moveToPublic(id) {
9169
this.transitionToRoute('public', id);

app/routes/events/list.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,7 @@ export default class extends Route.extend(EmberTableRouteMixin) {
8989
'page[number]' : params.page || 4
9090
};
9191
queryString = this.applySortFilters(queryString, params);
92-
93-
return {
94-
data: await this.authManager.currentUser.query('events', queryString)
95-
};
96-
92+
return this.asArray(this.authManager.currentUser.query('events', queryString));
9793
}
9894

9995
@action

0 commit comments

Comments
 (0)