Skip to content

Commit 9795fb7

Browse files
uds5501abhinavk96
authored andcommitted
fix: add billing information in order view page (#3297)
* add billing information in order view page * fix or implementation
1 parent 45b588d commit 9795fb7

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed
+20-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
import Component from '@ember/component';
22
import { computed } from '@ember/object';
33
import { 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+
}

app/templates/components/forms/orders/attendee-list.hbs

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@
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>

0 commit comments

Comments
 (0)