File tree Expand file tree Collapse file tree 2 files changed +21
-19
lines changed
templates/components/forms/orders Expand file tree Collapse file tree 2 files changed +21
-19
lines changed Original file line number Diff line number Diff line change 11import Component from '@ember/component' ;
22import { computed } from '@ember/object' ;
33import { groupBy } from 'lodash-es' ;
4+ import { or } from '@ember/object/computed' ;
45
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 2929 <div class =" ui divider" ></div >
3030 </div >
3131 {{ /each }}
32-
33- {{ #if data.isBillingEnabled }}
32+ {{ #if showBillingInfo }}
3433 <div class =" print" >
3534 <h4 class =" ui horizontal divider header" >
3635 <i class =' ticket icon' ></i >
You can’t perform that action at this time.
0 commit comments