Skip to content

Commit

Permalink
fix: add billing information in order view page (#3297)
Browse files Browse the repository at this point in the history
* add billing information in order view page

* fix or implementation
  • Loading branch information
uds5501 authored and abhinavk96 committed Jul 30, 2019
1 parent 45b588d commit 9795fb7
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
37 changes: 20 additions & 17 deletions app/components/forms/orders/attendee-list.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import Component from '@ember/component';
import { computed } from '@ember/object';
import { groupBy } from 'lodash-es';
import { or } from '@ember/object/computed';

export default Component.extend({
buyer: computed('data.user', function() {
return this.get('data.user');
}),
holders: computed('data.attendees', function() {
return this.get('data.attendees');
}),
isPaidOrder: computed('data', function() {
if (!this.get('data.amount')) {
return false;
}
return true;
}),
allFields: computed('fields', function() {
return groupBy(this.fields.toArray(), field => field.get('form'));
})
});
export default class extends Component {
@computed('data.user')
get buyer() {
return this.data.user;
}

@computed('data.attendees')
get holders() {
return this.data.attendees;
}

@or('data.amount', 'data.isBillingEnabled')
showBillingInfo;

@computed('fields.@each.form')
get allFields() {
return groupBy(this.fields.toArray(), field => field.form);
}
}
3 changes: 1 addition & 2 deletions app/templates/components/forms/orders/attendee-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
<div class="ui divider"></div>
</div>
{{/each}}

{{#if data.isBillingEnabled}}
{{#if showBillingInfo}}
<div class="print">
<h4 class="ui horizontal divider header">
<i class='ticket icon'></i>
Expand Down

0 comments on commit 9795fb7

Please sign in to comment.