Skip to content

Commit 2585786

Browse files
chore: Release v1.6.0 (#3724)
chore: Release v1.6.0
2 parents eccace3 + 8f941ec commit 2585786

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+1673
-1335
lines changed

app/components/forms/events/view/create-discount-code.js

+1-46
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { computed } from '@ember/object';
33
import FormMixin from 'open-event-frontend/mixins/form';
44
import { later } from '@ember/runloop';
55
import { currencySymbol } from 'open-event-frontend/helpers/currency-symbol';
6-
import moment from 'moment';
76
export default Component.extend(FormMixin, {
87
getValidationRules() {
98
window.$.fn.form.settings.rules.checkMaxMin = () => {
@@ -22,11 +21,7 @@ export default Component.extend(FormMixin, {
2221
return false;
2322
};
2423

25-
window.$.fn.form.settings.rules.checkDates = () => {
26-
let startDatetime = moment(this.get('data.validFrom'));
27-
let endDatetime = moment(this.get('data.validTill'));
28-
return (endDatetime.diff(startDatetime, 'minutes') > 0);
29-
};
24+
// TODO: Removing the Discount Code Time Validations due to the weird and buggy behaviour. Will be restored once a perfect solution is found. Please check issue: https://github.com/fossasia/open-event-frontend/issues/3667
3025
return {
3126
inline : true,
3227
delay : false,
@@ -113,46 +108,6 @@ export default Component.extend(FormMixin, {
113108
prompt : this.l10n.t('Please select atleast 1 ticket.')
114109
}
115110
]
116-
},
117-
startDate: {
118-
optional : true,
119-
identifier : 'start_date',
120-
rules : [
121-
{
122-
type : 'checkDates',
123-
prompt : this.l10n.t('Valid Till date & time should be after valid from date and time')
124-
}
125-
]
126-
},
127-
startTime: {
128-
optional : true,
129-
identifier : 'start_time',
130-
rules : [
131-
{
132-
type : 'checkDates',
133-
prompt : '.'
134-
}
135-
]
136-
},
137-
endDate: {
138-
optional : true,
139-
identifier : 'end_date',
140-
rules : [
141-
{
142-
type : 'checkDates',
143-
prompt : this.l10n.t('Valid Till date & time should be after valid from date and time')
144-
}
145-
]
146-
},
147-
endTime: {
148-
optional : true,
149-
identifier : 'end_time',
150-
rules : [
151-
{
152-
type : 'checkDates',
153-
prompt : '.'
154-
}
155-
]
156111
}
157112
}
158113
};

app/components/forms/orders/attendee-list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default class extends Component {
1414
return this.data.attendees;
1515
}
1616

17-
@or('data.amount', 'data.isBillingEnabled')
17+
@or('event.isBillingInfoMandatory', 'data.isBillingEnabled')
1818
showBillingInfo;
1919

2020
@computed('fields.@each.form')

app/components/forms/orders/order-form.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ export default Component.extend(FormMixin, {
3838
}),
3939
sameAsBuyer: false,
4040

41+
isBillingInfoNeeded: computed('event', 'data.isBillingEnabled', function() {
42+
return this.event.isBillingInfoMandatory || this.data.isBillingEnabled;
43+
}),
44+
4145
getRemainingTime: computed('settings', function() {
4246
let orderExpiryTime = this.get('settings.orderExpiryTime');
4347
let willExpireAt = this.get('data.createdAt').add(orderExpiryTime, 'minutes');
@@ -380,12 +384,12 @@ export default Component.extend(FormMixin, {
380384
}
381385
]
382386
},
383-
company: {
384-
identifier : 'company',
387+
taxBusinessInfo: {
388+
identifier : 'taxBusinessInfo',
385389
rules : [
386390
{
387391
type : 'empty',
388-
prompt : this.l10n.t('Please enter your company')
392+
prompt : this.l10n.t('Please enter your Tax ID or Business ID')
389393
}
390394
]
391395
},
@@ -490,4 +494,4 @@ export default Component.extend(FormMixin, {
490494
}
491495
}
492496
}
493-
});
497+
});

app/components/forms/session-speaker-form.js

+9
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,15 @@ export default Component.extend(FormMixin, {
501501
return this.speakers.length === 1;
502502
}),
503503

504+
isUserOwnerOrAdmin: computed('event.owner.email', 'authManager.currentUser', function() {
505+
return (this.authManager.currentUser.isAnAdmin || (this.event.owner.get('email') === this.authManager.currentUser.get('email')));
506+
}),
507+
508+
isUserOrganiser: computed('event.organizers', 'authManager.currentUser', function() {
509+
let { currentUser } = this.authManager;
510+
return this.event.organizers.includes(currentUser);
511+
}),
512+
504513
// Clicking on the add speaker button creates a blank record which increases the length of the session's list by 1.
505514
noSessionExists: computed('sessions', function() {
506515
return this.sessions.length === 1;

app/components/forms/wizard/basic-details-step.js

+1-21
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,8 @@ export default Component.extend(FormMixin, EventWizardMixin, {
125125
}
126126
},
127127

128+
// TODO: Removing the Event Time Validations due to the weird and buggy behaviour. Will be restored once a perfect solution is found. Please check issue: https://github.com/fossasia/open-event-frontend/issues/3667
128129
getValidationRules() {
129-
window.$.fn.form.settings.rules.checkDates = () => {
130-
let startDatetime = moment(this.get('data.event.startsAt'));
131-
let endDatetime = moment(this.get('data.event.endsAt'));
132-
return (endDatetime.diff(startDatetime, 'minutes') > 0);
133-
};
134130

135131
let validationRules = {
136132
inline : true,
@@ -165,10 +161,6 @@ export default Component.extend(FormMixin, EventWizardMixin, {
165161
{
166162
type : 'date',
167163
prompt : this.l10n.t('Please give a valid start date')
168-
},
169-
{
170-
type : 'checkDates',
171-
prompt : this.l10n.t('Start date & time should be before End date and time')
172164
}
173165
]
174166
},
@@ -182,10 +174,6 @@ export default Component.extend(FormMixin, EventWizardMixin, {
182174
{
183175
type : 'date',
184176
prompt : this.l10n.t('Please give a valid end date')
185-
},
186-
{
187-
type : 'checkDates',
188-
prompt : this.l10n.t('Start date & time should be before End date and time')
189177
}
190178
]
191179
},
@@ -196,10 +184,6 @@ export default Component.extend(FormMixin, EventWizardMixin, {
196184
{
197185
type : 'empty',
198186
prompt : this.l10n.t('Please give a start time')
199-
},
200-
{
201-
type : 'checkDates',
202-
prompt : '..'
203187
}
204188
]
205189
},
@@ -210,10 +194,6 @@ export default Component.extend(FormMixin, EventWizardMixin, {
210194
{
211195
type : 'empty',
212196
prompt : this.l10n.t('Please give an end time')
213-
},
214-
{
215-
type : 'checkDates',
216-
prompt : '..'
217197
}
218198
]
219199
},

app/components/forms/wizard/sessions-speakers-step.js

+1-22
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@ import { computed } from '@ember/object';
33
import FormMixin from 'open-event-frontend/mixins/form';
44
import EventWizardMixin from 'open-event-frontend/mixins/event-wizard';
55
import { groupBy } from 'lodash-es';
6-
import moment from 'moment';
76

87
export default Component.extend(EventWizardMixin, FormMixin, {
98

9+
// TODO: Removing the Session & Speaker Time Validations due to the weird and buggy behaviour. Will be restored once a perfect solution is found. Please check issue: https://github.com/fossasia/open-event-frontend/issues/3667
1010
getValidationRules() {
11-
window.$.fn.form.settings.rules.checkDates = () => {
12-
let startDatetime = moment(this.get('data.speakersCall.startsAt'));
13-
let endDatetime = moment(this.get('data.speakersCall.endsAt'));
14-
return (endDatetime.diff(startDatetime, 'minutes') > 0);
15-
};
1611
return {
1712
inline : true,
1813
delay : false,
@@ -60,10 +55,6 @@ export default Component.extend(EventWizardMixin, FormMixin, {
6055
{
6156
type : 'empty',
6257
prompt : this.l10n.t('Please tell us when your event starts')
63-
},
64-
{
65-
type : 'checkDates',
66-
prompt : this.l10n.t('Start date & time ')
6758
}
6859
]
6960
},
@@ -73,10 +64,6 @@ export default Component.extend(EventWizardMixin, FormMixin, {
7364
{
7465
type : 'empty',
7566
prompt : this.l10n.t('Please tell us when your event ends')
76-
},
77-
{
78-
type : 'checkDates',
79-
prompt : this.l10n.t('Start date & time should be after End date and time')
8067
}
8168
]
8269
},
@@ -87,10 +74,6 @@ export default Component.extend(EventWizardMixin, FormMixin, {
8774
{
8875
type : 'empty',
8976
prompt : this.l10n.t('Please give a start time')
90-
},
91-
{
92-
type : 'checkDates',
93-
prompt : '.'
9477
}
9578
]
9679
},
@@ -101,10 +84,6 @@ export default Component.extend(EventWizardMixin, FormMixin, {
10184
{
10285
type : 'empty',
10386
prompt : this.l10n.t('Please give an end time')
104-
},
105-
{
106-
type : 'checkDates',
107-
prompt : '.'
10887
}
10988
]
11089
}
+17-17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import ModalBase from 'open-event-frontend/components/modals/modal-base';
2-
3-
export default ModalBase.extend({
2+
import { action } from '@ember/object';
3+
export default class extends ModalBase {
44
onVisible() {
55
let viewport = {};
66
let factor = 150;
@@ -16,27 +16,27 @@ export default ModalBase.extend({
1616
height: 250
1717
}
1818
});
19-
},
19+
}
2020

2121
onHide() {
2222
this.$('img').croppie('destroy');
2323
const $img = this.$('img');
2424
if ($img.parent().is('div.croppie')) {
2525
$img.unwrap();
2626
}
27-
},
2827

29-
actions: {
30-
resetImage() {
31-
this.onHide();
32-
this.onVisible();
33-
},
34-
cropImage() {
35-
this.$('img').croppie('result', 'base64', 'original', 'jpeg').then(result => {
36-
if (this.onImageCrop) {
37-
this.onImageCrop(result);
38-
}
39-
});
40-
}
4128
}
42-
});
29+
@action
30+
resetImage() {
31+
this.onHide();
32+
this.onVisible();
33+
}
34+
@action
35+
cropImage() {
36+
this.$('img').croppie('result', { type: 'base64', size: 'original', quality: 1, format: 'jpeg' }).then(result => {
37+
if (this.onImageCrop) {
38+
this.onImageCrop(result);
39+
}
40+
});
41+
}
42+
}

app/components/paypal-button.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import paypal from 'paypal-checkout';
21
import Component from '@ember/component';
32
import { inject as service } from '@ember/service';
43

@@ -8,6 +7,8 @@ export default Component.extend({
87

98
async didInsertElement() {
109
this._super(...arguments);
10+
const paypal = await import('paypal-checkout');
11+
1112
if (this.paymentFor === 'order') {
1213
let order = this.data;
1314
let createPayload = {

app/controllers/account/password.js

+37-35
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
import Controller from '@ember/controller';
2+
import { action } from '@ember/object';
23

3-
export default Controller.extend({
4-
actions: {
5-
changePassword(passwordData) {
6-
this.set('isLoading', true);
7-
let payload = {
8-
'data': {
9-
'old-password' : passwordData.passwordCurrent,
10-
'new-password' : passwordData.passwordNew
11-
}
12-
};
13-
this.loader
14-
.post('/auth/change-password', payload)
15-
.then(() => {
16-
this.notify.success(this.l10n.t('Password updated successfully'),
4+
export default class extends Controller {
5+
6+
@action
7+
changePassword(passwordData) {
8+
this.set('isLoading', true);
9+
let payload = {
10+
'data': {
11+
'old-password' : passwordData.passwordCurrent,
12+
'new-password' : passwordData.passwordNew
13+
}
14+
};
15+
this.loader
16+
.post('/auth/change-password', payload)
17+
.then(() => {
18+
this.notify.success(this.l10n.t('Password updated successfully'),
19+
{
20+
id: 'pass_upd_succ'
21+
});
22+
})
23+
.catch(error => {
24+
if (error.errors) {
25+
this.notify.error(this.l10n.t(`${error.errors[0].detail}`),
26+
{
27+
id: 'err_pass_ser'
28+
});
29+
} else {
30+
this.notify.error(this.l10n.t('Unexpected error. Password did not change.'),
1731
{
18-
id: 'pass_upd_succ'
32+
id: 'err_unex_pass'
1933
});
20-
})
21-
.catch(error => {
22-
if (error.errors) {
23-
this.notify.error(this.l10n.t(`${error.errors[0].detail}`),
24-
{
25-
id: 'err_pass_ser'
26-
});
27-
} else {
28-
this.notify.error(this.l10n.t('Unexpected error. Password did not change.'),
29-
{
30-
id: 'err_unex_pass'
31-
});
32-
}
33-
})
34-
.finally(() => {
35-
this.set('isLoading', false);
36-
this.setProperties({ 'passwordCurrent': '', 'passwordNew': '', 'passwordRepeat': '' });
37-
});
38-
}
34+
}
35+
})
36+
.finally(() => {
37+
this.set('isLoading', false);
38+
this.setProperties({ 'passwordCurrent': '', 'passwordNew': '', 'passwordRepeat': '' });
39+
});
3940
}
40-
});
41+
}
42+

0 commit comments

Comments
 (0)