@@ -2,14 +2,14 @@ import Component from '@ember/component';
2
2
import FormMixin from 'open-event-frontend/mixins/form' ;
3
3
import { validPhoneNumber } from 'open-event-frontend/utils/validators' ;
4
4
import { pick , orderBy } from 'lodash-es' ;
5
- import { action , computed } from '@ember/object' ;
5
+ import { computed } from '@ember/object' ;
6
6
import { countries } from 'open-event-frontend/utils/dictionary/demography' ;
7
7
8
- export default class extends Component . extend ( FormMixin ) {
8
+ export default Component . extend ( FormMixin , {
9
9
didInsertElement ( ) {
10
- super . didInsertElement ( ...arguments ) ;
10
+ this . _super ( ...arguments ) ;
11
11
this . set ( 'userBillingInfo' , pick ( this . authManager . currentUser , [ 'billingContactName' , 'billingCity' , 'billingPhone' , 'company' , 'billingTaxInfo' , 'billingCountry' , 'billingState' , 'billingAddress' , 'billingZipCode' , 'billingAdditionalInfo' ] ) ) ;
12
- }
12
+ } ,
13
13
14
14
getValidationRules ( ) {
15
15
return {
@@ -88,26 +88,26 @@ export default class extends Component.extend(FormMixin) {
88
88
}
89
89
}
90
90
} ;
91
- }
91
+ } ,
92
92
93
- @computed ( )
94
- get countries ( ) {
93
+ countries : computed ( function ( ) {
95
94
return orderBy ( countries , 'name' ) ;
96
- }
95
+ } ) ,
97
96
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
- } ) ;
97
+ actions : {
98
+ submit ( ) {
99
+ this . onValid ( async ( ) => {
100
+ this . set ( 'isLoading' , true ) ;
101
+ try {
102
+ this . authManager . currentUser . setProperties ( this . userBillingInfo ) ;
103
+ await this . authManager . currentUser . save ( ) ;
104
+ this . notify . success ( this . l10n . t ( 'Your billing details has been updated' ) ) ;
105
+ } catch ( error ) {
106
+ this . authManager . currentUser . rollbackAttributes ( ) ;
107
+ this . notify . error ( this . l10n . t ( 'An unexpected error occurred' ) ) ;
108
+ }
109
+ this . set ( 'isLoading' , false ) ;
110
+ } ) ;
111
+ }
112
112
}
113
- }
113
+ } ) ;
0 commit comments