File tree 2 files changed +21
-19
lines changed
templates/components/forms/orders
2 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 1
1
import Component from '@ember/component' ;
2
2
import { computed } from '@ember/object' ;
3
3
import { groupBy } from 'lodash-es' ;
4
+ import { or } from '@ember/object/computed' ;
4
5
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 ( 'fields.@each.form' )
21
+ get allFields ( ) {
22
+ return groupBy ( this . fields . toArray ( ) , field => field . form ) ;
23
+ }
24
+ }
Original file line number Diff line number Diff line change 29
29
<div class =" ui divider" ></div >
30
30
</div >
31
31
{{ /each }}
32
-
33
- {{ #if data.isBillingEnabled }}
32
+ {{ #if showBillingInfo }}
34
33
<div class =" print" >
35
34
<h4 class =" ui horizontal divider header" >
36
35
<i class =' ticket icon' ></i >
You can’t perform that action at this time.
0 commit comments