Skip to content

Commit 61e2693

Browse files
authored
Merge branch 'development' into cfs-editspeaker
2 parents 3a59eb4 + b2017b3 commit 61e2693

Some content is hidden

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

59 files changed

+3825
-3454
lines changed

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

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import Component from '@ember/component';
2+
import { computed } from '@ember/object';
23
import FormMixin from 'open-event-frontend/mixins/form';
34

45
export default Component.extend(FormMixin, {
5-
autoScrollToErrors: false,
6+
autoScrollToErrors : false,
7+
showPasswordForm : false,
8+
9+
nextStep: computed('userExists', 'showPasswordForm', function() {
10+
return this.userExists || this.showPasswordForm;
11+
}),
612

713
getValidationRules() {
814
return {
@@ -23,12 +29,27 @@ export default Component.extend(FormMixin, {
2329
}
2430
]
2531
},
32+
2633
password: {
2734
identifier : 'password',
2835
rules : [
2936
{
3037
type : 'empty',
3138
prompt : this.l10n.t('Please enter your password')
39+
},
40+
{
41+
type : 'minLength[8]',
42+
prompt : this.l10n.t('Your password must have at least {ruleValue} characters')
43+
}
44+
]
45+
},
46+
47+
passwordRepeat: {
48+
identifier : 'password_repeat',
49+
rules : [
50+
{
51+
type : 'match[password]',
52+
prompt : this.l10n.t('Passwords do not match')
3253
}
3354
]
3455
}
@@ -37,13 +58,24 @@ export default Component.extend(FormMixin, {
3758
},
3859
actions: {
3960
submit() {
40-
this.onValid(() => {
61+
this.onValid(async() => {
4162
if (this.userExists) {
4263
this.loginExistingUser(this.email, this.password);
64+
} else if (this.password) {
65+
this.createNewUserViaEmail(this.email, this.password);
4366
} else {
44-
this.createNewUserViaEmail(this.email);
67+
const result = await this.loader.post('users/check_email', { email: this.email });
68+
this.set('userExists', result.exists);
69+
if (!result.exists) {
70+
this.set('showPasswordForm', true);
71+
}
4572
}
4673
});
74+
},
75+
reset() {
76+
this.set('userExists', false);
77+
this.set('showPasswordForm', false);
78+
this.set('password', null);
4779
}
4880
}
4981
});

app/components/forms/wizard/custom-form-input.hbs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<div class="ui hidden divider"></div>
2-
<h3 class="ui dividing header">
2+
<div class="ui dividing">
33
<i class="checkmark box icon"></i>
4-
<div class="content">
4+
<span class="content">
55
{{t 'Add Custom Form Field'}}
6-
</div>
7-
</h3>
6+
</span>
7+
</div>
88
<div {{did-update this.updated @field}} class="ui action input" style="width: inherit;">
99
<Input type="text" placeholder="Field Name" @value={{this.name}} />
1010
<UiDropdown class="ui selection dropdown" @selected={{this.type}} @onChange={{action (mut this.type)}}>

app/components/modals/tax-info-modal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { countries } from 'open-event-frontend/utils/dictionary/demography';
66
import { orderBy } from 'lodash-es';
77

88
export default ModalBase.extend(FormMixin, {
9-
isSmall : false,
9+
isSmall: false,
1010

1111
autoScrollToErrors : true,
1212
isTaxIncludedInPrice : 'include',

app/components/nav-bar.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import classic from 'ember-classic-decorator';
2-
import { action } from '@ember/object';
2+
import { action, computed } from '@ember/object';
33
import Component from '@ember/component';
44

55
@classic
66
export default class NavBar extends Component {
7+
@computed('session.currentRouteName')
8+
get isNotEventPageRoute() {
9+
return !(String(this.session.currentRouteName).includes('public'));
10+
}
11+
712
@action
813
logout() {
914
this.authManager.logout();
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div class="ui list basic segment m-0 pb-0">
2+
<div class="item">
3+
<i class="clock alternate outline icon pt-1"></i>
4+
<div class="content">
5+
{{#if this.isSingleDay}}
6+
{{general-date @event.startsAt @event.timezone "dddd, MMMM DD, YYYY"}}<br>{{general-date @event.startsAt @event.timezone "h:mm A"}} {{t 'to'}} {{general-date @event.endsAt @event.timezone "h:mm A"}}
7+
{{else}}
8+
{{general-date @event.startsAt @event.timezone "dddd, MMMM DD, YYYY h:mm A"}} {{t 'to'}} {{general-date @event.endsAt @event.timezone "dddd, MMMM DD, YYYY h:mm A"}}
9+
{{/if}}
10+
({{this.timezone}})
11+
<br>
12+
<a href={{this.calendarUrl}} target="_blank" rel="noreferrer nofollow">{{t 'Add to Google Calendar'}}</a>
13+
</div>
14+
</div>
15+
</div>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import Component from '@glimmer/component';
2+
import moment, { Moment } from 'moment';
3+
import Event from 'open-event-frontend/models/event';
4+
5+
interface Args {
6+
event: Event,
7+
location: string
8+
}
9+
10+
export default class AddToCalender extends Component<Args> {
11+
12+
get timezone(): string {
13+
return moment.tz(this.args.event.timezone).format('z');
14+
}
15+
16+
get startsAt(): Moment {
17+
const { event } = this.args;
18+
return moment(event.startsAt).tz(event.timezone);
19+
}
20+
21+
get endsAt(): Moment {
22+
const { event } = this.args;
23+
return moment(event.endsAt).tz(event.timezone);
24+
}
25+
26+
get isSingleDay(): boolean {
27+
return this.startsAt.isSame(this.endsAt, 'day');
28+
}
29+
30+
get calendarUrl(): string {
31+
const { event } = this.args;
32+
const startTime = this.startsAt.utc().format('YYYYMMDD[T]HHmmSS[Z]');
33+
const endTime = this.endsAt.utc().format('YYYYMMDD[T]HHmmSS[Z]');
34+
return `https://calendar.google.com/calendar/render?action=TEMPLATE&dates=${startTime}/${endTime}&text=${event.name}&location=${this.args.location}&ctz=${event.timezone}&details=${event.description}`;
35+
}
36+
37+
}

app/components/public/social-links.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Component from '@ember/component';
33
import { computed } from '@ember/object';
44

55
export default Component.extend({
6-
classNames: ['ui', 'basic', 'segment'],
6+
classNames: ['ui', 'basic', 'segment', 'm-0', 'pt-0'],
77

88
socialLinks: A(),
99

app/controllers/events/view/speakers/list.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
1515
{
1616
name : 'Name',
1717
valuePath : 'name',
18-
extraValuePaths : ['id'],
18+
extraValuePaths : ['id', 'event'],
1919
isSortable : true,
2020
headerComponent : 'tables/headers/sort',
2121
cellComponent : 'ui-table/cell/events/view/speakers/cell-buttons',
@@ -90,8 +90,8 @@ export default class extends Controller.extend(EmberTableControllerMixin) {
9090
}
9191

9292
@action
93-
viewSpeaker(id) {
94-
this.transitionToRoute('events.view.speakers.edit', id);
93+
viewSpeaker(speaker) {
94+
this.transitionToRoute('public.speaker.view', speaker.event.get('identifier'), speaker.id);
9595
}
9696

9797
@action

app/controllers/events/view/tickets/add-order.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ export default class AddOrderController extends Controller {
2020
const { orderInput } = this;
2121
try {
2222
const order = await this.loader.post('/orders/create-order', orderInput);
23-
this.notify.success(this.l10n.t(`Order details saved. Please fill further details within ${this.settings.orderExpiryTime} minutes.`));
23+
this.notify.success(this.l10n.t('Order details saved. Please fill further details within {{time}} minutes.', {
24+
time: this.settings.orderExpiryTime
25+
}));
2426
this.transitionToRoute('orders.new', order.data.attributes.identifier);
2527
} catch (e) {
2628
console.error('Error while saving order', e);

app/controllers/public/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ export default class IndexController extends Controller {
1616
}
1717

1818
@action
19-
async createNewUserViaEmail(email) {
19+
async createNewUserViaEmail(email, password) {
2020
this.set('isLoading', true);
2121
const newUser = this.store.createRecord('user', {
2222
email,
23-
'password' : (Math.random() * 10).toString(16),
24-
'wasRegisteredWithOrder' : true
23+
password,
24+
'wasRegisteredWithOrder': true
2525
});
2626
newUser.save()
2727
.then(() => {

0 commit comments

Comments
 (0)