Skip to content

Commit 924d319

Browse files
authored
Merge branch 'development' into sidebarfinal
2 parents c69fa87 + 590c525 commit 924d319

File tree

29 files changed

+450
-379
lines changed

29 files changed

+450
-379
lines changed

.github/release-drafter.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name-template: v$NEXT_PATCH_VERSION 🌈
2+
tag-template: v$NEXT_PATCH_VERSION
3+
categories:
4+
- title: 🚀 Features
5+
label: feature
6+
- title: 🐛 Bug Fixes
7+
label: fix
8+
- title: 🧰 Maintenance
9+
label: chore
10+
- title: 🕮 Documentation
11+
label: docs
12+
- title: ⚙ Dependencies and Libraries
13+
label: dependencies
14+
change-template: '- $TITLE (#$NUMBER) - @$AUTHOR'
15+
template: |
16+
## Changes
17+
18+
$CHANGES
19+
20+
## Contributors
21+
22+
Thanks a lot to our contributors for making this release possible:
23+
$CONTRIBUTORS

app/components/forms/events/view/order-form.js

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import Component from '@ember/component';
2+
import FormMixin from 'open-event-frontend/mixins/form';
3+
import { validPhoneNumber } from 'open-event-frontend/utils/validators';
4+
import { pick, orderBy } from 'lodash-es';
5+
import { action, computed } from '@ember/object';
6+
import { countries } from 'open-event-frontend/utils/dictionary/demography';
7+
8+
export default class extends Component.extend(FormMixin) {
9+
didInsertElement() {
10+
super.didInsertElement(...arguments);
11+
this.set('userBillingInfo', pick(this.authManager.currentUser, ['billingContactName', 'billingCity', 'billingPhone', 'company', 'billingTaxInfo', 'billingCountry', 'billingState', 'billingAddress', 'billingZipCode', 'billingAdditionalInfo']));
12+
}
13+
14+
getValidationRules() {
15+
return {
16+
inline : true,
17+
delay : false,
18+
on : 'blur',
19+
20+
fields: {
21+
name: {
22+
identifier : 'contactName',
23+
rules : [
24+
{
25+
type : 'empty',
26+
prompt : this.l10n.t('Please enter your name')
27+
}
28+
]
29+
},
30+
company: {
31+
identifier : 'company',
32+
rules : [
33+
{
34+
type : 'empty',
35+
prompt : this.l10n.t('Please enter your company')
36+
}
37+
]
38+
},
39+
country: {
40+
identifier : 'country',
41+
rules : [
42+
{
43+
type : 'empty',
44+
prompt : this.l10n.t('Please enter your country')
45+
}
46+
]
47+
},
48+
address: {
49+
identifier : 'address',
50+
rules : [
51+
{
52+
type : 'empty',
53+
prompt : this.l10n.t('Please enter your billing address')
54+
}
55+
]
56+
},
57+
city: {
58+
identifier : 'city',
59+
rules : [
60+
{
61+
type : 'empty',
62+
prompt : this.l10n.t('Please enter your billing city')
63+
}
64+
]
65+
},
66+
zipCode: {
67+
identifier : 'zip',
68+
rules : [
69+
{
70+
type : 'empty',
71+
prompt : this.l10n.t('Please enter the zip code')
72+
}
73+
]
74+
},
75+
phone: {
76+
identifier : 'phone',
77+
rules : [
78+
{
79+
type : 'empty',
80+
prompt : this.l10n.t('Please enter a phone number.')
81+
},
82+
{
83+
type : 'regExp',
84+
value : validPhoneNumber,
85+
prompt : this.l10n.t('Please enter a valid phone number.')
86+
}
87+
]
88+
}
89+
}
90+
};
91+
}
92+
93+
@computed()
94+
get countries() {
95+
return orderBy(countries, 'name');
96+
}
97+
98+
@action
99+
submit() {
100+
this.onValid(async() => {
101+
this.set('isLoading', true);
102+
try {
103+
this.authManager.currentUser.setProperties(this.userBillingInfo);
104+
await this.authManager.currentUser.save();
105+
this.notify.success(this.l10n.t('Your billing details has been updated'));
106+
} catch (error) {
107+
this.authManager.currentUser.rollbackAttributes();
108+
this.notify.error(this.l10n.t('An unexpected error occurred'));
109+
}
110+
this.set('isLoading', false);
111+
});
112+
}
113+
}

app/models/user.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ export default ModelBase.extend({
4848
deletedAt : attr('moment'),
4949
lastAccessedAt : attr('moment', { readOnly: true }),
5050

51+
/**
52+
* Billing Contact Information
53+
*/
54+
55+
billingContactName : attr('string'),
56+
billingPhone : attr('string'),
57+
billingCountry : attr('string'),
58+
company : attr('string'),
59+
billingAddress : attr('string'),
60+
billingCity : attr('string'),
61+
billingZipCode : attr('string'),
62+
billingTaxInfo : attr('string'),
63+
billingAdditionalInfo : attr('string'),
64+
billingState : attr('string'),
65+
5166
status: computed('lastAccessedAt', 'deletedAt', function() {
5267
if (this.deletedAt == null) {
5368
if (this.lastAccessedAt == null) {

app/router.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ router.map(function() {
113113
this.route('email-preferences');
114114
this.route('applications');
115115
this.route('danger-zone');
116-
this.route('billing-info', function() {
116+
this.route('billing', function() {
117117
this.route('payment-info');
118118
this.route('invoices');
119119
});

app/routes/account/billing-info/invoices.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

app/routes/account/billing-info/payment-info.js

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import Route from '@ember/routing/route';
2+
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin';
3+
4+
export default class extends Route.extend(AuthenticatedRouteMixin) {
5+
titleToken() {
6+
return this.l10n.t('Billing Info');
7+
}
8+
9+
beforeModel() {
10+
super.beforeModel(...arguments);
11+
this.replaceWith('account.billing.payment-info');
12+
}
13+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Route from '@ember/routing/route';
2+
3+
export default class extends Route {
4+
titleToken() {
5+
return this.l10n.t('Invoices');
6+
}
7+
}

0 commit comments

Comments
 (0)